/**
 * Enterprise Navigation System v1.0
 * 
 * Inspired by: Infosys Website Navigation
 * Features: Double-line hover animation, smooth transitions, premium feel
 * 
 * Design Language: Corporate • Professional • Premium
 */

/* =============================================================================
   1. Header - Premium Transparent Glass Style
   ============================================================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.5);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header--scrolled,
.header.scrolled {
    background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

/* Header hidden state on scroll down */
.header--hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}
    /* =============================================================================
                   1b. Header - Hero Mode (Light solid background on all pages)
       ============================================================================= */
    
    .header--hero {
        background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid rgba(0, 0, 0, 0.08);
                box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
        }
        
                /* Home & service pages - same light background */
        .home-page .header--hero:not(.scrolled),
        .service-page .header--hero:not(.scrolled) {
        background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid rgba(0, 0, 0, 0.08);
            box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    }
    
    .header--hero .nav-link,
    .header--hero .header__nav-link {
        color: #1e293b;
    }
    
        /* Active nav link */
    .header--hero .nav-link.active,
    .header--hero .header__nav-link.active {
        color: #0c5488;
        font-weight: 600;
    }

    .header--hero .nav-link:hover,
    .header--hero .header__nav-link:hover {
        color: #0c5488;
    }
    
    .header--hero .nav-link::after,
    .header--hero .header__nav-link::after {
        background: #0c5488;
    }
    
    .header--hero .btn-ghost {
        color: #1e293b;
            border-color: rgba(0, 0, 0, 0.15);
    }
    
    .header--hero .btn-ghost:hover {
        background: rgba(12, 84, 136, 0.08);
            color: #0c5488;
    }
    
    .header--hero .btn-primary {
        background: #0c5488;
            color: #ffffff;
            border-color: #0c5488;
    }
    
    .header--hero .btn-primary:hover {
        background: #094068;
    }
    
    /* User name badge in hero mode */
    .header--hero .user-name {
        background: #f1f5f9 !important;
            color: #1e293b;
    }

        /* Logo - full visibility on light bg */
    .header--hero .logo-img {
        filter: none;
    }
    
        /* When scrolled, keep light background */
    .header--hero.scrolled {
        background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .header--hero.scrolled .nav-link,
    .header--hero.scrolled .header__nav-link {
        color: #1e293b;
    }

    .header--hero.scrolled .nav-link.active,
    .header--hero.scrolled .header__nav-link.active {
        color: #0c5488;
        font-weight: 600;
    }

    .header--hero.scrolled .nav-link::after,
    .header--hero.scrolled .header__nav-link::after {
        background: #0c5488;
    }

    .header--hero.scrolled .btn-ghost {
        color: #1e293b;
            border-color: rgba(0, 0, 0, 0.15);
    }

    .header--hero.scrolled .btn-primary {
        background: #0c5488;
            color: #ffffff;
            border-color: #0c5488;
    }

    .header--hero.scrolled .user-name {
        background: #f1f5f9 !important;
            color: #1e293b;
    }

    .header--hero.scrolled .logo-img {
        filter: none;
    }

    /* Never hide header on hero pages */
    .header--hero.header--hidden {
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

/* Nav alignment fix - all items on same line */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
        list-style: none;
        height: 100%;
    }
    
    .nav-item {
        display: flex;
        align-items: center;
        height: 100%;
}

/* Hide mobile auth links on desktop */
.nav-item.mobile-auth-link {
    display: none !important;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

/* Ensure nav links and buttons align to same baseline */
.nav-link,
.nav-actions .btn {
    display: flex;
    align-items: center;
}
/* =============================================================================
   2. Top Bar - Clean Corporate Info Bar
   ============================================================================= */

.header__topbar {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    padding: 8px 0;
    font-size: 13px;
}

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

.header__topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header__topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    transition: color 0.2s ease;
}

.header__topbar-link:hover {
    color: #ffffff;
}

.header__topbar-link svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.header__topbar-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(230, 0, 18, 0.9);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 4px;
}

/* =============================================================================
   3. Main Header - Navigation Container
   ============================================================================= */

.header__main {
    padding: 0;
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header__logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* =============================================================================
   4. Navigation - Infosys-Style Double Underline Hover Effect
   ============================================================================= */

.header__nav {
    display: flex;
    align-items: center;
}

.header__nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header__nav-item {
    position: relative;
}

/* === MAIN NAV LINK STYLING (Works with both .header__nav-link and .nav-link) === */
.header__nav-link,
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    
    /* Typography - Enterprise Style */
    font-family: 'Inter', 'Myriad Pro', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #334155;
    text-decoration: none;
    
    /* Transition */
    transition: color 0.3s ease;
}

.header__nav-link svg,
.nav-link svg {
    width: 10px;
    height: 10px;
    transition: transform 0.3s ease;
}

/* === DOUBLE SWEEP UNDERLINE ANIMATION - EXACT INFOSYS STYLE === */

