/* Hebroni — Progress Dashboard (/interactives/progress/)
   Self-contained: uses /en/en.css variables only (light + dark via [data-theme]). */

.pg-shell { max-width: 720px; margin: 0 auto; }

/* ── Stagger-in animation ── */
@keyframes pgFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stagger-children > * {
  opacity: 0;
  animation: pgFadeUp 0.4s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.19s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.26s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.33s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.40s; }

/* ── Sections ── */
.pg-section { padding: 32px 0; border-bottom: 1px solid var(--border); }
.pg-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.pg-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 18px;
}

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-tile-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-tile-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 6px; }

/* ── Set / curriculum bars ── */
.set-bar-item { margin-bottom: 16px; }
.set-bar-item:last-child { margin-bottom: 0; }
.set-bar-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.set-bar-label { font-size: 0.92rem; color: var(--text); text-decoration: none; }
.set-bar-label[href]:hover { color: var(--gold); }
.set-bar-count { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.set-bar-track { height: 8px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.set-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--gold-lt), var(--gold));
}

/* ── Accuracy chart ── */
.chart-wrap {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
#accuracyChart { width: 100%; height: 160px; display: block; }
#chartEmpty { display: none; text-align: center; padding: 36px 16px; color: var(--muted); font-size: 0.88rem; }

/* ── Session history ── */
.session-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: none; }
.session-icon { font-size: 0.9rem; color: var(--muted); white-space: nowrap; min-width: 90px; }
.session-info { flex: 1; min-width: 0; }
.session-set { font-size: 0.92rem; color: var(--text); }
.session-date { font-size: 0.75rem; color: var(--muted); }
.session-score { font-size: 0.95rem; font-weight: 700; color: var(--gold); white-space: nowrap; }

/* ── Badges ── */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.badge-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.badge-tile.locked { opacity: 0.45; filter: grayscale(70%); }
.badge-tile.earned { border-color: var(--border-ho); background: var(--gold-bg); }
.badge-icon { font-size: 1.9rem; line-height: 1; font-family: 'Frank Ruhl Libre', serif; }
.badge-label { font-size: 0.72rem; font-weight: 600; color: var(--text); line-height: 1.25; }
.badge-desc { font-size: 0.64rem; color: var(--muted); line-height: 1.3; }

/* ── Reset ── */
.reset-section { padding: 32px 0 0; text-align: center; }
.btn-danger {
  background: rgba(192,57,43,0.1);
  border: 1px solid rgba(192,57,43,0.35);
  color: #c0392b;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
:root[data-theme="dark"] .btn-danger { color: #e8786a; }
.btn-danger:hover { background: rgba(192,57,43,0.18); border-color: rgba(192,57,43,0.5); }

/* ── Reset dialog ── */
#resetDialog {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  align-items: center; justify-content: center;
}
#resetDialog.open { display: flex; }
.dialog-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 320px;
  text-align: center;
  display: flex; flex-direction: column; gap: 16px;
  margin: 0 16px;
}
.dialog-box h3 { color: var(--text); }
.dialog-box p { font-size: 0.88rem; color: var(--muted); }
.dialog-btns { display: flex; gap: 10px; justify-content: center; }
.btn { padding: 11px 22px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 700; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: #c0392b; color: #fff; }
.btn-primary:hover { background: #a8311f; }
.btn-secondary { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--gold); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .pg-section { padding: 24px 0; }
  .badges-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}
