/* Employee Tracker Pro - Admin Portal Stylesheet */

:root {
    --bg-main: #f4f5f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --color-primary: #ff6600;
    --color-primary-hover: #e05300;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    height: 100vh;
}

input, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);
}

.border-r {
    border-right: 1px solid var(--border-color);
}
.border-b {
    border-bottom: 1px solid var(--border-color);
}
.border-t {
    border-top: 1px solid var(--border-color);
}

/* Utilities */
.hide {
    display: none !important;
}
.text-center {
    text-align: center;
}
.text-muted {
    color: var(--text-muted);
}
.w-100 {
    width: 100% !important;
}
.mt-20 {
    margin-top: 20px;
}
.p-20 {
    padding: 20px;
}
.text-green { color: var(--color-success); }
.text-blue { color: var(--color-primary); }
.text-amber { color: var(--color-warning); }
.text-red { color: var(--color-danger); }
.bg-green { background-color: var(--color-success) !important; }
.bg-red { background-color: var(--color-danger) !important; }
.height-fit { height: fit-content; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.primary-btn {
    background-color: var(--color-primary);
    color: #fff;
}
.primary-btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.secondary-btn:hover {
    background-color: var(--bg-card-hover);
}

.logout-btn {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 100%;
}
.logout-btn:hover {
    background-color: var(--color-danger);
    color: white;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Inputs and Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .search-input, .dropdown {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus, .search-input:focus, .dropdown:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.15);
}

.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group {
    flex: 1;
}

/* LOGIN LAYOUT */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top right, rgba(255, 102, 0, 0.08), transparent 40%),
                radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 45%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 12px;
    animation: slideUp 0.4s ease-out;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    text-align: center;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(255, 102, 0, 0.15);
    color: var(--color-primary);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 102, 0, 0.25);
}

.login-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.login-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.error-msg {
    margin-top: 14px;
    padding: 10px;
    border-radius: 6px;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
    font-weight: 550;
    font-size: 13px;
}

/* APP MAIN LAYOUT */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    min-width: 260px;
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.sidebar-header .logo-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0;
    border-radius: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-card-hover);
}

.nav-item.active {
    color: #fff;
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary-hover);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.admin-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.admin-info span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* MAIN VIEWPORT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card);
}

.main-header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.viewport {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.tab-viewport {
    animation: fadeIn 0.3s ease-out;
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* DATA CONTAINERS */
.section-card {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
}

/* TABLES */
.table-container {
    overflow-x: auto;
    width: 100%;
}
.max-h-500 {
    max-height: 500px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.015);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* CONTROLS */
.employees-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 400px;
}

/* SELECTOR BAR */
.selector-bar {
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.selector-bar label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* GRID LAYOUTS */
.grid-2-col {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

/* DONUT CHART */
.productivity-pie {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(var(--color-success) 0deg, var(--border-color) 0deg);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.productivity-pie::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background-color: #121214;
    border-radius: 50%;
}

.pie-value {
    position: relative;
    font-size: 26px;
    font-weight: 800;
    color: white;
    z-index: 1;
}

.legend-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* SCREENSHOTS GRID */
.screenshots-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.screenshot-card {
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition-fast);
    cursor: pointer;
}

.screenshot-card:hover {
    transform: translateY(-2px);
}

.screenshot-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.screenshot-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.screenshot-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* MODALS */
.modal-backdrop, .lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-card {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}
.close-modal-btn:hover {
    color: white;
}

.modal-form {
    padding: 24px;
}

.modal-footer {
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* LIGHTBOX */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}
.lightbox-close:hover {
    color: white;
}

.lightbox-caption {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Keyframes */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* MOBILE & RESPONSIVE DESIGN IMPROVEMENTS */
.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mobile-toggle-btn:hover {
    background-color: var(--bg-card-hover);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
}

@media (max-width: 992px) {
    .app-layout {
        position: relative;
    }

    .mobile-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .main-header {
        padding: 0 16px;
    }

    .viewport {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
        padding: 14px 16px !important;
    }

    .card-header > div {
        flex-direction: column;
        width: 100%;
        gap: 8px !important;
    }

    .card-header input, .card-header select {
        width: 100% !important;
    }

    .stats-row {
        flex-direction: column;
        gap: 10px;
    }

    .modal-card {
        max-width: 95%;
        margin: 12px;
    }

    .modal-form {
        padding: 16px;
    }

    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        border-radius: 8px;
    }

    .data-table th, .data-table td {
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    #overview-cards-container {
        grid-template-columns: 1fr !important;
        padding: 14px 16px !important;
        gap: 14px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-header h1 {
        font-size: 15px;
    }

    .login-wrapper {
        padding: 12px;
    }

    .login-card {
        padding: 20px 16px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }
}
