/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-nav);
    z-index: 50;
    padding: 1rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
}

/* Mobile hamburger button - hidden by default, shown on mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--outline);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background-color: var(--surface-variant);
}

@media (max-width: 767px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Desktop navigation - visible by default */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: flex-start;
}

/* Hide mobile menu header on desktop */
.mobile-menu-header {
    display: none;
}

/* Mobile navigation - drawer style (GitHub-inspired) */
@media (max-width: 767px) {
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background-color: var(--surface-container-lowest);
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        box-shadow: 2px 0 16px rgba(0,0,0,0.15);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        gap: 0;
        overflow-y: auto;
    }

    .nav-links.mobile-open {
        left: 0;
    }

    /* Mobile menu header */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--outline-variant);
        background-color: var(--surface-container-low);
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .mobile-menu-brand {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--primary);
    }

    .mobile-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        background: none;
        border: none;
        color: var(--outline);
        cursor: pointer;
        border-radius: 0.5rem;
        transition: background-color 0.2s, color 0.2s;
    }

    .mobile-menu-close:hover {
        background-color: var(--surface-variant);
        color: var(--on-surface);
    }

    .mobile-menu-close .material-symbols-outlined {
        font-size: 1.5rem;
    }

    /* Navigation links */
    .nav-links a {
        display: flex;
        align-items: center;
        gap: 0.875rem;
        width: 100%;
        padding: 0.875rem 1.25rem;
        color: var(--on-surface);
        font-weight: 500;
        font-size: 0.9375rem;
        text-decoration: none;
        border-bottom: 1px solid var(--surface-container);
        transition: background-color 0.2s, color 0.2s;
    }

    .nav-links a .material-symbols-outlined {
        font-size: 1.25rem;
        color: var(--outline);
        transition: color 0.2s;
    }

    .nav-links a:hover {
        background-color: var(--surface-container-low);
        color: var(--primary);
    }

    .nav-links a:hover .material-symbols-outlined {
        color: var(--primary);
    }

    .nav-links a.active {
        background-color: var(--primary-container);
        color: var(--on-primary);
        font-weight: 600;
        border-bottom-color: transparent;
    }

    .nav-links a.active .material-symbols-outlined {
        color: var(--on-primary);
    }
}

/* Mobile overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.mobile-open {
    display: block;
    opacity: 1;
}

.nav-links a {
    color: var(--outline);
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hide dark mode button on very small screens to save space */
@media (max-width: 480px) {
    .nav-actions > div:first-child {
        display: none;
    }
}

/* Auth buttons - responsive */
.nav-auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .nav-auth-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .nav-auth-buttons a,
    .nav-auth-buttons button {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

.icon-btn {
    background: none;
    border: none;
    color: var(--outline);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
}

.icon-btn:hover {
    background-color: var(--surface-variant);
}

