/* ============================================================
   FORUM ANAK — Components v2
   Quiz, Flip Cards, Badges, Interactive Elements
   ============================================================ */

/* ── QUIZ BOX ──────────────────────────────────────────── */
.quiz-box {
  background: var(--white);
  padding: 40px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* Decorative top stripe */
.quiz-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--purple), var(--pink));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

/* Progress bar */
.quiz-progress-wrap {
  margin-bottom: 28px;
}
.quiz-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.quiz-progress-label span {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
}
.quiz-progress-label .progress-count {
  color: var(--primary);
}
.quiz-progress-bar {
  height: 10px;
  background: var(--primary-light);
  border-radius: var(--r-full);
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--r-full);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
  position: relative;
}
.quiz-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 20px; height: 100%;
  background: rgba(255,255,255,.35);
  border-radius: var(--r-full);
}

/* Quiz question */
.quiz-question {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.4;
}

/* Answer options */
.quiz-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-quiz-option {
  background: var(--bg);
  border: 2.5px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--r-md);
  text-align: left;
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

/* Letter indicator */
.btn-quiz-option::before {
  content: attr(data-letter);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--border);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}

.btn-quiz-option:hover:not([disabled]) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(4px);
}
.btn-quiz-option:hover:not([disabled])::before {
  background: var(--primary);
  color: var(--white);
}

.btn-quiz-option.correct {
  background: var(--green-light) !important;
  border-color: var(--green) !important;
  color: #1a4d30 !important;
  animation: scaleIn .3s ease;
}
.btn-quiz-option.correct::before {
  background: var(--green) !important;
  color: var(--white) !important;
}

.btn-quiz-option.incorrect {
  background: var(--pink-light) !important;
  border-color: var(--pink) !important;
  color: #8b1d2f !important;
  animation: shake .4s ease;
}
.btn-quiz-option.incorrect::before {
  background: var(--pink) !important;
  color: var(--white) !important;
}

.btn-quiz-option[disabled] { cursor: not-allowed; opacity: .75; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* Feedback message */
.quiz-feedback {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--r-md);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeUp .35s ease;
}
.quiz-feedback::before {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: -1px;
}

.feedback-correct {
  background: var(--green-light);
  color: #1a4d30;
  border: 1.5px solid var(--green);
}
.feedback-correct::before { content: '🎉'; }

.feedback-incorrect {
  background: var(--yellow-light);
  color: #6b4700;
  border: 1.5px solid var(--yellow);
}
.feedback-incorrect::before { content: '💡'; }

/* Next button */
#nextBtn {
  margin-top: 22px;
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  color: var(--white);
  padding: 15px 28px;
  border-radius: var(--r-full);
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 18px rgba(91,141,239,.35);
  display: none;
}
#nextBtn:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(91,141,239,.45); }

/* ── QUIZ RESULT ───────────────────────────────────────── */
#quizResult {
  text-align: center;
  padding: 12px 0;
  display: none;
  animation: scaleIn .5s cubic-bezier(.34,1.56,.64,1);
}

.result-trophy {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
  animation: floatY 3s ease-in-out infinite;
}

.score-display {
  font-family: var(--font-title);
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 8px 0;
}

.score-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 20px;
}

.result-msg {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  font-family: var(--font-title);
}

/* Achievement badges */
.achievement-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: .82rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid rgba(91,141,239,.25);
}
.badge-chip.gold   { background: var(--yellow-light); color: #7a5000; border-color: rgba(255,209,102,.4); }
.badge-chip.green  { background: var(--green-light);  color: #1a4d30; border-color: rgba(139,211,168,.4); }
.badge-chip.purple { background: var(--purple-light); color: #5730cc; border-color: rgba(196,181,253,.4); }

#restartBtn {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--orange) 100%);
  color: var(--text);
  padding: 14px 32px;
  border-radius: var(--r-full);
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 18px rgba(255,209,102,.40);
}
#restartBtn:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(255,209,102,.50); }

/* ── FLIP CARD ─────────────────────────────────────────── */
.flip-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.flip-card {
  height: 180px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.4, 0, .2, 1);
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.flip-card-front {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  color: var(--primary);
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 800;
  gap: 12px;
}
.flip-card-front .flip-icon { font-size: 2.2rem; }
.flip-card-front .flip-hint {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: auto;
  opacity: .8;
}

.flip-card-back {
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--pink-light) 100%);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.55;
  transform: rotateY(180deg);
}

