/* ==========================================
   Unified Header & Navigation Styles
   ========================================== */

/* 
   Base Header Container 
   Used across all pages (logged-in and logged-out)
*/
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    padding: var(--spacing-md) 0 var(--spacing-sm) 0;
    width: 100%;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled State - solid background, no transparency */
.site-header.scrolled {
    background: var(--color-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Header Content Wrapper */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 40px;
}

/* Logo */
.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
    text-decoration: none;
}

/* ==========================================
   Navigation Items (Desktop)
   ========================================== */

/* Logged-Out Nav Links */
.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Logged-Out Nav Container */
.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Logged-In Header Actions/Pills */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}

.header-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Plan & Credits Pill */
.plan-credits-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    font-size: var(--font-size-sm);
    text-decoration: none;
    color: var(--color-text-muted);
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
    gap: 8px;
}

.plan-credits-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.plan-credits-pill .plan-label {
    color: var(--color-text);
    font-weight: 500;
}

.plan-credits-pill .pill-divider {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   Hamburger Menu (Unified)
   ========================================== */

/* Hidden by default on Desktop */
.hamburger {
    display: none !important;
    /* Overridden in media query */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    z-index: 9999;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: none !important;
    /* Prevent load animation */
    animation: none !important;
    pointer-events: auto;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Active State (X shape) */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================
   Mobile Responsive Styles
   ========================================== */
@media (max-width: 768px) {

    /* Header Positioning - always solid background on mobile */
    .site-header {
        top: 0;
        height: 70px;
        padding: 0;
        display: flex;
        align-items: center;
        background: var(--color-bg);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .site-header .container {
        padding: 0 24px;
        height: 100%;
        display: flex;
        align-items: center;
        width: 100%;
    }

    /* Center Logo */
    .header-content {
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .logo-text {
        font-size: var(--font-size-lg);
    }

    /* Show Hamburger */
    .hamburger {
        display: flex !important;
    }

    /* Mobile Navigation Menu (Slide-down) */
    .header-actions,
    .nav {
        display: flex;
        position: fixed;
        top: -100vh;
        left: 0;
        width: 100%;
        height: auto;
        min-height: 100vh;
        background: rgba(15, 15, 25, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 90px var(--spacing-lg) var(--spacing-lg);
        gap: var(--spacing-xs);
        transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        z-index: 1001;
    }

    /* Active Menu State */
    .header-actions.active,
    .nav.active {
        display: flex;
        top: 0;
        right: 0;
    }
    
    /* Ensure menu items are clickable */
    .header-actions.active *,
    .nav.active * {
        pointer-events: auto;
    }

    /* Mobile Menu Items */
    .header-pill,
    .plan-credits-pill,
    .nav-link {
        font-size: var(--font-size-base);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: 8px;
        text-align: left;
        width: 100%;
        justify-content: flex-start;
        display: flex;
        white-space: nowrap;
        /* Prevent wrapping */
    }
}