/**
 * Styles pour le sélecteur de langue multilingue
 * Support de 10 langues avec direction RTL pour l'arabe
 */

/* Sélecteur de langue dans la navbar */
.language-switcher .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.language-switcher .dropdown-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.language-switcher #current-lang-flag {
    font-size: 1.25rem;
}

.language-switcher #current-lang-code {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* Menu déroulant des langues */
.language-switcher .dropdown-menu {
    min-width: 200px;
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.language-switcher .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.language-switcher .dropdown-item:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.language-switcher .dropdown-item.active {
    background-color: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-weight: 600;
}

.language-switcher .dropdown-item span:first-child {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

/* Support RTL pour l'arabe */
body.rtl,
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

body.rtl .language-switcher .dropdown-item span:first-child {
    margin-right: 0;
    margin-left: 0.5rem;
}

body.rtl .navbar-nav {
    flex-direction: row-reverse;
}

body.rtl .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

/* Styles pour les différentes langues */
.lang-fr, .lang-en, .lang-es, .lang-pt, .lang-de {
    /* Langues latines - pas de style spécial */
}

.lang-ar {
    font-family: 'Arial', 'Helvetica', sans-serif;
    direction: rtl;
}

.lang-zh, .lang-ja {
    font-family: 'Microsoft YaHei', 'SimHei', 'PingFang SC', sans-serif;
}

.lang-hi {
    font-family: 'Noto Sans Devanagari', 'Arial Unicode MS', sans-serif;
}

.lang-ru {
    font-family: 'Arial', 'Helvetica', sans-serif;
}

/* Animation lors du changement de langue */
@keyframes languageSwitch {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.language-switching {
    animation: languageSwitch 0.5s ease-in-out;
}

/* Loader pour le changement de langue */
#language-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Toast de notification */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1055;
}

.toast {
    min-width: 250px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
    .language-switcher .dropdown-menu {
        min-width: 150px;
    }
    
    .language-switcher #current-lang-code {
        display: none;
    }
    
    .language-switcher #current-lang-flag {
        font-size: 1.5rem;
    }
}

/* Mode sombre (si applicable) */
@media (prefers-color-scheme: dark) {
    .language-switcher .dropdown-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .language-switcher .dropdown-menu {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .language-switcher .dropdown-item:hover {
        background-color: rgba(102, 126, 234, 0.2);
    }
    
    #language-loader {
        background: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
    }
}
