/* =========================================================
   60_feedback.css — Feedback / Flash / Overlays (dark)
   Projet : Mémo Mon Examen
   Contraintes : rétrocompatible, sans toucher au HTML/classes
   ========================================================= */

/* ========= MESSAGES FLASH (VERDICT) ========= */

.app-flash{
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  animation: flashIn .45s ease-out forwards;
}

.alert-danger.app-flash{
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.25), rgba(15, 23, 42, 0.98));
  border-color: rgba(248, 113, 113, 0.9);
}

@keyframes flashIn{
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.flash-hide{
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .4s ease, transform .4s ease;
}

/* On masque le flash vert "success" : on garde seulement les rouges */
.alert-success.app-flash{
  display: none !important;
}

/* On masque le flash rouge "mauvaise réponse" : le contenu est réinjecté dans la carte par JS */
.app-flash[data-flash-kind="bad_answer"]{
  display: none !important;
}

/* ===== Feedback "bonne réponse" ===== */

.app-flash.flash-good-answer{
  border-left: 4px solid #2ed573;
  animation: flashSlideDown 0.45s ease-out, flashGlow 1.2s ease-out;
}

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

@keyframes flashGlow{
  0% { box-shadow: 0 0 0 rgba(46, 213, 115, 0.0); }
  30% { box-shadow: 0 0 25px rgba(46, 213, 115, 0.45); }
  100% { box-shadow: 0 0 0 rgba(46, 213, 115, 0.0); }
}

/* Pulse vert autour de la carte question */
.question-card-good{
  animation: cardPulseGreen 0.6s ease-out;
  border-color: #2ed573;
}

@keyframes cardPulseGreen{
  0% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.0); }
  40% { box-shadow: 0 0 24px 0 rgba(46, 213, 115, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.0); }
}

/* ===== Bloc "bonne réponse attendue" dans la carte ===== */

