/* =============================================================
   THEOLOGIA REFORMATA — APPRENTISSAGE LUDIQUE DES LANGUES
   CSS pour flashcards interactives, quiz, badges, score
   ============================================================= */

/* --- 1. STUDIO LINGUISTIQUE — Conteneur principal --- */
.studio-langue {
    background: linear-gradient(135deg, #fefcf6 0%, #faf6ec 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(155, 28, 28, 0.08);
    border: 1px solid rgba(155, 28, 28, 0.12);
}

.studio-langue-titre {
    font-family: Georgia, serif;
    font-size: 1.4rem;
    color: #9b1c1c;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.studio-langue-sous-titre {
    font-family: Georgia, serif;
    font-style: italic;
    text-align: center;
    color: #5a4f3e;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* --- 2. FILTRES DE CATÉGORIES --- */
.filtres-cartes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(155, 28, 28, 0.15);
}

.filtre-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    border: 1.5px solid rgba(155, 28, 28, 0.3);
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a4f3e;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
}

.filtre-btn:hover {
    background: rgba(155, 28, 28, 0.08);
    border-color: #9b1c1c;
}

.filtre-btn.actif {
    background: #9b1c1c;
    color: white;
    border-color: #9b1c1c;
}

.filtre-btn .filtre-count {
    margin-left: 0.4rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* --- 3. FLASHCARDS LUDIQUES — Flip 3D --- */
.flashcards-zone {
    perspective: 1200px;
    margin: 1rem auto;
    max-width: 480px;
}

.flashcard-ludique {
    position: relative;
    width: 100%;
    min-height: 280px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: none;
    background: transparent;
    padding: 0;
}

.flashcard-ludique.flippee {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: 280px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 2px solid rgba(155, 28, 28, 0.15);
}

.flashcard-face-recto {
    background: linear-gradient(135deg, #fefcf6 0%, #f5ebd8 100%);
}

.flashcard-face-verso {
    background: linear-gradient(135deg, #faf6ec 0%, #f0e4cc 100%);
    transform: rotateY(180deg);
}

.flashcard-categorie-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: rgba(155, 28, 28, 0.85);
    color: white;
    font-family: -apple-system, sans-serif;
    font-weight: 700;
}

.flashcard-categorie-badge.cat-vocabulaire { background: rgba(155, 28, 28, 0.85); }
.flashcard-categorie-badge.cat-grammaire { background: rgba(74, 124, 89, 0.9); }
.flashcard-categorie-badge.cat-theologie { background: rgba(184, 134, 11, 0.9); }
.flashcard-categorie-badge.cat-verbe { background: rgba(80, 100, 145, 0.9); }
.flashcard-categorie-badge.cat-grammaticaux { background: rgba(110, 75, 110, 0.9); }
.flashcard-categorie-badge.cat-alphabet { background: rgba(50, 95, 110, 0.9); }
.flashcard-categorie-badge.cat-phrase { background: rgba(140, 75, 35, 0.9); }
/* Catégories thématiques (modules d'histoire, théologie, exégèse) */
.flashcard-categorie-badge.cat-concept { background: rgba(184, 134, 11, 0.9); }
.flashcard-categorie-badge.cat-personnage { background: rgba(110, 75, 110, 0.9); }
.flashcard-categorie-badge.cat-date { background: rgba(155, 28, 28, 0.85); }
.flashcard-categorie-badge.cat-source { background: rgba(80, 100, 145, 0.9); }
.flashcard-categorie-badge.cat-lieu { background: rgba(50, 95, 110, 0.9); }
.flashcard-categorie-badge.cat-courant { background: rgba(74, 124, 89, 0.9); }

.flashcard-numero {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    font-size: 0.7rem;
    color: rgba(90, 79, 62, 0.6);
    font-family: -apple-system, sans-serif;
    font-weight: 600;
}

.flashcard-mot {
    font-family: Georgia, "SBL Hebrew", "SBL Greek", serif;
    font-size: 2.6rem;
    color: #4a3a2a;
    margin: 0;
    text-align: center;
    line-height: 1.2;
    direction: ltr;
}

.flashcard-mot[lang="he"], .flashcard-mot[lang="arc"] {
    direction: rtl;
    font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
    font-size: 3rem;
}

.flashcard-translitteration {
    font-family: Georgia, serif;
    font-style: italic;
    color: #7a6a55;
    margin-top: 0.6rem;
    font-size: 1rem;
}

.flashcard-indication-flip {
    position: absolute;
    bottom: 1rem;
    font-size: 0.75rem;
    color: rgba(90, 79, 62, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: -apple-system, sans-serif;
}

.flashcard-reponse-principale {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    color: #9b1c1c;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.8rem 0;
}

.flashcard-reponse-detail {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: #4a3a2a;
    text-align: center;
    margin: 0;
    line-height: 1.5;
    font-style: italic;
}

.flashcard-reponse-ref {
    font-family: -apple-system, sans-serif;
    font-size: 0.78rem;
    color: #7a6a55;
    margin-top: 1rem;
    text-align: center;
}

/* --- 4. CONTRÔLES DE NAVIGATION --- */
.flashcard-controles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.2rem 0;
}

.btn-flashcard {
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: 1.5px solid rgba(155, 28, 28, 0.4);
    background: white;
    font-family: -apple-system, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a4f3e;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 42px;
    min-width: 100px;
}

.btn-flashcard:hover {
    background: rgba(155, 28, 28, 0.08);
    transform: translateY(-1px);
}

.btn-flashcard.btn-acquise {
    background: #4a7c59;
    color: white;
    border-color: #4a7c59;
}

.btn-flashcard.btn-acquise:hover {
    background: #3a6249;
}

.btn-flashcard.btn-revoir {
    background: #c84545;
    color: white;
    border-color: #c84545;
}

.btn-flashcard.btn-revoir:hover {
    background: #a83535;
}

.btn-flashcard.btn-precedent {
    background: white;
    color: #5a4f3e;
}

/* --- 5. BARRE DE PROGRESSION --- */
.barre-progression-flashcards {
    background: rgba(155, 28, 28, 0.08);
    height: 8px;
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}

.barre-progression-remplissage {
    background: linear-gradient(90deg, #9b1c1c 0%, #c84545 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.compteur-flashcards {
    text-align: center;
    font-family: -apple-system, sans-serif;
    font-size: 0.9rem;
    color: #5a4f3e;
    margin-bottom: 0.5rem;
}

.compteur-flashcards strong {
    color: #9b1c1c;
    font-size: 1.05rem;
}

/* --- 6. SCORES ET STATISTIQUES --- */
.stats-apprentissage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.8rem;
    margin: 1.2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(155, 28, 28, 0.1);
}

.stat-bloc {
    text-align: center;
    padding: 0.4rem;
}

.stat-valeur {
    font-family: Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #9b1c1c;
    display: block;
    line-height: 1;
}

.stat-libelle {
    font-family: -apple-system, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a4f3e;
    margin-top: 0.3rem;
    display: block;
}

.stat-bloc.stat-acquises .stat-valeur { color: #4a7c59; }
.stat-bloc.stat-revoir .stat-valeur { color: #c84545; }

/* --- 7. QUIZ INTERACTIF --- */
.quiz-langue {
    background: linear-gradient(135deg, #fefcf6 0%, #f5ebd8 100%);
    border-radius: 14px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(74, 124, 89, 0.1);
    border: 2px solid rgba(74, 124, 89, 0.2);
}

.quiz-langue-titre {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    color: #4a7c59;
    margin: 0 0 0.4rem 0;
    text-align: center;
}

.quiz-langue-sous-titre {
    text-align: center;
    color: #5a4f3e;
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.quiz-question {
    margin: 1rem 0;
    padding: 1rem 0;
}

.quiz-question.cache { display: none; }

.quiz-question-numero {
    font-family: -apple-system, sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #4a7c59;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.quiz-question-enonce {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    color: #3a2f24;
    text-align: center;
    margin: 1rem 0;
    line-height: 1.5;
}

.quiz-question-enonce .terme-cible {
    font-family: "SBL Hebrew", "SBL Greek", Georgia, serif;
    font-size: 1.8rem;
    color: #9b1c1c;
    display: block;
    margin: 0.8rem 0;
    font-weight: 700;
}

.quiz-question-enonce .terme-cible[lang="he"], .quiz-question-enonce .terme-cible[lang="arc"] {
    direction: rtl;
    font-size: 2rem;
}

.quiz-reponses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 1rem;
}

@media (min-width: 480px) {
    .quiz-reponses {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quiz-reponse {
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    border: 2px solid rgba(155, 28, 28, 0.2);
    background: white;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: #3a2f24;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    min-height: 50px;
    line-height: 1.4;
}

.quiz-reponse:hover:not(.repondu) {
    border-color: #9b1c1c;
    background: rgba(155, 28, 28, 0.05);
}

.quiz-reponse.repondu { cursor: default; }

.quiz-reponse.correct {
    background: #4a7c59;
    color: white;
    border-color: #4a7c59;
    font-weight: 700;
}

.quiz-reponse.faux {
    background: #c84545;
    color: white;
    border-color: #c84545;
    opacity: 0.85;
}

.quiz-reponse.correcte-non-choisie {
    background: rgba(74, 124, 89, 0.15);
    border-color: #4a7c59;
    color: #4a7c59;
    font-weight: 700;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-family: Georgia, serif;
    font-size: 0.92rem;
    display: none;
}

.quiz-feedback.visible { display: block; }

.quiz-feedback.feedback-bon {
    background: rgba(74, 124, 89, 0.12);
    color: #2d5a3d;
    border-left: 4px solid #4a7c59;
}

.quiz-feedback.feedback-mauvais {
    background: rgba(200, 69, 69, 0.10);
    color: #7a2828;
    border-left: 4px solid #c84545;
}

.quiz-controles {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.quiz-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    border: none;
    background: #4a7c59;
    color: white;
    font-family: -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.quiz-btn:hover:not(:disabled) {
    background: #3a6249;
    transform: translateY(-1px);
}

.quiz-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quiz-btn.btn-secondaire {
    background: white;
    color: #5a4f3e;
    border: 1.5px solid rgba(74, 124, 89, 0.4);
}

.quiz-btn.btn-secondaire:hover:not(:disabled) {
    background: rgba(74, 124, 89, 0.08);
}

/* --- 8. RÉSULTAT QUIZ --- */
.quiz-resultat {
    display: none;
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    margin-top: 1rem;
}

.quiz-resultat.visible { display: block; }

.quiz-resultat-score {
    font-family: Georgia, serif;
    font-size: 3rem;
    color: #9b1c1c;
    font-weight: 700;
    line-height: 1;
    margin: 0.5rem 0;
}

.quiz-resultat-pourcentage {
    font-family: Georgia, serif;
    font-size: 1.2rem;
    color: #5a4f3e;
    margin: 0.5rem 0 1rem 0;
}

.quiz-resultat-message {
    font-family: Georgia, serif;
    font-size: 1rem;
    color: #3a2f24;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-style: italic;
}

.quiz-resultat-medaille {
    font-size: 3rem;
    line-height: 1;
    margin: 0.5rem 0;
}

/* --- 9. RESPONSIVE --- */
@media (max-width: 480px) {
    .studio-langue, .quiz-langue {
        padding: 1rem;
    }
    .flashcard-mot { font-size: 2rem; }
    .flashcard-mot[lang="he"], .flashcard-mot[lang="arc"] { font-size: 2.3rem; }
    .filtres-cartes { gap: 0.35rem; }
    .filtre-btn { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
    .quiz-question-enonce .terme-cible { font-size: 1.5rem; }
}

/* --- 10. ANIMATIONS --- */
@keyframes apparitionDouce {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flashcard-ludique, .quiz-question.active {
    animation: apparitionDouce 0.4s ease;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.quiz-resultat-medaille.celebrer {
    animation: celebration 0.8s ease infinite;
}

@media (prefers-reduced-motion: reduce) {
    .flashcard-ludique { transition: none; }
    .flashcard-face { transition: none; }
    .quiz-resultat-medaille.celebrer { animation: none; }
}
