/* ============================================
   ProCode EduPulse — Navbar Styles
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: var(--z-sticky);
    transition: background var(--transition-base), height var(--transition-base);
}

/* ── Enhanced Dark Mode Navbar ── */
[data-theme="dark"] .navbar {
    background: rgba(10, 11, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-6);
    max-width: var(--container-xl);
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
    z-index: 10;
}

.nav-brand img {
    height: 32px;
    width: auto;
}

.nav-brand-text {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    white-space: nowrap;
}

.nav-brand-pro {
    color: var(--brand-primary-light);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    justify-content: flex-end;
    margin: 0 var(--space-4);
    overflow: hidden;
}

.nav-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    border-radius: 20px;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.nav-link.active {
    color: var(--brand-primary);
    background: var(--brand-gradient-soft);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* ── Enhanced Dark Mode Navigation Links ── */
[data-theme="dark"] .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand-primary);
}

[data-theme="dark"] .nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: var(--space-1);
    border-radius: 50%;
}

.theme-toggle:hover {
    color: var(--brand-primary-light);
    transform: scale(1.1);
    background: var(--bg-tertiary);
}

.fa-sun {
    color: #fff !important;
}

.nav-menu-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-menu-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.nav-menu-btn i {
    font-size: var(--text-base);
}

/* ── Unified Sidebar ── */
.nav-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.nav-sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.nav-sidebar {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid var(--border-subtle);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-2xl);
}

.nav-sidebar.open {
    transform: translateX(-340px);
}

.sidebar-header {
    padding: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.sidebar-logo img {
    height: 28px;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-close:hover {
    background: var(--color-error-light);
    color: var(--color-error);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

/* User Card */
.sidebar-user-card {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #2980b9 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 120, 212, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.user-avatar-lg {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
}

.user-role {
    font-size: var(--text-xs);
    opacity: 0.8;
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

/* Groups */
.sidebar-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.group-title {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    font-weight: var(--font-bold);
}

.group-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-medium);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.sidebar-link i {
    width: 20px;
    font-size: var(--text-base);
    text-align: center;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar-link.active {
    background: rgba(0, 120, 212, 0.15);
    color: var(--brand-primary-light);
}

.sidebar-link.admin-link {
    color: var(--color-warning);
}

/* Footer */
.sidebar-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--bg-hover);
}

.sidebar-logout, .sidebar-login-btn {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-logout {
    background: rgba(225, 112, 85, 0.1);
    color: var(--color-error);
    border: none;
}

.sidebar-logout:hover {
    background: var(--color-error);
    color: white;
}

.sidebar-login-btn {
    background: var(--brand-primary);
    color: white;
}

/* ── Responsiveness ── */
@media (max-width: 1150px) {
    .nav-links {
        display: none !important;
    }
    
    .navbar .container {
        padding: 0 var(--space-4);
    }

    .nav-brand {
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .nav-brand-text {
        display: none;
    }
    
    .nav-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .nav-sidebar.open {
        transform: translateX(-100%);
    }
    
    .menu-btn-text {
        display: none;
    }
}
