/* ===== HEADER & BURGER MENU STYLES ===== */

/* Language Switcher */
.language-switcher {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    display: flex !important;
    gap: 5px !important;
}

.lang-btn {
    padding: 8px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    min-width: 45px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lang-btn.active,
.lang-btn:hover {
    border-color: #00d4ff !important;
    background: rgba(0, 212, 255, 0.2) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3) !important;
}

.flag-icon {
    width: 24px !important;
    height: 18px !important;
    display: block !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    min-width: 24px !important;
    min-height: 18px !important;
    max-width: 24px !important;
    max-height: 18px !important;
}

/* Header */
.header {
    position: fixed !important;
    top: 0 !important;
    width: 100% !important;
    background: rgba(10, 15, 26, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 
                0 1px 0 rgba(0, 212, 255, 0.1) !important;
    z-index: 999 !important;
    transition: all 0.3s ease !important;
    min-height: 60px !important;
}

.nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem 2rem !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    width: 100% !important;
    min-height: 60px !important;
}

.logo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.3s ease !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: none !important;
}

/* Убираем смещение логотипа вправо на ПК */
@media (min-width: 769px) {
    .logo {
        margin-left: 0 !important;
    }
}

.logo:hover {
    background: transparent !important;
    transform: translateY(-1px) scale(1.02) !important;  
    box-shadow: none !important;
}

.logo-img {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4)) !important;
    transition: transform 0.3s ease, filter 0.3s ease !important;
    border-radius: 6px !important;
}

.logo:hover .logo-img {
    transform: scale(1.06) !important;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.7)) !important;
}

.logo-text {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.1 !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.5) !important;
    background: linear-gradient(135deg, #ffffff 0%, #00d4ff 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* LOGO ANIMATION - ЗАМЕТНЫЕ ЭФФЕКТЫ */
@keyframes logoGlow {
    0%, 100% { 
        background-position: 0% 50% !important;
        text-shadow: 0 0 15px rgba(0, 212, 255, 0.6), 0 0 30px rgba(0, 212, 255, 0.3) !important;
    }
    50% { 
        background-position: 100% 50% !important;
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 0 0 40px rgba(0, 212, 255, 0.5) !important;
    }
}

.nav-menu {
    display: flex !important;
    list-style: none !important;
    gap: 2rem !important;
}

.nav-menu a {
    color: white !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.3s ease !important;
    position: relative !important;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #00d4ff !important;
}

.nav-menu a::after {
    content: '' !important;
    position: absolute !important;
    bottom: -5px !important;
    left: 0 !important;
    width: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, #00d4ff, #0099cc) !important;
    transition: width 0.3s ease !important;
    border-radius: 1px !important;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative !important;
}

.dropdown-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.dropdown-toggle i {
    font-size: 0.8rem !important;
    transition: transform 0.3s ease !important;
    display: inline-block !important;
    color: #00d4ff !important;
    margin-left: 0.5rem !important;
    width: auto !important;
    height: auto !important;
}

/* Fallback for FontAwesome */
.dropdown-toggle i::before {
    content: "▼" !important;
    font-family: Arial, sans-serif !important;
    font-style: normal !important;
}

.dropdown-toggle i.fas.fa-chevron-down::before {
    content: "";    
}

/* Specific style for dropdown arrow */
.dropdown-arrow {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;  
    font-size: 0.8rem !important;
    color: #ffffff !important;
    margin-left: 0.5rem !important;
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg) !important;  
}

.dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: rgba(15, 20, 25, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    border-radius: 12px !important;
    min-width: 280px !important;
    padding: 0.5rem 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
}

.dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0.75rem 1.5rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important;
    margin: 0 0.5rem !important;
}

.dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    color: #00d4ff !important;
    transform: translateX(5px) !important;
}

.dropdown-item i {
    color: #00d4ff !important;
    font-size: 1.1rem !important;
    width: 20px !important;
    text-align: center !important;
}

.dropdown-item span {
    font-weight: 500 !important;
}

.dropdown-item.active {
    background: rgba(0, 212, 255, 0.2) !important;
    color: #00d4ff !important;
}

.hamburger {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    transition: all 0.3s ease !important;
}

.hamburger i {
    font-size: 18px !important;
    color: #00d4ff !important;
    transition: all 0.3s ease !important;
}

.hamburger:hover {
    background: rgba(0, 212, 255, 0.2) !important;
    border-color: rgba(0, 212, 255, 0.5) !important;
    transform: scale(1.05) !important;
}

.hamburger:hover i {
    color: #ffffff !important;
}