/* ── FACT OR MYTH ──────────────────────────────────────── */
.fact-myth-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.fact-myth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--pink));
}

.fact-myth-statement {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 32px;
}

.fact-myth-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-fact {
  background: var(--green-light);
  color: #1a4d30;
  border: 2.5px solid var(--green);
  padding: 14px 32px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast);
}
.btn-fact:hover { background: var(--green); color: var(--white); transform: translateY(-3px); box-shadow: 0 6px 18px rgba(139,211,168,.45); }

.btn-myth {
  background: var(--pink-light);
  color: #8b1d2f;
  border: 2.5px solid var(--pink);
  padding: 14px 32px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast);
}
.btn-myth:hover { background: var(--pink); color: var(--white); transform: translateY(-3px); box-shadow: 0 6px 18px rgba(253,164,175,.45); }

/* ── SAFE DECISION GAME ────────────────────────────────── */
.decision-game-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.decision-game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--green), var(--secondary), var(--primary));
}

.decision-scenario {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 28px;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  border: 1.5px solid var(--border);
}
.decision-scenario::before {
  content: '🎯 Situasi: ';
  color: var(--primary);
  font-weight: 900;
}

.decision-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-decision {
  background: var(--bg);
  border: 2.5px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: .97rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-decision:hover:not([disabled]) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(4px);
}
.btn-decision.safe   { background: var(--green-light) !important; border-color: var(--green) !important; color: #1a4d30 !important; }
.btn-decision.unsafe { background: var(--pink-light)  !important; border-color: var(--pink)  !important; color: #8b1d2f !important; }
.btn-decision[disabled] { cursor: not-allowed; }

/* ── PROGRESS INDICATOR ────────────────────────────────── */
.progress-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.progress-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--t-fast), transform var(--t-fast), width var(--t-mid);
}
.progress-dot.done    { background: var(--green); transform: scale(1.1); }
.progress-dot.active  { background: var(--primary); transform: scale(1.3); width: 28px; border-radius: var(--r-full); }
.progress-dot.wrong   { background: var(--pink); transform: scale(1.1); }

/* ── TOAST NOTIFICATION ────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 110px;
  right: 28px;
  z-index: 1000;
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  min-width: 240px;
  max-width: 320px;
  transform: translateX(120%);
  transition: transform var(--t-mid);
}
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 1.4rem; flex-shrink: 0; }
.toast.toast-success { border-left: 4px solid var(--green); }
.toast.toast-info    { border-left: 4px solid var(--primary); }
.toast.toast-warning { border-left: 4px solid var(--yellow); }

/* ── BELAJAR PAGE — Section Tabs ───────────────────────── */
.belajar-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.tab-btn {
  background: var(--white);
  border: 2px solid var(--border);
  color: var(--text-muted);
  padding: 11px 24px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast);
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(91,141,239,.35);
}

