/* ===================================================================
   🎯 HEADER & NAVIGATION CSS - MODULAR VERSION
   =================================================================== */

/* ===== NAVBAR CONTAINER ===== */
.navbar {
    position: fixed;
    top: 8px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: calc(1200px - 32px);
    margin: 0 auto;
    background: var(--gradient-nav);
    backdrop-filter: blur(32px) saturate(220%) brightness(1.05);
    -webkit-backdrop-filter: blur(32px) saturate(220%) brightness(1.05);
    border: 1px solid var(--glass-border-strong);
    border-radius: 20px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 0.9) inset,
        0 4px 24px var(--shadow-light),
        0 12px 48px var(--shadow-medium),
        0 2px 16px var(--shadow-colored),
        0 2px 24px var(--shadow-purple);
    will-change: transform, opacity;
    transform: translateY(0) translateZ(0);
    opacity: 1;
    pointer-events: auto;
}

/* ===== NAVBAR STATES ===== */
.navbar.hidden {
    transform: translateY(-100%) translateZ(0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: fixed !important;
    z-index: 9999 !important;
}

.navbar.visible {
    transform: translateY(0) translateZ(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: fixed !important;
    z-index: 9999 !important;
}

.navbar.scrolled {
    left: 24px;
    right: 24px;
    background: var(--glass-bg-ultra);
    backdrop-filter: blur(40px) saturate(250%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(250%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 1) inset,
        0 6px 32px var(--shadow-medium),
        0 16px 64px var(--shadow-light),
        0 4px 20px var(--shadow-colored),
        0 4px 32px var(--shadow-purple);
}

/* ===== DARK MODE NAVBAR ===== */
.dark-mode .navbar {
    background: rgba(28, 28, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 0.1) inset,
        0 4px 32px rgba(0, 0, 0, 0.4),
        0 12px 64px rgba(0, 0, 0, 0.3),
        0 2px 16px rgba(124, 58, 237, 0.15);
}

.dark-mode .navbar.scrolled {
    background: rgba(28, 28, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(40px) saturate(220%);
    -webkit-backdrop-filter: blur(40px) saturate(220%);
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 0.12) inset,
        0 6px 48px rgba(0, 0, 0, 0.5),
        0 16px 80px rgba(0, 0, 0, 0.4),
        0 4px 24px rgba(124, 58, 237, 0.2);
}

/* ===== NAV CONTAINER ===== */
.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
    position: relative;
}

/* ===== LOGO ===== */
.nav-logo a {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 70%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    letter-spacing: -0.8px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: relative;
    border-radius: 12px;
    padding: 8px 12px;
    overflow: hidden;
}

.nav-logo a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.8s ease;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
}

.nav-logo a:hover {
    transform: scale(1.06) translateY(-1px);
    filter: drop-shadow(0 4px 8px rgba(0, 122, 255, 0.2));
}

.nav-logo a:hover::before {
    left: 100%;
    opacity: 1;
}

.nav-logo i {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 70%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== NAVIGATION MENU ===== */
.nav-menu {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ===== NAVIGATION LINKS ===== */
.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    padding: 12px 20px;
    border-radius: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: -0.2px;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link i {
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0.8;
}

.nav-link:hover {
    color: var(--accent-primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 32px var(--shadow-colored),
        0 4px 16px var(--shadow-purple),
        0 2px 8px var(--shadow-medium),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-link:hover i {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
}

.dark-mode .nav-link:hover {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 8px 24px rgba(0, 122, 255, 0.15),
        0 4px 12px rgba(0, 122, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 75%;
}

.nav-link.active {
    color: var(--accent-primary) !important;
    background: linear-gradient(135deg, 
        rgba(var(--accent-primary-rgb), 0.2) 0%, 
        rgba(var(--accent-primary-rgb), 0.1) 100%
    ) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid var(--accent-primary) !important;
    font-weight: 700 !important;
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 25px rgba(var(--accent-primary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
}

.nav-link.active i {
    opacity: 1;
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(var(--accent-primary-rgb), 0.3));
}

/* ===== NAV CONTROLS ===== */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* Mobile responsive - show on smaller screens */
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    
    /* NO BACKGROUND - CLEAN DESIGN */
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    
    /* Better touch targets */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.hamburger:hover {
    transform: scale(1.05);
    /* ENSURE NO BACKGROUND ON HOVER */
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.dark-mode .hamburger:hover {
    /* ENSURE NO BACKGROUND IN DARK MODE */
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===== HAMBURGER BARS ===== */
.bar {
    width: 22px;
    height: 2.5px;
    background: var(--text-primary);
    margin: 2.5px 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 2px;
    transform-origin: center;
}

/* ===== HAMBURGER ANIMATION TO X ===== */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

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

/* ===================================================================
   📱 MOBILE RESPONSIVE NAVIGATION
   =================================================================== */

/* Main Mobile Media Query - Tablets and Mobile */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 20px;
        top: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }

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

    /* Show hamburger on mobile */
    .hamburger {
        display: flex !important;
        z-index: 1001 !important;
        /* FORCE NO BACKGROUND ON MOBILE */
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }

    /* Transform desktop nav-menu into mobile dropdown */
    .nav-menu {
        position: fixed !important;
        top: 80px !important;
        left: 12px !important;
        right: 12px !important;
        flex-direction: column !important;
        background: var(--gradient-nav) !important;
        backdrop-filter: blur(32px) saturate(220%) brightness(1.05) !important;
        -webkit-backdrop-filter: blur(32px) saturate(220%) brightness(1.05) !important;
        border: 1px solid var(--glass-border-strong) !important;
        border-radius: 20px !important;
        padding: 2rem !important;
        gap: 1rem !important;
        max-height: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-20px) !important;
        box-shadow: 
            0 1px 0 0 rgba(255, 255, 255, 0.9) inset,
            0 8px 32px var(--shadow-medium),
            0 16px 64px var(--shadow-heavy),
            0 4px 24px var(--shadow-colored) !important;
        z-index: 999 !important;
        pointer-events: none !important;
    }

    .dark-mode .nav-menu {
        background: rgba(28, 28, 30, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        backdrop-filter: blur(32px) saturate(200%) !important;
        box-shadow: 
            0 1px 0 0 rgba(255, 255, 255, 0.1) inset,
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 16px 64px rgba(0, 0, 0, 0.6) !important;
    }

    /* Active Mobile Menu State */
    .nav-menu.active {
        max-height: 500px !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }

    /* Override nav-link styles for mobile */
    .nav-link {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 1rem 1.5rem !important;
        border-radius: 12px !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        gap: 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid transparent !important;
        margin: 0 !important;
        transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
    }

    .dark-mode .nav-link {
        background: rgba(255, 255, 255, 0.03) !important;
    }

    .nav-link:hover {
        background: rgba(var(--accent-primary-rgb, 0, 122, 255), 0.1) !important;
        border-color: rgba(var(--accent-primary-rgb, 0, 122, 255), 0.3) !important;
        transform: translateX(8px) !important;
        box-shadow: none !important;
    }

    .nav-link.active {
        background: linear-gradient(135deg, 
            rgba(var(--accent-primary-rgb, 0, 122, 255), 0.2) 0%, 
            rgba(var(--accent-primary-rgb, 0, 122, 255), 0.1) 100%
        ) !important;
        border-color: rgba(var(--accent-primary-rgb, 0, 122, 255), 0.5) !important;
        color: var(--accent-primary) !important;
        transform: translateX(8px) !important;
    }

    .nav-link i {
        font-size: 1.1rem !important;
        min-width: 20px !important;
    }

    /* Mobile animation reset and rebuild */
    .nav-menu .nav-link {
        opacity: 0;
        transform: translateY(20px);
    }

    .nav-menu.active .nav-link {
        animation: mobileSlideIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }

    .nav-menu.active .nav-link:nth-child(1) { animation-delay: 0.1s; }
    .nav-menu.active .nav-link:nth-child(2) { animation-delay: 0.15s; }
    .nav-menu.active .nav-link:nth-child(3) { animation-delay: 0.2s; }
    .nav-menu.active .nav-link:nth-child(4) { animation-delay: 0.25s; }
    .nav-menu.active .nav-link:nth-child(5) { animation-delay: 0.3s; }

    @keyframes mobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Mobile overlay */
    .nav-menu.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: -1;
        animation: overlayFadeIn 0.3s ease-out;
        pointer-events: none;
    }

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

/* Small Mobile Adjustments */
@media (max-width: 768px) {
    .navbar {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 0 16px;
    }

    .nav-logo a {
        font-size: 1.1rem;
    }

    .nav-logo i {
        font-size: 1.3rem;
    }

    .nav-menu {
        top: 70px !important;
        left: 8px !important;
        right: 8px !important;
        padding: 1.5rem !important;
    }

    .nav-link {
        padding: 0.8rem 1.2rem !important;
        font-size: 0.95rem !important;
    }

    .hamburger {
        width: 40px !important;
        height: 40px !important;
        /* FORCE NO BACKGROUND ON SMALL MOBILE */
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }

    .bar {
        width: 18px !important;
    }
}

/* ===== DARK MODE ACTIVE STATES ===== */
.dark-mode .nav-link.active {
    color: var(--accent-primary) !important;
    background: linear-gradient(135deg, 
        rgba(var(--accent-primary-rgb), 0.2) 0%, 
        rgba(var(--accent-primary-rgb), 0.1) 100%
    ) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid var(--accent-primary) !important;
    font-weight: 700 !important;
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 25px rgba(var(--accent-primary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
}

.dark-mode .nav-link.active:hover {
    background: linear-gradient(135deg, 
        rgba(var(--accent-primary-rgb), 0.3) 0%, 
        rgba(var(--accent-primary-rgb), 0.15) 100%
    ) !important;
    border-color: var(--accent-primary) !important;
    transform: translateY(-3px) !important;
    box-shadow: 
        0 12px 32px rgba(var(--accent-primary-rgb), 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.dark-mode .nav-link:hover {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 8px 24px rgba(0, 122, 255, 0.15),
        0 4px 12px rgba(0, 122, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
} 