/* ============================================================================
 * lesson-enrichment.css
 * Styles for the enriched lesson template:
 *   - lesson-meta duration badge & TTS button
 *   - learning objectives block
 *   - prerequisites block
 *   - quiz éclair (intra-lesson)
 *   - "À retenir" retention card
 *   - chapter progress sidebar
 *   - dashboard "Reprendre" card
 *   - fiche print mode
 * ============================================================================ */

/* --- Duration badge & TTS button ------------------------------------------ */
.duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f1f3f5;
  color: #495057;
  font-size: 0.85rem;
  font-weight: 600;
}

.tts-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--primary, #6c5ce7);
  background: transparent;
  color: var(--primary, #6c5ce7);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tts-button:hover {
  background: var(--primary-light, #f3f0ff);
}

.tts-button[aria-pressed="true"] {
  background: var(--primary, #6c5ce7);
  color: white;
}

/* --- Learning objectives --------------------------------------------------- */
.lesson-objectives {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid #6c5ce7;
  background: #f3f0ff;
  border-radius: 0 12px 12px 0;
}

.lesson-objectives-title {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: #6c5ce7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lesson-objectives ul {
  margin: 0;
  padding-left: 1.25rem;
}

.lesson-objectives li {
  margin-bottom: 0.35rem;
  color: #2d3436;
  line-height: 1.5;
}

.lesson-objectives li:last-child { margin-bottom: 0; }

/* --- Prerequisites --------------------------------------------------------- */
.lesson-prereqs {
  margin: 1rem 0 1.5rem 0;
  padding: 0.85rem 1.2rem;
  border: 1px dashed #b2bec3;
  border-radius: 10px;
  background: #f8f9fa;
}

.lesson-prereqs-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #636e72;
}

.lesson-prereqs ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lesson-prereqs li a {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: white;
  border: 1px solid #dfe6e9;
  color: #2d3436;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lesson-prereqs li a:hover {
  border-color: #6c5ce7;
  color: #6c5ce7;
}

.prereq-chap {
  font-size: 0.75rem;
  color: #95a5a6;
  margin-left: 0.25rem;
}

/* --- Quiz éclair ----------------------------------------------------------- */
.quiz-eclair {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  color: #2d3436;
}

.quiz-eclair-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.quiz-eclair-desc {
  margin: 0 0 1.25rem 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.quiz-eclair-card {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quiz-eclair-card:last-child { margin-bottom: 0; }

.quiz-eclair-question {
  margin: 0 0 0.8rem 0;
  font-weight: 600;
  color: #2d3436;
}

.quiz-eclair-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-eclair-option {
  padding: 0.7rem 1rem;
  border: 2px solid #dfe6e9;
  border-radius: 8px;
  background: white;
  color: #2d3436;
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-eclair-option:hover:not(:disabled) {
  border-color: #6c5ce7;
  background: #f3f0ff;
}

.quiz-eclair-option:disabled { cursor: default; }

.quiz-eclair-option.is-correct {
  border-color: #00b894;
  background: #e6f7f1;
  color: #00866d;
  font-weight: 600;
}

.quiz-eclair-option.is-wrong {
  border-color: #d63031;
  background: #fdecec;
  color: #c0392b;
}

.quiz-eclair-feedback {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.quiz-eclair-feedback.good { background: #e6f7f1; color: #00866d; }
.quiz-eclair-feedback.bad  { background: #fdecec; color: #c0392b; }

/* --- À retenir card -------------------------------------------------------- */
.retention-card {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(0,184,148,0.2);
}

.retention-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.retention-icon { font-size: 1.6rem; }

.retention-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.retention-body {
  font-size: 0.98rem;
  line-height: 1.6;
}

.retention-body ul {
  margin: 0;
  padding-left: 1.25rem;
}

.retention-body li {
  margin-bottom: 0.45rem;
}

.retention-body li:last-child { margin-bottom: 0; }

.retention-body strong { color: #fff; background: rgba(255,255,255,0.15); padding: 0 0.3rem; border-radius: 4px; }

/* --- Chapter progress sidebar --------------------------------------------- */
.chapter-progress-card {
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.25rem;
  border-radius: 12px;
  background: white;
  border: 1px solid #e9ecef;
}

.chapter-progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0 0.25rem 0;
}

.chapter-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #00b894);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.chapter-progress-label {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  color: #636e72;
}

.chapter-lessons-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: lesson-counter;
}

.chap-lesson-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-top: 1px solid #f1f3f5;
}

.chap-lesson-item:first-child { border-top: none; }

.chap-lesson-status {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9ecef;
  color: #636e72;
  font-size: 0.8rem;
  font-weight: 700;
}

.chap-lesson-item.is-done .chap-lesson-status {
  background: #00b894;
  color: white;
}

.chap-lesson-item.is-current .chap-lesson-status {
  background: #6c5ce7;
  color: white;
  box-shadow: 0 0 0 3px #e6dfff;
}

.chap-lesson-title {
  flex: 1;
  font-size: 0.9rem;
  color: #2d3436;
  text-decoration: none;
  line-height: 1.35;
}

.chap-lesson-item.is-current .chap-lesson-title { font-weight: 700; color: #6c5ce7; }
.chap-lesson-item.is-done .chap-lesson-title { color: #636e72; }

a.chap-lesson-title:hover { color: #6c5ce7; }

/* --- Dashboard "Reprendre" card ------------------------------------------- */
.resume-card {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--resume-color, #6c5ce7), color-mix(in srgb, var(--resume-color, #6c5ce7) 60%, #ffffff));
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 6px 20px rgba(108,92,231,0.2);
}

.resume-card-body h3 {
  margin: 0 0 0.25rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.85;
}

.resume-card-body p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.resume-card-body small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

.resume-card .btn {
  background: white;
  color: var(--resume-color, #6c5ce7);
  flex-shrink: 0;
}

.resume-card .btn:hover {
  background: rgba(255,255,255,0.9);
}

/* --- Print mode for fiches ------------------------------------------------- */
@media print {
  .no-print, header, .breadcrumb, .page-nav, .fiche-nav, .sidebar-title, .lesson-sidebar, .nav-user, .flash-container, .footer, footer { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .page-container { max-width: none; padding: 0; margin: 0; }
  .fiche-body, .lesson-body { break-inside: auto; }
  h1 { page-break-after: avoid; }
  h2, h3 { page-break-after: avoid; break-after: avoid; }
  a { color: black; text-decoration: none; }
  .retention-card { background: none; color: black; border: 2px solid #00b894; }
  .retention-card .retention-body strong { background: none; color: black; }
  svg { max-width: 100%; height: auto; }
}

.fiche-page.is-print-mode header,
.fiche-page.is-print-mode .breadcrumb,
.fiche-page.is-print-mode .page-nav,
.fiche-page.is-print-mode .fiche-nav,
.fiche-page.is-print-mode .footer { display: none; }

.fiche-page.is-print-mode {
  background: white;
  max-width: 21cm;
  margin: 0 auto;
  padding: 1.5cm;
}

.print-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid #6c5ce7;
  border-radius: 999px;
  background: transparent;
  color: #6c5ce7;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
}

.print-button:hover { background: #f3f0ff; }

/* --- Responsive small screens --------------------------------------------- */
@media (max-width: 768px) {
  .lesson-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .quiz-eclair, .retention-card {
    padding: 1.25rem;
  }
}
