/**
 * Styles pour le sélecteur de langues dans le header
 * Design moderne avec animations et responsive
 */

/* Conteneur du sélecteur de langues */
.lang-switcher {
    position: relative;
    display: inline-block;
    min-width: 90px;
    min-height: 44px;
}

/* Bouton principal (langue active) */
.lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    min-height: 40px;
    min-width: 85px;
}

.lang-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.lang-switcher-btn .arrow {
    transition: transform 0.3s ease;
    font-size: 10px;
}

.lang-switcher.open .lang-switcher-btn .arrow {
    transform: rotate(180deg);
}

/* Liste déroulante */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Boutons de langue dans la liste */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    text-decoration: none;
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.lang-btn.active {
    background: rgba(102, 126, 234, 0.15);
    font-weight: 600;
}

/* Image drapeau */
.flag-img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Emoji drapeau (fallback) */
.flag-emoji {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}

/* Code de langue */
.lang-code {
    font-size: 12px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Animation d'apparition */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lang-btn {
    animation: fadeInScale 0.3s ease backwards;
}

.lang-btn:nth-child(1) { animation-delay: 0.05s; }
.lang-btn:nth-child(2) { animation-delay: 0.1s; }
.lang-btn:nth-child(3) { animation-delay: 0.15s; }
.lang-btn:nth-child(4) { animation-delay: 0.2s; }
.lang-btn:nth-child(5) { animation-delay: 0.25s; }
.lang-btn:nth-child(6) { animation-delay: 0.3s; }

/* Version dropdown (alternative) */
.lang-switcher.dropdown {
    position: relative;
}

.lang-switcher.dropdown .lang-btn {
    display: none;
}

.lang-switcher.dropdown .lang-btn.active {
    display: inline-flex;
}

.lang-switcher.dropdown:hover .lang-btn {
    display: inline-flex;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .lang-switcher {
        gap: 6px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .lang-code {
        display: none;
    }
    
    .flag-emoji {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .lang-switcher {
        gap: 4px;
    }
    
    .lang-btn {
        padding: 6px 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
    
    .flag-img {
        width: 20px;
        height: 14px;
    }
    
    .flag-emoji {
        font-size: 18px;
    }
}

/* Mode sombre */
body.dark-mode .lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

/* Accessibilité */
.lang-btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.lang-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Animation au clic */
.lang-btn:active {
    transform: scale(0.95);
}

/* Tooltip au survol */
.lang-btn::after {
    /*content: attr(title)*/
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.lang-btn:hover::after {
    opacity: 1;
}

/* Flèche du tooltip - DÉSACTIVÉE */
.lang-btn::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    opacity: 0 !important; /* Toujours invisible */
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
    display: none !important; /* Complètement désactivé */
}

.lang-btn:hover::before {
    opacity: 0 !important; /* Force l'invisibilité même au hover */
}

/* Désactiver les tooltips sur mobile */
@media (max-width: 768px) {
    .lang-btn::after,
    .lang-btn::before {
        display: none;
    }
}
