/**
 * Styles pour la FAQ interactive avec index alphabétique
 * Fichier : assets/css/faq.css
 * Version avec liens permanents
 */

/* ========================================
   CONTENEUR PRINCIPAL
======================================== */
.faq-container {
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   CHAMP DE RECHERCHE
======================================== */
.faq-search-container {
    margin-bottom: 40px;
}

.faq-search-wrapper {
    display: flex;
    max-width: 600px;
    gap: 15px; /* Espacement entre champ et bouton */
    align-items: center;
}

.faq-search-input {
    flex: 1;
    padding: 15px 20px !important;
    border: 1px solid #ddd;
    border-radius: 15px; 
    font-size: 16px;
    background: #ffffff;
    outline: none;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-search-input:focus {
    border-color: #ff9500;
 }

.faq-search-input::placeholder {
    color: #999;
}

.faq-search-button {
    background: #ff9500;
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 15px; 
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

.faq-search-button:hover {
    background: #e6860e;
    transform: translateY(-1px);
}

/* ========================================
   LISTE DES FAQ
======================================== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Petit gap entre les items */
}

/* ========================================
   INDEX ALPHABÉTIQUE - VERSION SIMPLIFIÉE
======================================== */

/* Conteneur de la lettre (div séparé) */
.faq-letter-container {
    width: 80px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center; 
 
}

/* La lettre verte de 107px */
.faq-letter {
    font-size: 87px;
    font-weight: 700;
    color: #5bce8e;
    line-height: 1;
    font-family: Arial, sans-serif;
    text-transform: uppercase;
    margin-top:5px;
}

/* FAQ items avec index : ajuster la marge gauche */
.faq-item-with-index {
    margin-left: 100px; /* 80px de largeur + 20px d'espacement */
}

/* Lettre container avec marge négative pour l'aligner à gauche */
.faq-letter-container {
    position: relative;
    z-index: 1;
}

.faq-letter-container + .faq-item-with-index {
    margin-top: -107px; /* Remonte l'item à la hauteur de la lettre */
}

/* ========================================
   ITEM FAQ INDIVIDUEL (original)
======================================== */
.faq-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   QUESTION (TITRE CLIQUABLE)
======================================== */
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background: white;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    padding-right: 20px;
}

/* ========================================
   ICÔNE TOGGLE (+/-)
======================================== */
.faq-toggle-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #6c7ce7;
}

.faq-question[aria-expanded="true"] .icon-plus {
    display: none;
}

.faq-question[aria-expanded="true"] .icon-minus {
    display: block !important;
}

/* ========================================
   RÉPONSE (CONTENU)
======================================== */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer.active {
    max-height: 1000px; /* Valeur suffisamment grande */
}

.faq-answer-content {
    padding: 0 25px 25px 25px;
    color: #555;
    line-height: 1.6;
    font-size: 16px;
    position: relative;
}

.faq-answer-content p {
    margin-bottom: 15px;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   LIEN PERMANENT
======================================== */
.faq-permalink {
    position: absolute;
    bottom: 10px;
    right: 15px;
    z-index: 10;
}

.faq-permalink-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f8f9fa;
 
    border-radius: 50%;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    
}

.faq-permalink-link:hover {
    background: #7d7ac8;
    color: white;

    transform: translateY(-1px);

    text-decoration: none;
}

.faq-permalink-link:focus {
    outline: 2px solid #7d7ac8;
    outline-offset: 2px;
}

/* État de copie réussie */
.faq-permalink-copied {
    background: #52c788 !important;
    color: white !important;

}

/* Animation de feedback */
.faq-permalink-link i {
    transition: transform 0.2s ease;
}

.faq-permalink-link:hover i {
    transform: scale(1.1);
}

/* ========================================
   ÉTATS ET MESSAGES
======================================== */
.faq-no-posts,
.faq-no-results p {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
}

/* Animation de recherche */
.faq-searching .faq-item {
    opacity: 0.5;
    transform: scale(0.98);
}

