/* Language Switcher and i18n Styles */

.language-switcher {
    position: relative;
    margin-left: 20px;
}

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

.language-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-toggle .current-flag {
    font-size: 16px;
}

.language-toggle .current-lang {
    font-weight: 600;
}

.language-toggle .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

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

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
    z-index: 9999;
}

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

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.language-option:last-child {
    border-bottom: none;
}

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

.language-option .flag {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.language-option .name {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* RTL Support for Arabic */
[dir="rtl"] .language-menu {
    right: auto;
    left: 0;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 10px;
    }
    
    .language-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .language-menu {
        min-width: 160px;
        right: -20px;
    }
    
    [dir="rtl"] .language-menu {
        right: auto;
        left: -20px;
    }
}

/* Animation for language changes */
[data-i18n] {
    transition: opacity 0.3s ease;
}

[data-i18n].translating {
    opacity: 0.7;
}

/* Special styling for RTL languages */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .header-top-left-content,
[dir="rtl"] .header-top-right-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    text-align: right;
}

/* Language indicator for debugging */
.language-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 9999;
    opacity: 0.8;
}

/* Accessibility improvements */
.language-toggle:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.language-option:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-toggle,
    .language-menu,
    .dropdown-arrow,
    [data-i18n] {
        transition: none;
    }
}