.question-correct-inline{
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: radial-gradient(circle at left, rgba(248, 113, 113, 0.23), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(248, 113, 113, 0.8);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
}

.question-correct-inline-label{
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(252, 165, 165, 0.9);
  margin-bottom: 0.25rem;
}

.question-correct-inline-answer{
  color: #fee2e2;
  font-weight: 600;
}

/* ===== Réponse correcte (bloc générique) ===== */

.correct-answer{
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
}

.answer-value{
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 4px;
}

/* ===== Halo / "confetti" autour du bouton Valider ===== */

.btn-answer-primary{
  position: relative;
  overflow: hidden;
}

.btn-answer-primary.btn-confetti::before,
.btn-answer-primary.btn-confetti::after{
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(46, 213, 115, 0.9);
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  animation: btnConfettiRing 0.6s ease-out forwards;
}

.btn-answer-primary.btn-confetti::after{
  border-color: rgba(255, 255, 255, 0.7);
  animation-delay: 0.1s;
}

@keyframes btnConfettiRing{
  0% { opacity: 1; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* ===== Overlay central "+X points" ===== */

.points-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 1100;
  transition: opacity 0.2s ease-out;
}

.points-overlay-visible{
  opacity: 1;
}

.points-overlay-inner{
  min-width: 220px;
  padding: 1.4rem 2.2rem 1.6rem;
  border-radius: 999px;
  background: radial-gradient(circle at top, rgba(34, 197, 94, 0.28), rgba(15, 23, 42, 0.98));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.85);
  text-align: center;
  transform: scale(0.85);
  animation: pointsOverlayPop 0.55s cubic-bezier(.18,.89,.32,1.28);
}

.points-overlay-main{
  font-size: clamp(2.4rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fefce8;
  text-shadow: 0 0 25px rgba(250, 250, 250, 0.7);
}

.points-overlay-sub{
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #e5e7eb;
}

@keyframes pointsOverlayPop{
  0% { opacity: 0; transform: scale(0.6) translateY(10px); }
  60% { opacity: 1; transform: scale(1.05) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== Désactivation popup modale réponse (feedback inline) ===== */

.answer-modal{
  display: none !important;
}

/* ===== Toast bonne réponse ===== */

.answer-toast-good{
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: linear-gradient(135deg,#4ade80,#22d3ee);
  color: #0b1220;
  padding: 14px 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  opacity: 0;
  transition: all .3s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  z-index: 9999;
}

.answer-toast-good.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.answer-toast-icon{
  font-size: 1.3rem;
}

/* ===== Bottom sheet mauvaise réponse ===== */

.answer-sheet{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  z-index: 9998;
  opacity: 0;
  transition: opacity .3s ease;
}

.answer-sheet.show{
  opacity: 1;
}

.answer-sheet-card{
  width: 100%;
  background: #0b1220;
  border-radius: 20px 20px 0 0;
  padding: 22px;
  animation: slideUp .35s ease;
}

@keyframes slideUp{
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.answer-sheet-title{
  font-size: 1.1rem;
  font-weight: 600;
}

.answer-sheet-correct{
  margin-top: 8px;
  opacity: .9;
}

.answer-sheet-explanation{
  margin-top: 12px;
  font-size: .95rem;
  opacity: .9;
}

/* =========================
   MMX — INLINE BAD ANSWER PANEL (SOLO)
   ========================= */

.mmx-inline-feedback-slot{
  margin-top: 0.75rem;
}

.answer-inline-panel{
  margin-top: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: radial-gradient(circle at left, rgba(248, 113, 113, 0.23), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(248, 113, 113, 0.8);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  cursor: pointer;
  user-select: none;
}

.answer-inline-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.answer-inline-title{
  font-weight: 800;
  letter-spacing: 0.2px;
}

.answer-inline-ok{
  border: 1px solid rgba(248, 113, 113, 0.85);
  background: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.2;
}

.answer-inline-ok:hover{
  background: rgba(248, 113, 113, 0.12);
}

.answer-inline-meta{
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.answer-inline-pill{
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.answer-inline-correct{
  margin-top: 0.75rem;
}

.answer-inline-expl{
  opacity: 0.95;
}

.answer-inline-panel.is-hiding{
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 200ms ease, transform 200ms ease;
}


/* ==========================================
   MAUVAISE RÉPONSE — PANEL INLINE
========================================== */

.answer-inline-panel{
  margin-top:1rem;
  padding:1rem 1.1rem;
  border-radius:14px;
  background:rgba(255, 80, 80, 0.08);
  border:1px solid rgba(255,80,80,.35);
  backdrop-filter: blur(6px);
  animation: fadeInInline .25s ease;
}

.answer-inline-title{
  font-weight:600;
  margin-bottom:.5rem;
  color:#ff6b6b;
}

.answer-inline-correct{
  margin-bottom:.35rem;
  font-size:.95rem;
}

.answer-inline-explanation{
  font-size:.9rem;
  opacity:.85;
  margin-bottom:.75rem;
}

/* ==========================================
   PROGRESS BAR (7050ms sync)
========================================== */

.answer-inline-progress{
  height:6px;
  background:rgba(255,255,255,.08);
  border-radius:6px;
  overflow:hidden;
  margin-bottom:.5rem;
}

.answer-inline-progress-fill{
  height:100%;
  width:100%;
  background:linear-gradient(90deg,#ff6b6b,#ff3b3b);
  transform:scaleX(0);
  transform-origin:left;
}

/* ==========================================
   SUCCESS TOAST (bonne réponse)
========================================== */

.mmx-inline-success-toast{
  margin-top:1rem;
  padding:.6rem 1rem;
  border-radius:12px;
  font-weight:500;
  background:rgba(0, 255, 170, 0.08);
  border:1px solid rgba(0,255,170,.35);
  color:#3ef0c5;
  text-align:center;
  animation: fadeInInline .2s ease;
}

/* ==========================================
   Animations
========================================== */

@keyframes fadeInInline{
  from{
    opacity:0;
    transform:translateY(4px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* ==========================================
   MAUVAISE RÉPONSE — PANEL INLINE (moins rouge)
========================================== */

.answer-inline-panel{
  margin-top:1rem;
  padding:1rem 1.1rem;
  border-radius:14px;
  backdrop-filter: blur(6px);
  animation: fadeInInline .25s ease;
}

.answer-inline-panel-warn{
  background: rgba(245, 197, 66, 0.08); /* ambre doux */
  border: 1px solid rgba(245, 197, 66, 0.30);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 18px 40px rgba(0,0,0,0.35);
}

.answer-inline-title{
  font-weight:600;
  margin-bottom:.5rem;
  color: rgba(245, 197, 66, 0.95);
}

.answer-inline-correct{
  margin-bottom:.35rem;
  font-size:.95rem;
}

.answer-inline-explanation{
  font-size:.92rem;
  opacity:.88;
  margin:.55rem 0 .6rem;
}

.answer-inline-explanation.is-hidden{
  display:none;
}

/* ==========================================
   BARRE DE TEMPS (remplissage)
========================================== */

.answer-inline-progress-wrap{
  margin-top:.5rem;
}

.answer-inline-progress-label{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:.78rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  opacity:.70;
  margin-bottom:.35rem;
}

.answer-inline-progress{
  height:8px;
  background: rgba(255,255,255,.08);
  border-radius:999px;
  overflow:hidden;
  position:relative;
}

.answer-inline-progress-fill{
  height:100%;
  width:100%;
  transform: scaleX(0);
  transform-origin:left;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(34,211,238,.95), rgba(168,85,247,.95)); /* cyan → violet premium */
}

.answer-inline-progress-fill.is-running{
  animation-name: mmxFillTime;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes mmxFillTime{
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ==========================================
   ACTIONS
========================================== */

.answer-inline-actions{
  display:flex;
  gap:.6rem;
  margin-top:.8rem;
  align-items:center;
  flex-wrap:wrap;
}

.answer-inline-actions .btn{
  border-radius:999px;
}

/* ==========================================
   SUCCESS TOAST (bonne réponse)
========================================== */

.mmx-inline-success-toast{
  margin-top:1rem;
  padding:.6rem 1rem;
  border-radius:12px;
  font-weight:500;
  background:rgba(0, 255, 170, 0.08);
  border:1px solid rgba(0,255,170,.35);
  color:#3ef0c5;
  text-align:center;
  animation: fadeInInline .2s ease;
}

/* ==========================================
   Animations
========================================== */

@keyframes fadeInInline{
  from{ opacity:0; transform:translateY(4px); }
  to{ opacity:1; transform:translateY(0); }
}