.faq-item.faq-match {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .faq-container {
        padding: 15px;
    }
    
    .faq-search-wrapper {
        flex-direction: column;
        gap: 12px;
        max-width: 100%;
    }
    
    .faq-search-input {
        width: 100%;
        border-radius: 20px;
    }
    
    .faq-search-button {
        width: 100%;
        border-radius: 20px;
        padding: 12px 20px;
    }
    
    /* Responsive pour l'index */
    .faq-letter-container {
        width: 60px;
        height: 80px;
    }
    
    .faq-letter {
        font-size: 80px;
    }
    
    .faq-item-with-index {
        margin-left: 75px; /* 60px + 15px */
    }
    
    .faq-letter-container + .faq-item-with-index {
        margin-top: -80px;
    }
    
    .faq-question {
        padding: 18px 20px;
    }
    
    .faq-question-title {
        font-size: 16px;
        padding-right: 15px;
    }
    
    .faq-answer-content {
        padding: 0 20px 20px 20px;
        font-size: 15px;
    }
    
    /* Responsive pour le lien permanent */
    .faq-permalink {
        bottom: 8px;
        right: 12px;
    }
    
    .faq-permalink-link {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .faq-container {
        padding: 10px;
    }
    
    .faq-search-wrapper {
        gap: 10px;
    }
    
    .faq-search-input {
        padding: 12px 18px;
        font-size: 15px;
        border-radius: 18px;
    }
    
    .faq-search-button {
        padding: 12px 18px;
        font-size: 15px;
        border-radius: 18px;
    }
    
    /* Responsive mobile pour l'index */
    .faq-letter-container {
        width: 50px;
        height: 70px;
    }
    
    .faq-letter {
        font-size: 70px;
    }
    
    .faq-item-with-index {
        margin-left: 62px; /* 50px + 12px */
    }
    
    .faq-letter-container + .faq-item-with-index {
        margin-top: -70px;
    }
    
    .faq-question {
        padding: 15px 18px;
    }
    
    .faq-question-title {
        font-size: 15px;
    }
    
    .faq-answer-content {
        padding: 0 18px 18px 18px;
        font-size: 14px;
    }
    
    /* Responsive mobile pour le lien permanent */
    .faq-permalink {
        bottom: 6px;
        right: 10px;
    }
    
    .faq-permalink-link {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

/* ========================================
   UTILITAIRES POUR L'ACCESSIBILITÉ
======================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   ANIMATIONS SUPPLÉMENTAIRES
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-item {
    animation: fadeIn 0.3s ease-out;
}

/* Animation pour le scroll vers l'ancre */
.faq-item:target {
    animation: highlightFAQ 2s ease-out;
}

@keyframes highlightFAQ {
    0% {
        background: rgba(108, 124, 231, 0.1);
        transform: scale(1.02);
    }
    100% {
        background: white;
        transform: scale(1);
    }
}

/* Animation pour le lien permanent copié */
@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.faq-permalink-copied {
    animation: copySuccess 0.3s ease-out;
}



/* ========================================
   COMPATIBILITÉ NAVIGATEURS
======================================== */
/* Support pour les navigateurs plus anciens */
.faq-answer {
    -webkit-transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -ms-transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -o-transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-permalink-link {
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .faq-search-container,
    .faq-permalink {
        display: none !important;
    }
    
    .faq-answer {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .faq-item {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .faq-question-title {
        color: #000 !important;
    }
    
    .faq-answer-content {
        color: #333 !important;
    }
}

/* ========================================
   DARK MODE SUPPORT (optionnel)
======================================== */
@media (prefers-color-scheme: dark) {
    .faq-container {
        background: #1a1a1a;
    }
    
    .faq-item {
        background: #2d2d2d;
        border: 1px solid #404040;
    }
    
    .faq-question {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .faq-question:hover {
        background: #3a3a3a;
    }
    
    .faq-question-title {
        color: #e0e0e0;
    }
    
    .faq-answer-content {
        color: #c0c0c0;
    }
    
    .faq-search-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .faq-search-input::placeholder {
        color: #888;
    }
    
    .faq-permalink-link {
        background: #3a3a3a;
        border-color: #404040;
        color: #c0c0c0;
    }
    
    .faq-permalink-link:hover {
        background: #6c7ce7;
        color: white;
    }
    
    .faq-no-posts,
    .faq-no-results p {
        background: #2d2d2d;
        color: #c0c0c0;
        border: 1px solid #404040;
    }
}

/* Reset complet pour les questions FAQ */
.faq-question,
.faq-question *,
.faq-question:focus,
.faq-question:active,
.faq-question:visited {
       border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.faq-question:hover {
    background: #f8f9fa !important;
}