/* ============================================================
   flashcards-6e.css
   CSS spécifique aux flashcards 6e
   Pas de style inline ni de <style> dans le HTML.
   ============================================================ */

/* ---- Barre Leitner permanente ---- */

.leitner-bar-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.leitner-bar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.leitner-title {
    font-weight: 700;
    font-size: 1rem;
}

.leitner-total {
    color: #666;
    font-size: 0.9rem;
    flex: 1;
}

.leitner-boxes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.leitner-box {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.box-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.box-bar-track {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.box-1 .box-bar-fill { background: #e74c3c; height: 100%; border-radius: 4px; transition: width .4s; }
.box-2 .box-bar-fill { background: #f39c12; height: 100%; border-radius: 4px; transition: width .4s; }
.box-3 .box-bar-fill { background: #27ae60; height: 100%; border-radius: 4px; transition: width .4s; }

.box-count {
    font-size: 0.85rem;
    color: #555;
    text-align: right;
}

/* ---- Sélection du mode ---- */

.mode-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: border-color .2s, background .2s;
    min-width: 140px;
}

.mode-btn small {
    font-size: 0.78rem;
    font-weight: 400;
    color: #666;
}

.mode-btn:hover    { border-color: #6c63ff; }
.mode-btn.active   { border-color: #6c63ff; background: #f0eeff; color: #6c63ff; }

.num-cards-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 12px;
}

.num-input {
    width: 70px;
    padding: 6px 10px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.leitner-hint {
    background: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    margin: 8px 0;
}

/* ---- Filtres ---- */

.filter-section {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color .2s;
}

.filter-label:hover { border-color: #6c63ff; }

.filter-count {
    color: #999;
    font-size: 0.8rem;
}

.start-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
}

.start-summary {
    color: #555;
    font-size: 1rem;
}

/* ---- Session ---- */

.session-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #6c63ff;
    border-radius: 3px;
    transition: width .3s;
}

.progress-label {
    font-size: 0.9rem;
    color: #666;
    min-width: 50px;
    text-align: right;
}

.card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.chap-badge {
    background: #e8eaf6;
    color: #3949ab;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.type-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.type-definition  { background: #e3f2fd; color: #1565c0; }
.type-propriete   { background: #fff8e1; color: #e65100; }
.type-methode     { background: #e8f5e9; color: #2e7d32; }
.type-vocabulaire { background: #f3e5f5; color: #6a1b9a; }
.type-calcul      { background: #fce4ec; color: #c62828; }

.leitner-badge {
    background: #f0f4c3;
    color: #827717;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* ---- Carte flip 3D ---- */

.card-container {
    perspective: 1200px;
    width: 100%;
    max-width: 600px;
    min-height: 240px;
    margin: 0 auto 16px;
    cursor: pointer;
    outline: none;
    transition: transform .1s;
}

.card-container:hover { transform: translateY(-2px); }

/* flash de feedback */
.card-container.flash-correct  { animation: flash-green .4s; }
.card-container.flash-incorrect { animation: flash-red .4s; }

@keyframes flash-green {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 0 4px #27ae60; }
}
@keyframes flash-red {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 0 4px #e74c3c; }
}

.card-inner {
    position: relative;
    width: 100%;
    min-height: 240px;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(.4,0,.2,1);
    border-radius: 14px;
}

.card-inner.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    min-height: 240px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 28px 24px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    text-align: center;
}

.card-recto {
    background: linear-gradient(135deg, #6c63ff 0%, #4834d4 100%);
    color: #fff;
}

.card-verso {
    background: #fff;
    border: 2px solid #6c63ff;
    transform: rotateY(180deg);
    color: #1a1a2e;
}

.card-face-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px;
    opacity: .7;
}

.card-recto .card-face-label { color: rgba(255,255,255,.8); }
.card-verso .card-face-label { color: #6c63ff; }

.card-text {
    font-size: 1.15rem;
    line-height: 1.55;
}

.card-recto .card-text { color: #fff; }

.card-exemple {
    margin-top: 16px;
    padding: 10px 14px;
    background: #f0eeff;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #4834d4;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

/* ---- Hint + boutons réponse ---- */

.flip-hint {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.keyboard-hint {
    font-size: 0.78rem;
    color: #aaa;
    display: block;
    margin-top: 3px;
}

.answer-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.answer-btn {
    padding: 14px 28px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform .1s, box-shadow .1s;
}

.answer-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }

.btn-knew {
    background: #27ae60;
    color: #fff;
    min-width: 160px;
}

.btn-didnt-know {
    background: #e74c3c;
    color: #fff;
    min-width: 160px;
}

/* ---- Résultats ---- */

.results-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0 12px;
}

.stat-card {
    background: #f8f9fa;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 24px;
    text-align: center;
    min-width: 100px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
}

.stat-knew .stat-number  { color: #27ae60; }
.stat-didnt .stat-number { color: #e74c3c; }

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

.result-message {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 12px 0;
}

.result-message.success   { background: #e8f5e9; color: #2e7d32; }
.result-message.good      { background: #fff8e1; color: #e65100; }
.result-message.encourage { background: #fce4ec; color: #c62828; }

.result-total {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

/* ---- Responsivité ---- */

@media (max-width: 480px) {
    .mode-buttons { flex-direction: column; }
    .mode-btn     { min-width: auto; width: 100%; }
    .answer-buttons { flex-direction: column-reverse; }
    .answer-btn   { width: 100%; min-width: auto; }
    .leitner-boxes { flex-direction: column; }
}
