/* Header Styles */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Header Top */
.header-top {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    font-size: 0.875rem;
    backdrop-filter: blur(5px);
}

.header-utility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.utility-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.language-selector {
    position: relative;
}

.language-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.language-btn:hover {
    background: rgba(0, 103, 197, 0.1);
    color: #0067C5;
    transform: translateY(-1px);
}

.arrow-down {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.language-selector:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.language-dropdown a:hover {
    background: #f8f9fa;
}

.help-link {
    color: #0067C5;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.help-link:hover {
    color: #005BB5;
    text-decoration: underline;
}

.sign-in-btn {
    color: #0067C5;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sign-in-btn:hover {
    background: rgba(0, 103, 197, 0.1);
    text-decoration: none;
}

/* Header Main */
.header-main {
    padding: 12px 0;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 48px;
    width: auto;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 40px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #0067C5;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    padding: 20px;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    border-bottom: 2px solid #0067C5;
    padding-bottom: 8px;
}

.dropdown-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-content li {
    margin-bottom: 8px;
}

.dropdown-content a {
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 6px 0;
    display: block;
    transition: color 0.2s ease;
}

.dropdown-content a:hover {
    color: #0067C5;
}

.dropdown-content a.active {
    color: #0067C5;
    font-weight: 600;
}

/* Navigation Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0067C5;
}

.cta-buttons {
    display: flex;
    gap: 12px;
}

.cta-buttons .btn {
    font-size: 0.875rem;
    padding: 10px 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Mobile Styles */
@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
    
    .mobile-menu.active {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .nav-menu {
        gap: 24px;
    }
    
    .cta-buttons .btn {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

@media (max-width: 768px) {
    .header-top {
        display: none;
    }
    
    .nav-center {
        display: none;
    }
    
    .cta-buttons {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-right {
        gap: 8px;
    }
    
    /* Mobile Menu */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        background: rgba(0, 0, 0, 0.8);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    
    .mobile-menu.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1;
    }
    
    .mobile-menu-content {
        position: relative;
        background: white;
        width: 85%;
        max-width: 400px;
        height: 100%;
        margin-left: auto;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu.active .mobile-menu-content {
        transform: translateX(0);
    }
    
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #eee;
        background: white;
        position: sticky;
        top: 0;
        z-index: 3;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        width: 32px;
        height: 32px;
        cursor: pointer;
        padding: 0;
        position: relative;
        border-radius: 50%;
        transition: background-color 0.2s ease;
    }
    
    .mobile-menu-close:hover {
        background-color: #f5f5f5;
    }
    
    .mobile-menu-close span {
        position: absolute;
        width: 18px;
        height: 2px;
        background: #666;
        top: 50%;
        left: 50%;
        transform-origin: center;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-close span:first-child {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    
    .mobile-menu-close span:last-child {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    
    .mobile-menu-body {
        flex: 1;
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-nav-menu {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .mobile-nav-item {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-nav-item:last-child {
        border-bottom: none;
    }
    
    .mobile-nav-link {
        display: block;
        padding: 18px 20px;
        color: #1a1a1a;
        text-decoration: none;
        font-weight: 500;
        font-size: 1.125rem;
        line-height: 1.3;
        transition: all 0.2s ease;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
    }
    
    .mobile-nav-link:hover,
    .mobile-nav-link:focus {
        color: #0067C5;
        background-color: #f8f9fa;
        outline: none;
    }
    
    /* Mobile Dropdown Styles */
    .mobile-nav-item-dropdown .mobile-nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-nav-arrow {
        transition: transform 0.3s ease;
        font-size: 0.875rem;
        color: #666;
    }
    
    .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-arrow {
        transform: rotate(180deg);
    }
    
    .mobile-nav-submenu {
        list-style: none;
        margin: 0;
        padding: 0;
        background-color: #f8f9fa;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .mobile-nav-sublink {
        display: block;
        padding: 12px 20px 12px 40px;
        color: #666;
        text-decoration: none;
        font-size: 1rem;
        font-weight: 400;
        transition: all 0.2s ease;
    }
    
    .mobile-nav-sublink:hover,
    .mobile-nav-sublink:focus {
        color: #0067C5;
        background-color: #e9ecef;
        outline: none;
    }
    
    .mobile-nav-link:hover {
        color: #0067C5;
    }
    
    .mobile-cta-buttons {
        padding: 24px 20px;
        border-top: 1px solid #eee;
        background: white;
        position: sticky;
        bottom: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .mobile-cta-buttons .btn {
        text-align: center;
        padding: 14px 24px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        text-decoration: none;
        transition: all 0.2s ease;
        border: 2px solid transparent;
    }
    
    .mobile-cta-buttons .btn-primary {
        background: #0067C5;
        color: white;
    }
    
    .mobile-cta-buttons .btn-primary:hover {
        background: #0052a3;
        transform: translateY(-1px);
    }
    
    .mobile-cta-buttons .btn-secondary {
        background: transparent;
        color: #0067C5;
        border-color: #0067C5;
    }
    
    .mobile-cta-buttons .btn-secondary:hover {
        background: #0067C5;
        color: white;
        transform: translateY(-1px);
    }
    
    /* Safe Area for phones with notches */
    @supports (padding: max(0px)) {
        .mobile-menu-header {
            padding-top: max(16px, env(safe-area-inset-top));
        }
        
        .mobile-cta-buttons {
            padding-bottom: max(24px, env(safe-area-inset-bottom));
        }
    }
    
    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Menu Toggle Animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Header Scroll Effect */
.main-header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.main-header.scrolled .header-main {
    padding: 8px 0;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .dropdown-menu,
    .language-dropdown,
    .mobile-menu {
        transition: none;
    }
}