/*
 * CENTURION ECO GREEN - Sélecteur de langue multilingue
 * Styles pour FR, EN, SK, IT, ES, AR (incluant RTL)
 */

/* === SÉLECTEUR DE LANGUE === */
.language-selector {
    position: relative;
    z-index: 9999;
    display: inline-flex; /* Utiliser inline-flex pour ressembler au contact-number */
    align-items: center;
    gap: 10px; /* Espace entre l'icône et le texte, comme le contact-number */
    margin-right: 15px; /* Garder une marge à droite si d'autres éléments suivent */
}

.lang-toggle-btn {
    background: transparent !important; /* Fond transparent */
    border: 1px solid #6c757d; /* Bordure gris */
    border-radius: 18px;
    padding: 5px 10px;
    color: #6c757d !important; /* Texte gris */
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow: none; /* Pas d'ombre pour un style outline */
    min-width: 80px;
    justify-content: space-between;
}

.lang-toggle-btn:hover {
    background: rgba(108, 117, 125, 0.1) !important; /* Léger fond gris transparent au survol */
    transform: translateY(-1px);
    box-shadow: none;
}

.lang-toggle-btn:active {
    transform: translateY(0);
}

.current-lang {
    display: flex;
    align-items: center;
    gap: 3px; /* Réduire l'espacement */
    font-size: 13px; /* Encore plus petit */
}

.lang-text {
    font-size: 11px; /* Encore plus petit */
    font-weight: 500;
}

.lang-toggle-btn i {
    color: #6c757d !important; /* Couleur de l'icône gris */
    font-size: 11px;
}

.lang-toggle-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-selector.active .lang-toggle-btn i {
    transform: rotate(180deg);
}

/* === DROPDOWN === */
.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 180px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    margin-top: 5px;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #343a40;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: #f1f1f1; /* Gris clair au survol */
    color: #343a40; /* Couleur de texte plus foncée */
    text-decoration: none;
}

.lang-option.active {
    background: #6c757d !important; /* Gris avec !important */
    color: white;
}

.lang-option.active:hover {
    background: #5a6268 !important; /* Gris légèrement plus foncé au survol avec !important */
    color: white;
}

.lang-option .flag {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.lang-option .name {
    flex: 1;
    font-size: 13px;
}

/* === STYLES RESPONSIVE === */
@media (max-width: 1199.98px) {
    .language-selector {
        margin-right: 5px; /* Réduire la marge */
    }

    .lang-toggle-btn {
        min-width: 70px; /* Plus petit */
        padding: 4px 8px; /* Plus petit */
        font-size: 11px; /* Plus petit */
    }

    .lang-text {
        display: none; /* Toujours masquer le texte pour les petites résolutions */
    }

    .current-lang {
        font-size: 14px; /* Ajuster la taille du drapeau */
    }
}

@media (max-width: 767.98px) {
    .language-selector {
        margin-right: 0;
        margin-bottom: 5px; /* Réduire la marge */
    }

    .lang-toggle-btn {
        min-width: auto;
        padding: 5px; /* Plus petit */
        border-radius: 50%;
        width: 32px; /* Plus petit */
        height: 32px; /* Plus petit */
        justify-content: center;
    }

    .lang-toggle-btn i {
        display: none;
    }

    .lang-dropdown {
        right: -2px; /* Ajuster la position */
        min-width: 140px; /* Plus petit */
    }

    .lang-dropdown::before {
        right: 18px; /* Ajuster la position */
    }
}

/* === STYLES RTL POUR L'ARABE === */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .language-selector {
    margin-right: 0;
    margin-left: 15px;
}

body.rtl .lang-dropdown {
    right: auto;
    left: 0;
}

body.rtl .lang-dropdown::before {
    right: auto;
    left: 20px;
}

body.rtl .navigation {
    direction: rtl;
}

body.rtl .header-inner-box {
    direction: rtl;
}

/* Re-order header items on mobile for RTL */

body.rtl .main-menu ul {
    direction: rtl;
}


/* === ANIMATIONS === */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-dropdown.show {
    animation: fadeInDown 0.3s ease;
}

/* === INTEGRATION HEADER === */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}


.header-right .contact-number {
    order: 2;
}

.header-right .theme-btn {
    order: 3;
}

/* === STYLES POUR MOBILE NAV === */
.mobile-nav .action-bar {
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
}

.mobile-nav .language-selector {
    margin: 15px 0;
    text-align: center;
}

.mobile-nav .lang-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 1px solid #eee;
    margin-top: 10px;
}

.mobile-nav .lang-dropdown::before {
    display: none;
}

/* === ACCESSIBILITÉ === */
.lang-toggle-btn:focus,
.lang-option:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* === PERFORMANCE === */
.language-selector * {
    will-change: transform, opacity;
}

/* === PRINT STYLES === */
@media print {
    .language-selector {
        display: none !important;
    }
}