/* Single thin underline with double-sweep keyframe animation */
.header__nav-link::after,
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
        left: 20px;
        right: 20px;
    height: 2px;
    background: #e60012;
    transform: scaleX(0);
        transform-origin: left center;
        will-change: transform;
}

/* Remove the ::before pseudo element (single line only) */
.header__nav-link::before,
.nav-link::before {
    display: none;
}

/* Hover State - Trigger double sweep animation */
.header__nav-link:hover,
.nav-link:hover {
    color: #0f172a;
}

.header__nav-link:hover::after,
.nav-link:hover::after {
    animation: doubleSweep 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.header__nav-link:hover svg,
.nav-link:hover svg {
    transform: rotate(180deg);
}

/* Double Sweep Keyframes - Fast left-to-right twice */
@keyframes doubleSweep {
    0% {
        transform: scaleX(0);
        transform-origin: left center;
    }

    35% {
        transform: scaleX(1);
        transform-origin: left center;
    }

    36% {
        transform: scaleX(1);
        transform-origin: right center;
    }

    50% {
        transform: scaleX(0);
        transform-origin: right center;
    }

    51% {
        transform: scaleX(0);
        transform-origin: left center;
    }

    85% {
        transform: scaleX(1);
        transform-origin: left center;
    }

    100% {
        transform: scaleX(1);
        transform-origin: left center;
    }
}
/* Active State */
.header__nav-link.active,
.nav-link.active {
    color: #0f172a;
    font-weight: 600;
}

.header__nav-link.active::after,
.nav-link.active::after {
    transform: scaleX(1);
        transform-origin: left center;
}

/* =============================================================================
   5. Dropdown Menu - Enterprise Style
   ============================================================================= */

.header__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    padding: 12px 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.12),
        0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.header__nav-item--dropdown:hover .header__dropdown,
.header__nav-item.dropdown:hover .header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__dropdown-content {
    display: flex;
    flex-direction: column;
}

.header__dropdown-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.header__dropdown-link:hover {
    background: #f8fafc;
    color: #0f172a;
    border-left-color: #e60012;
    padding-left: 28px;
}

.header__dropdown-link--all {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
    color: #e60012;
}

.header__dropdown-link--all:hover {
    color: #c5000f;
}

/* =============================================================================
   6. Header Actions
   ============================================================================= */

.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header__action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* =============================================================================
   7. Mobile Menu Toggle
   ============================================================================= */

.header__mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.header__mobile-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #334155;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* =============================================================================
   8. Search Overlay
   ============================================================================= */

.header__search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 24px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e2e8f0;
}

.header__search-form {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.header__search-input {
    flex: 1;
    height: 52px;
    padding: 0 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.header__search-input:focus {
    border-color: #e60012;
}

.header__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #e60012;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.header__search-btn:hover {
    background: #c5000f;
}

/* =============================================================================
   9. Mobile Menu
   ============================================================================= */

.header__mobile-menu {
    position: fixed;
    top: 120px; /* Adjust based on header height */
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    padding: 24px;
    overflow-y: auto;
    z-index: 999;
}

.header__mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header__mobile-link {
    display: block;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 500;
    color: #334155;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.header__mobile-link:hover,
.header__mobile-link.active {
    background: #f8fafc;
    color: #0f172a;
}

/* =============================================================================
   10. Responsive Design
   ============================================================================= */

@media (max-width: 1200px) {
    .header__nav-link {
        padding: 12px 14px;
        font-size: 14px;
    }
}

@media (max-width: 1024px) {
    .header__nav {
        display: none;
    }
    
    .header__mobile-toggle {
        display: flex;
    }
    
    .header__content {
        height: 70px;
    }
    
    .header__logo-img {
        height: 40px;
    }
}

@media (max-width: 640px) {
    .header__topbar-left {
        display: none;
    }
    
    .header__topbar-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
}

/* =============================================================================
   11. Alternative Hover Effects (Variants)
   ============================================================================= */

/* Slide from left variant */
.nav-hover-slide-left .header__nav-link::before,
.nav-hover-slide-left .header__nav-link::after {
    left: 20px;
    transform: none;
}

.nav-hover-slide-left .header__nav-link:hover::before {
    width: calc(100% - 40px);
}

.nav-hover-slide-left .header__nav-link:hover::after {
    width: calc(100% - 60px);
}

/* Single thick line variant */
.nav-hover-single .header__nav-link::after {
    display: none;
}

.nav-hover-single .header__nav-link::before {
    height: 3px;
    bottom: 4px;
}

/* Bracket effect variant */
.nav-hover-bracket .header__nav-link::before,
.nav-hover-bracket .header__nav-link::after {
    width: 0;
    height: 16px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border-top: 2px solid #e60012;
    border-bottom: 2px solid #e60012;
}

.nav-hover-bracket .header__nav-link::before {
    left: 10px;
    border-left: 2px solid #e60012;
}

.nav-hover-bracket .header__nav-link::after {
    right: 10px;
    left: auto;
    border-right: 2px solid #e60012;
}

.nav-hover-bracket .header__nav-link:hover::before,
.nav-hover-bracket .header__nav-link:hover::after {
    width: 8px;
}