/* Fixed hamburger for mobile */
.fixed-hamburger {
    position: fixed !important;
    top: 15px !important;
    right: 24px !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 3000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15,20,25,0.95) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.fixed-hamburger:hover {
    background: rgba(0,212,255,0.2) !important;
    border-color: rgba(0, 212, 255, 0.5) !important;
    transform: scale(1.05) !important;
}

.fixed-hamburger i {
    font-size: 18px !important;
    color: #00d4ff !important;
    transition: all 0.3s ease !important;
}

.fixed-hamburger:hover i {
    color: #ffffff !important;
}

.fixed-hamburger.active i {
    transform: rotate(90deg) !important;
    color: #ff6b6b !important;
}

/* Overlay */
.menu-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(0,0,0,0.55) !important;
    z-index: 2999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s !important;
}

.menu-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Off-canvas menu */
.offcanvas-menu {
    position: fixed !important;
    top: 0 !important; right: -320px !important;
    width: 320px !important;
    height: 100vh !important;
    background: #10151c !important;
    z-index: 3001 !important;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 40px 24px 24px 24px !important;
    transition: right 0.35s cubic-bezier(.77,0,.18,1) !important;
}

.offcanvas-menu.active {
    right: 0 !important;
}

.offcanvas-menu .menu-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 28px !important;
    margin-bottom: 40px !important;
}

.offcanvas-menu .menu-nav a {
    color: #fff !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

.offcanvas-menu .menu-nav a:hover {
    color: #00d4ff !important;
}

/* Languages inside menu */
.offcanvas-menu .menu-langs {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 32px !important;
    justify-content: flex-start !important;
}

.offcanvas-menu .lang-btn {
    min-width: 48px !important;
    height: 44px !important;
    font-size: 1.3rem !important;
    border-radius: 10px !important;
    border: 2px solid #00d4ff !important;
    background: #181f29 !important;
    color: #fff !important;
    transition: background 0.2s, border 0.2s !important;
}

.offcanvas-menu .lang-btn.active,
.offcanvas-menu .lang-btn:hover {
    background: #00d4ff !important;
    color: #10151c !important;
    border-color: #fff !important;
}

/* Mobile navigation fixes */
@media (max-width: 900px) {
    .nav-container {
            position: relative !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }
    
    /* HIDE BOTH language switchers on mobile */
    .language-switcher {
        display: none !important;
    }
    
    .header .language-switcher {
        display: none !important;
    }
    
    /* HIDE desktop navigation on mobile */
    .nav-menu {
        display: none;      
    }

    /* Logo STRICTLY LEFT */
    .logo {
        order: 0;
        margin-right: auto;
    }

    .hamburger {
        display: none !important;
    }
    
    .fixed-hamburger {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .language-switcher {
        top: 10px !important;  
        right: 10px !important;
        gap: 3px !important;   
    }
    
    .lang-btn {
        padding: 6px 10px !important;
        font-size: 0.9rem !important;
    }
    
    .hamburger {
        right: 15px !important;
    }
    
    .nav-container {
        padding: 1rem 1.5rem !important;
    }
}

/* RTL Support for Header */
.rtl-mode {
    direction: rtl !important;
    text-align: right !important;
}

.rtl-mode .nav-container {
    direction: rtl !important;
}

.rtl-mode .nav-menu {
    direction: rtl !important;
}

.rtl-mode .language-switcher {
    left: 20px !important;
    right: auto !important;
}

.rtl-mode .hamburger {
    order: -1 !important;
}

.rtl-mode .logo {
    flex-direction: row !important;
    order: 1 !important;
}

/* Элементы внутри логотипа не должны менять порядок */
.rtl-mode .logo-img {
    order: 1 !important;
}

.rtl-mode .logo-text {
    order: 0 !important;
}

/* Универсальные стили для корректного отображения логотипа */
.logo {
    flex-direction: row !important;
}

.logo-img {
    order: 1 !important;
}

.logo-text {
    order: 2 !important;
}

/* DESKTOP VIEWPORT FIX - ENSURE PROPER HEIGHT ON PC */
@media screen and (min-width: 769px) {
    .offcanvas-menu {
        height: 100vh !important; /* Standard viewport height for desktop */
        max-height: none !important; /* Remove mobile restrictions */
    }
    
    /* Ensure body works properly on desktop */
    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    html {
        height: auto !important; /* Let content determine height */
    }
}

/* MOBILE VIEWPORT FIX - PREVENT CONTENT CLIPPING */
@media screen and (max-width: 768px) {
    .offcanvas-menu {
        height: 100dvh !important; /* Dynamic viewport height for mobile */
        min-height: 100vh !important; /* Fallback */
    }
    
    /* Ensure body doesn't overflow on mobile */
    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* Fix for mobile Chrome address bar hiding */
    html {
        height: 100%;
        height: 100dvh;
    }
}
