/* Language Selector Styles - Complete rewrite */
.language-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    z-index: 1050;
}

.current-language {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    color: #fff;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

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

.flag-emoji {
    font-size: 14px;
    margin-right: 6px;
    line-height: 1;
}

.current-language span {
    font-size: 16px;
    font-weight: 400;
    margin-right: 6px;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.current-language i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: auto;
    min-width: 90px;
    background-color: #333;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 3px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1051;
    pointer-events: none;
}

.language-selector.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.language-dropdown li {
    list-style: none;
    margin-bottom: 1px;
}

.language-dropdown li:last-child {
    margin-bottom: 0;
}

.language-dropdown li a {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.language-dropdown li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.language-dropdown li span {
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}

/* RTL styling for Arabic */
html[lang="ar"] .language-selector {
    direction: rtl;
}

html[lang="ar"] .flag-emoji {
    margin-right: 0;
    margin-left: 6px;
}

html[lang="ar"] .current-language span {
    margin-right: 0;
    margin-left: 6px;
}

html[lang="ar"] .language-dropdown {
    right: auto;
    left: 0;
    text-align: right;
}

html[lang="ar"] .language-dropdown li a {
    text-align: right;
}

/* Mobile language selector */
@media (max-width: 1200px) {
    .language-selector {
        display: none;
    }
}

/* Mobile language selector in overlay menu */
.mobile-lang-selector {
    margin-top: 30px;
    text-align: center;
    padding: 0 15px 25px;
    width: 100%;
}

.mobile-lang-selector h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 500;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.lang-option {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 6px 12px;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.2s ease;
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    min-width: 100px;
    margin-bottom: 10px;
}

.lang-option:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.lang-option.active {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.lang-option .flag-emoji {
    font-size: 14px;
    margin-right: 6px;
    line-height: 1;
}

.lang-option span {
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

/* RTL styling for mobile language selector */
html[lang="ar"] .lang-option {
    flex-direction: row-reverse;
}

html[lang="ar"] .lang-option .flag-emoji {
    margin-right: 0;
    margin-left: 6px;
}

@media (max-width: 480px) {
    .lang-options {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
    
    .lang-option {
        min-width: calc(50% - 8px);
        justify-content: center;
    }
} 