/* Header - Super Elegant Modern Design */
.header {
    background: linear-gradient(135deg, rgba(26, 35, 48, 0.95), rgba(45, 55, 72, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 80px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    margin-right: 2rem;
    transition: transform 0.3s ease;
    z-index: 10;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: auto;
    max-height: 45px;
    width: auto;
    filter: brightness(1.1);
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    gap: 0.25rem;
}

.main-nav li {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.main-nav li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 40px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.main-nav li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.main-nav li a:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.main-nav li a:hover::before {
    opacity: 1;
}

.main-nav li a.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.main-nav li a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 2px;
}

/* IT Hub Button - Premium Styling */
.main-nav li a.it-hub-btn {
    /* Same styling as regular nav items */
}

/* IT Hub button now uses same styling as other nav items */

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

/* Expand hover area to include dropdown region */
.language-switcher::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -12px;
    background: transparent;
    pointer-events: none;
}

.current-lang {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.2;
    min-height: 40px;
}

.current-lang:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.current-lang::after {
    content: '▼';
    font-size: 10px;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.language-switcher:hover .current-lang::after {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    min-width: 140px;
    z-index: 1020;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Desktop hover behavior - only when NOT on mobile viewport */
@media (hover: hover) and (pointer: fine) and (min-width: 993px) {
    .lang-dropdown::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 0;
        right: 0;
        height: 8px;
        background: transparent;
        pointer-events: auto;
    }

    .language-switcher:hover .lang-dropdown,
    .lang-dropdown:hover {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .language-switcher:hover::after {
        pointer-events: auto;
    }
}

/* Mobile/Touch devices - Click-based dropdown - OVERRIDES ALL HOVER */
@media (max-width: 992px) {
    /* Ensure current-lang is always clickable on mobile */
    .current-lang {
        cursor: pointer !important;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        position: relative;
        z-index: 1002;
    }
    
    /* Completely disable hover behavior on mobile first */
    .language-switcher:hover .lang-dropdown,
    .lang-dropdown:hover {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
        pointer-events: none !important;
    }
    
    /* Force click-based behavior only - MUST come after hover rules to override */
    .language-switcher.active .lang-dropdown,
    .language-switcher.active:hover .lang-dropdown {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        z-index: 1030 !important;
    }
    
    /* Remove desktop-only elements */
    .lang-dropdown::before {
        display: none !important;
    }
    
    .language-switcher::after {
        display: none !important;
    }
    
    .language-switcher:hover::after {
        pointer-events: none !important;
    }
    
    /* Ensure dropdown is properly positioned on mobile - INDEPENDENT system */
    .lang-dropdown {
        position: absolute !important;
        right: 0 !important;
        top: calc(100% + 8px) !important;
        min-width: 120px !important;
        z-index: 1020 !important;
        /* Independent z-index - no relation to mobile menu */
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
    }
    
    /* Improve touch targets for mobile */
    .lang-dropdown li a {
        padding: 1rem 1.25rem !important;
        font-size: 15px !important;
        font-weight: 500;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }
    
    /* Make language switcher container higher z-index when active */
    .language-switcher.active {
        z-index: 1025 !important;
        position: relative;
    }
}

/* Removed slideDown animation - now using CSS transitions */

.lang-dropdown li {
    list-style: none;
}

.lang-dropdown li a {
    display: block;
    padding: 0.875rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.lang-dropdown li a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
}

.search-box form {
    display: flex;
    align-items: center;
    position: relative;
}

.search-box input[type="text"] {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 0.65rem 2.8rem 0.65rem 1rem;
    color: #ffffff;
    width: 180px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 400;
}

.search-box input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.search-box input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
    width: 220px;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.search-box button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-box button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

/* Skip to content */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-content:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #ffffff;
    z-index: 1001;
    text-decoration: none;
    border-radius: 0 0 12px 0;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    cursor: pointer;
    padding: 0;
    z-index: 960;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.98);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Large Desktop Responsive */
@media (max-width: 1200px) and (min-width: 993px) {
    .header-container {
        padding: 0 1.2rem;
    }
    
    .logo {
        margin-right: 1.5rem;
    }
    
    .main-nav ul {
        gap: 0.1rem;
    }
    
    .main-nav li a {
        padding: 0.5rem 0.75rem;
        font-size: 12px;
        justify-content: center;
        text-align: center;
    }
    
    .main-nav li a.it-hub-btn {
        /* Same styling as regular nav items */
    }
    
    .header-actions {
        gap: 1rem;
    }
    
    .search-box input[type="text"] {
        width: 130px;
        font-size: 12px;
    }
    
    .search-box input[type="text"]:focus {
        width: 160px;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .header-container {
        padding: 0 1.5rem;
        height: 70px;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: linear-gradient(180deg, rgba(26, 35, 48, 0.98), rgba(45, 55, 72, 0.98));
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 2rem;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
        z-index: 940;
    }
    
    .main-nav.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: 1rem;
        padding: 0 2rem;
        list-style: none;
    }
    
    .main-nav li {
        width: 100%;
        height: auto;
        display: block;
    }
    
    .main-nav li a {
        padding: 1.25rem 1.5rem;
        width: 100%;
        justify-content: center;
        font-size: 16px;
        font-weight: 500;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        text-align: center;
        height: auto;
        min-height: 48px;
        line-height: 1.3;
    }
    
    .main-nav li a:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }
    
    .main-nav li a.it-hub-btn {
        /* Same styling as regular nav items in mobile */
    }
    
    .mobile-menu-toggle {
        display: flex;
        z-index: 960;
    }
    
    .search-box {
        display: none;
    }
    
    .header-actions {
        gap: 1rem;
    }
    
    .language-switcher {
        margin-right: 0;
        position: relative;
        z-index: 1010;
    }
    
    .lang-dropdown {
        z-index: 1020;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 65px;
        padding: 0 1rem;
    }
    
    .main-nav {
        top: 65px;
        height: calc(100vh - 65px);
        padding-top: 1.5rem;
    }
    
    .main-nav ul {
        padding: 0 1.5rem;
        gap: 0.75rem;
    }
    
    .main-nav li a {
        padding: 1rem 1.25rem;
        font-size: 15px;
        border-radius: 14px;
        min-height: 44px;
        line-height: 1.3;
    }
    
    .main-nav li a.it-hub-btn {
        padding: 1.25rem 1.75rem !important;
        margin: 0.75rem 0;
    }
    
    .logo img {
        max-height: 38px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 2.5px 0;
    }
    
    .current-lang {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-container {
        height: 60px;
        padding: 0 0.75rem;
    }
    
    .main-nav {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .logo img {
        max-height: 35px;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle span {
        width: 18px;
        height: 2px;
        margin: 2px 0;
    }
}

/* Smooth scroll behavior for the entire page */
html {
    scroll-behavior: smooth;
}

/* Add padding to body to compensate for fixed header */
body {
    padding-top: 80px;
}

/* Mobile Menu Overlay - Independent z-index system (900-999) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 950;
    display: none;
}

body.menu-open {
    overflow: hidden;
}

/* ================================================================
   Z-INDEX SYSTEM - COMPLETELY INDEPENDENT COMPONENTS
   ================================================================
   Mobile Menu System:     900-999
   - .menu-overlay:        950
   - .mobile-menu-toggle:  960  
   - .main-nav:            940
   
   Language Dropdown:      1000-1099
   - .language-switcher:   1010
   - .lang-dropdown:       1020
   - .lang-dropdown.active: 1030
   - .language-switcher.active: 1025
   
   No cross-dependencies between systems!
   ================================================================ */

@media (max-width: 992px) {
    body {
        padding-top: 70px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 65px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
}
