/**
 * Sélecteur de Langue Personnalisé pour Archives Haiti
 * Créole / Français
 */

/* ==========================================
   CONTAINER DU SÉLECTEUR
========================================== */

.archives-language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Style pour le header/menu */
.site-header .archives-language-switcher {
    margin-left: auto;
}

/* ==========================================
   BOUTONS DE LANGUE
========================================== */

.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.language-btn:hover {
    background: #f7fafc;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.language-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.language-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   DRAPEAU (EMOJI OU IMAGE)
========================================== */

.language-flag {
    font-size: 20px;
    line-height: 1;
}

/* Si tu utilises des images de drapeaux */
.language-flag img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   DROPDOWN (MENU DÉROULANT)
========================================== */

.language-dropdown {
    position: relative;
}

.language-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-dropdown-toggle:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.language-dropdown-toggle .arrow {
    margin-left: 4px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

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

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.language-dropdown-menu .language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.language-dropdown-menu .language-option:hover {
    background: #f7fafc;
    color: #667eea;
}

.language-dropdown-menu .language-option.active {
    background: #edf2f7;
    color: #667eea;
    font-weight: 700;
}

.language-dropdown-menu .language-option:first-child {
    border-radius: 10px 10px 0 0;
}

.language-dropdown-menu .language-option:last-child {
    border-radius: 0 0 10px 10px;
}

/* ==========================================
   STYLE COMPACT (DRAPEAUX SEULEMENT)
========================================== */

.language-switcher-compact {
    display: flex;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.language-switcher-compact .language-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    justify-content: center;
    font-size: 24px;
}

.language-switcher-compact .language-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.language-switcher-compact .language-btn:hover:not(.active) {
    background: #f7fafc;
    border-radius: 8px;
}

/* ==========================================
   STYLE MOBILE
========================================== */

@media (max-width: 768px) {
    .archives-language-switcher {
        gap: 6px;
    }
    
    .language-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .language-flag {
        font-size: 18px;
    }
    
    /* Menu mobile full-width */
    .language-dropdown-menu {
        right: auto;
        left: 0;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    /* Mode compact forcé sur mobile */
    .archives-language-switcher .language-name {
        display: none;
    }
    
    .language-btn {
        padding: 8px;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
}

/* ==========================================
   ANIMATIONS
========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-dropdown-menu {
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================
   ACCESSIBILITÉ
========================================== */

.language-btn:focus,
.language-dropdown-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================
   VARIANTE : STYLE MINIMALISTE
========================================== */

.language-switcher-minimal {
    display: flex;
    gap: 2px;
    background: #f7fafc;
    padding: 2px;
    border-radius: 8px;
}

.language-switcher-minimal .language-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    color: #718096;
}

.language-switcher-minimal .language-btn.active {
    background: white;
    color: #2d3748;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   VARIANTE : STYLE AVEC SÉPARATEUR
========================================== */

.language-switcher-separated {
    display: flex;
    gap: 0;
}

.language-switcher-separated .language-btn {
    border-radius: 0;
    border-right: 1px solid #e2e8f0;
}

.language-switcher-separated .language-btn:first-child {
    border-radius: 10px 0 0 10px;
}

.language-switcher-separated .language-btn:last-child {
    border-radius: 0 10px 10px 0;
    border-right: 2px solid #e2e8f0;
}

/* ==========================================
   DARK MODE (Optionnel)
========================================== */

@media (prefers-color-scheme: dark) {
    .language-btn {
        background: #1a202c;
        border-color: #2d3748;
        color: #e2e8f0;
    }
    
    .language-btn:hover {
        background: #2d3748;
        border-color: #667eea;
        color: #667eea;
    }
    
    .language-dropdown-menu {
        background: #1a202c;
        border-color: #2d3748;
    }
    
    .language-dropdown-menu .language-option {
        color: #e2e8f0;
    }
    
    .language-dropdown-menu .language-option:hover {
        background: #2d3748;
    }
}