/* ── CATEGORY BADGE CHIPS ──────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.chip-blue   { background: var(--primary-light); color: var(--primary); }
.chip-green  { background: var(--green-light);   color: #1a4d30; }
.chip-yellow { background: var(--yellow-light);  color: #7a5000; }
.chip-pink   { background: var(--pink-light);    color: #8b1d2f; }
.chip-purple { background: var(--purple-light);  color: #5730cc; }
.chip-orange { background: var(--orange-light);  color: #7a3500; }

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon { font-size: 4rem; margin-bottom: 16px; display: block; }
.empty-state h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p { color: var(--text-muted); font-size: .95rem; }

/* ── SECTION DECORATIVE DIVIDER ────────────────────────── */
.wave-divider {
  width: 100%;
  height: 60px;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg { display: block; width: 100%; height: 100%; }

/* ── RESPONSIVE COMPONENTS ─────────────────────────────── */
@media (max-width: 600px) {
  .quiz-box,
  .fact-myth-card,
  .decision-game-card { padding: 28px 20px; }

  .flip-card-grid { grid-template-columns: repeat(2, 1fr); }

  .fact-myth-buttons { flex-direction: column; }
  .btn-fact, .btn-myth { justify-content: center; }

  .toast { right: 16px; min-width: unset; max-width: calc(100vw - 32px); }
}

/* ═══════════════════════════════════════════════════════
   BELAJAR SERU — Progress Panel & Achievement Badges
   ═══════════════════════════════════════════════════════ */

/* ── Overall progress panel layout ─────────────────── */
.progress-panel-inner {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.overall-progress-wrap {
  flex: 1;
  min-width: 280px;
}

/* Header row: label + fraction */
.overall-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}
.overall-progress-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.overall-progress-title svg { width: 16px; height: 16px; color: var(--primary); }
.overall-progress-fraction {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
}

/* The bar track */
.overall-progress-bar {
  height: 12px;
  background: var(--primary-light);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 16px;
}
.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
  border-radius: var(--r-full);
  transition: width .55s cubic-bezier(.4, 0, .2, 1);
}

/* ── Four activity steps ────────────────────────────── */
.activity-steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--bg);
  border: 2px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.activity-step-check {
  display: none;
  color: var(--green);
  font-weight: 900;
  font-size: .9rem;
}

/* Done state */
.activity-step[data-done="true"] {
  background: var(--green-light);
  border-color: var(--green);
  color: #1a4d30;
}
.activity-step[data-done="true"] .activity-step-check { display: inline; }

/* ── Streak badge + reset row ───────────────────────── */
.progress-meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow-light);
  border: 2px solid var(--yellow);
  border-radius: var(--r-full);
  padding: 8px 16px;
}
.streak-fire  { font-size: 1.1rem; }
.streak-count {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  color: #7a5000;
  line-height: 1;
}
.streak-label { font-size: .78rem; font-weight: 700; color: #7a5000; }

.btn-reset-progress {
  background: var(--pink-light);
  border: 2px solid var(--pink);
  color: #8b1d2f;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn-reset-progress svg { width: 14px; height: 14px; }
.btn-reset-progress:hover { background: var(--pink); color: var(--white); }

/* ── Badges panel ───────────────────────────────────── */
.badges-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.badges-panel-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.badges-panel-title svg { width: 16px; height: 16px; color: var(--yellow); }
.badges-earned-count {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
}

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

/* Individual badge pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  font-size: .8rem;
  font-weight: 700;
  border: 2px solid transparent;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  position: relative;
}
.badge-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Locked state — greyed out */
.badge-pill.locked {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-muted);
  filter: grayscale(1);
  opacity: .55;
}

/* Unlocked colour variants (reuse badge-chip colours) */
.badge-pill.unlocked           { background: var(--primary-light); color: var(--primary);  border-color: rgba(91,141,239,.25); }
.badge-pill.unlocked.gold      { background: var(--yellow-light);  color: #7a5000;         border-color: rgba(255,209,102,.4); }
.badge-pill.unlocked.green     { background: var(--green-light);   color: #1a4d30;         border-color: rgba(139,211,168,.4); }
.badge-pill.unlocked.purple    { background: var(--purple-light);  color: #5730cc;         border-color: rgba(196,181,253,.4); }

/* Unlock animation */
@keyframes badgeUnlock {
  0%   { transform: scale(.6) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg);    opacity: 1; }
}
.badge-pill.just-unlocked { animation: badgeUnlock .5s cubic-bezier(.34,1.56,.64,1); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .progress-panel-inner  { flex-direction: column; gap: 16px; }
  .progress-meta-row     { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .activity-steps        { gap: 6px; }
  .activity-step         { padding: 6px 10px; font-size: .75rem; }
}


