/* Language Switcher Styles */
.language-switcher-wrapper {
    margin-left: 1rem;
    position: relative;
    display: flex;
    align-items: center;
}

.language-switcher {
    position: relative;
    display: inline-block;
}

.current-language {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: space-between;
}

.current-language:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.current-language .flag {
    font-size: 1rem;
}

.current-language .lang-code {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.current-language .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.language-switcher.active .dropdown-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 0.5rem;
}

.language-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.language-option {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
    color: #374151;
    font-size: 0.875rem;
}

.language-option:hover {
    background-color: #f3f4f6;
}

.language-option.active {
    background-color: #3b82f6;
    color: white;
}

.language-option .flag {
    font-size: 1.1rem;
}

.language-option .lang-name {
    font-weight: 500;
}

/* Mobile Styles */
@media (max-width: 991px) {
    .language-switcher-wrapper {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .current-language {
        width: 100%;
        justify-content: space-between;
    }

    .language-dropdown {
        right: auto;
        left: 0;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .language-switcher-wrapper {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .current-language {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .language-option {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Dark theme support */
.navbar-menu.dark-menu .current-language {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.navbar-menu.dark-menu .current-language:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

/* Webflow Navigation Overrides */
.w-nav-menu .language-switcher-wrapper {
    display: block;
}

.w-nav-menu[style*="display: block"] .language-switcher-wrapper {
    display: block;
}

/* Animation for smoother transitions */
.language-switcher * {
    box-sizing: border-box;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .current-language {
        border-width: 2px;
    }

    .language-dropdown {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .current-language,
    .language-dropdown,
    .language-option,
    .dropdown-arrow {
        transition: none;
    }
}

/* RTL (Right-to-Left) Language Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .language-option {
    text-align: right;
    flex-direction: row-reverse;
}

[dir="rtl"] .current-language {
    flex-direction: row-reverse;
}

[dir="rtl"] .navbar-menu {
    direction: rtl;
}

[dir="rtl"] .nav-menu-wrap {
    flex-direction: row-reverse;
}

[dir="rtl"] .left-side-block,
[dir="rtl"] .right-side-block {
    flex-direction: row-reverse;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .container,
body.rtl .w-container {
    direction: rtl;
}

/* Fix for Webflow components in RTL */
body.rtl .w-nav-menu {
    text-align: right;
}

body.rtl .w-dropdown-toggle {
    text-align: right;
}

body.rtl .w-dropdown-list {
    text-align: right;
}