/* ============================================
   Styles du Sélecteur de Langue Flottant
   ============================================ */

/* Conteneur principal du sélecteur flottant */
.language-selector-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Style responsive pour mobile */
@media (max-width: 768px) {
    .language-selector-floating {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .language-selector-floating {
        bottom: 15px;
        right: 15px;
    }
}

/* Bouton flottant principal */
.language-selector-button-floating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.language-selector-button-floating:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
}

.language-selector-button-floating:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.language-selector-button-floating.active {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

/* Icône du drapeau */
.language-selector-button-floating .flag-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Code de langue */
.language-selector-button-floating .lang-code {
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

/* Icône toggle */
.language-selector-button-floating .lang-toggle-icon {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.language-selector-button-floating.active .lang-toggle-icon {
    transform: rotate(180deg);
}

/* Menu déroulant des langues */
.language-menu-floating {
    position: absolute;
    bottom: 65px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 220px;
    display: none;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-menu-floating.open {
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Options de langue */
.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.language-option:hover {
    background-color: #f0f4ff;
    color: #007bff;
    transform: translateX(4px);
}

.language-option.active {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 86, 179, 0.05) 100%);
    color: #007bff;
    font-weight: 600;
}

/* Icône du drapeau dans le menu */
.language-option .flag-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
}

.language-option.active .flag-icon {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Nom de la langue */
.language-option .lang-name {
    flex: 1;
}

/* Checkmark pour option active */
.language-option .lang-checkmark {
    font-size: 18px;
    color: #007bff;
    font-weight: bold;
    margin-left: auto;
    animation: checkmarkPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkmarkPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Animation de changement */
.language-selector-floating.changing {
    animation: languageChange 0.3s ease;
}

@keyframes languageChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* État de chargement */
.language-selector-floating.detecting .language-selector-button-floating::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibilité */
.language-selector-button-floating:focus-visible,
.language-option:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Support du mode sombre (futur) */
@media (prefers-color-scheme: dark) {
    .language-menu-floating {
        background: #2a2a2a;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .language-option {
        color: #f0f0f0;
    }

    .language-option:hover {
        background-color: rgba(0, 123, 255, 0.2);
        color: #5eb3ff;
    }

    .language-option.active {
        background: rgba(0, 123, 255, 0.15);
        color: #5eb3ff;
    }

    .language-option .flag-icon {
        border-color: #444;
    }

    .language-option.active .flag-icon {
        border-color: #5eb3ff;
        box-shadow: 0 0 0 2px rgba(94, 179, 255, 0.1);
    }
}

/* Animations fluides */
@media (prefers-reduced-motion: reduce) {
    .language-selector-button-floating,
    .language-menu-floating,
    .language-option,
    .language-selector-floating.changing,
    .language-option .lang-checkmark {
        transition: none;
        animation: none;
    }
}

/* Compatibilité print */
@media print {
    .language-selector-floating {
        display: none;
    }
}
