/* ── TaalkuNL – paars/goud – mobile-first ─────────────────────────────── */

:root {
  --primary:       #7B2D8B;
  --primary-dark:  #5a1f68;
  --primary-light: #a855c2;
  --gold:          #F4C430;
  --gold-dark:     #d4a800;
  --bg:            #F8F4FF;
  --surface:       #ffffff;
  --surface2:      #f0e8f8;
  --text:          #1a1a2e;
  --text-muted:    #6b6b8a;
  --success:       #22c55e;
  --success-bg:    #dcfce7;
  --danger:        #ef4444;
  --danger-bg:     #fee2e2;
  --border:        #e2d6f0;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 4px 20px rgba(123,45,139,0.12);
  --shadow-sm:     0 2px 8px rgba(123,45,139,0.08);
  --transition:    0.18s ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input  { font-family: inherit; }

/* ── Screens ───────────────────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.screen.hidden { display: none !important; }

/* ── Day Banner ─────────────────────────────────────────────────────────── */
.day-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  left: 0; right: 0;
}
.day-banner.exam-day {
  background: linear-gradient(135deg, #d4a800, #f4c430);
  color: #1a1a2e;
  font-size: 1rem;
  padding: 14px 16px;
}
.day-banner.after-done {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
.day-banner.hidden { display: none; }

/* ── App Header ─────────────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-title { display: flex; align-items: center; gap: 10px; }
.app-logo { font-size: 2rem; }
.app-title h1 { font-size: 1.3rem; font-weight: 900; color: var(--primary); line-height: 1.1; }
.app-subtitle { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.header-stats { display: flex; gap: 8px; }
.stat-chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-icon { font-size: 0.9rem; }

/* ── Home main ──────────────────────────────────────────────────────────── */
.home-main { flex: 1; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }

/* ── Module cards ───────────────────────────────────────────────────────── */
.module-list { display: flex; flex-direction: column; gap: 12px; }

.module-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.module-card.priority {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(244,196,48,0.25);
}
.module-card.priority::before {
  content: "Vandaag";
  position: absolute;
  top: 10px; right: 10px;
  background: var(--gold);
  color: #1a1a2e;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.module-card-top { display: flex; align-items: center; gap: 10px; }
.module-icon { font-size: 1.8rem; }
.module-info { flex: 1; }
.module-name { font-size: 1rem; font-weight: 800; color: var(--text); }
.module-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.module-count { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }

.module-card-bottom { display: flex; align-items: center; gap: 10px; }

/* Progress ring */
.progress-ring-wrap { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.progress-ring-svg { transform: rotate(-90deg); }
.progress-ring-bg  { fill: none; stroke: var(--surface2); stroke-width: 4; }
.progress-ring-fill { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.progress-ring-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: var(--primary);
}

.module-box-counts { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.box-row { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-muted); }
.box-bar { flex: 1; height: 5px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.box-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.box-bar-fill.box2 { background: #a855c2; }
.box-bar-fill.box3 { background: #f59e0b; }
.box-bar-fill.box4 { background: #22c55e; }
.box-bar-fill.box5 { background: #16a34a; }

.btn-start {
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  transition: background var(--transition), transform var(--transition);
  min-height: 44px;
  white-space: nowrap;
}
.btn-start:active { background: var(--primary-dark); transform: scale(0.96); }



/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  transition: background var(--transition), transform var(--transition);
  min-height: 52px;
}
.btn-primary:active { background: var(--primary-dark); transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: var(--surface2);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  transition: background var(--transition);
  min-height: 44px;
}
.btn-secondary:active { background: var(--border); }

.btn-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-icon:active { background: var(--border); }

/* ── Session header ─────────────────────────────────────────────────────── */
.session-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.session-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.session-progress-bar {
  height: 8px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.session-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width 0.4s ease;
}
#session-progress-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-align: right; }

.lives { display: flex; gap: 2px; font-size: 1.1rem; }
.heart { transition: opacity 0.3s, transform 0.3s; display: inline-block; }
.heart.lost { opacity: 0.2; transform: scale(0.8); }

/* ── Session main ───────────────────────────────────────────────────────── */
.session-main {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  color: var(--primary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  align-self: flex-start;
}

/* Question card */
.question-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: slideIn 0.22s ease;
}
.question-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.question-text  { font-size: 1.15rem; font-weight: 800; line-height: 1.4; color: var(--text); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
.shake { animation: shake 0.35s ease !important; }
.flash-green { background: var(--success-bg) !important; }

/* Multiple choice */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mc-option {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  color: var(--text);
  min-height: 52px;
  transition: border-color var(--transition), background var(--transition);
  line-height: 1.35;
}
.mc-option:active { background: var(--surface2); }
.mc-option.correct { border-color: var(--success); background: var(--success-bg); color: #166534; }
.mc-option.wrong   { border-color: var(--danger);  background: var(--danger-bg);  color: #991b1b; }
.mc-option:disabled { cursor: default; }

/* Type area */
.type-area { display: flex; flex-direction: column; gap: 10px; }
.type-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
  min-height: 52px;
}
.type-input:focus { border-color: var(--primary); }
.type-input.correct { border-color: var(--success); background: var(--success-bg); }
.type-input.wrong   { border-color: var(--danger);  background: var(--danger-bg);  }

/* Feedback */
.feedback-area { text-align: center; }
.feedback-text { font-size: 1rem; font-weight: 800; }
.feedback-text.correct { color: var(--success); }
.feedback-text.wrong   { color: var(--danger); }
.correct-answer-reveal {
  margin-top: 8px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.correct-answer-reveal strong { color: var(--primary); }

/* ── Result screen ──────────────────────────────────────────────────────── */
.result-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 16px;
  text-align: center;
}
.result-icon { font-size: 4rem; animation: popIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275); }
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.result-main h2 { font-size: 1.5rem; font-weight: 900; }
#result-subtitle { color: var(--text-muted); font-size: 0.9rem; font-weight: 700; }

.result-stats {
  display: flex;
  gap: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 28px;
  box-shadow: var(--shadow-sm);
  margin: 8px 0;
}
.result-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.result-stat-val { font-size: 1.6rem; font-weight: 900; color: var(--primary); }
.result-stat-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }

.result-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }

/* ── Stats screen ───────────────────────────────────────────────────────── */
.stats-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stats-header h2 { font-size: 1.1rem; font-weight: 900; }
.stats-main { flex: 1; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }

.stats-top { display: flex; gap: 10px; }
.stat-box {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 10px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-box-val   { font-size: 1.4rem; font-weight: 900; color: var(--primary); }
.stat-box-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }

.stats-section-title { font-size: 0.85rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* XP chart */
.xp-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px 4px;
  box-shadow: var(--shadow-sm);
}
.xp-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.xp-bar { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.4s ease; }
.xp-bar-day { font-size: 0.55rem; color: var(--text-muted); font-weight: 700; }

/* Module progress */
#stats-module-progress { display: flex; flex-direction: column; gap: 12px; }
.mod-progress-row {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mod-progress-header { display: flex; justify-content: space-between; align-items: center; }
.mod-progress-name { font-size: 0.88rem; font-weight: 800; }
.mod-progress-pct  { font-size: 0.8rem; font-weight: 700; color: var(--primary); }
.mod-progress-bar  { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.mod-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 999px; transition: width 0.5s ease; }
.mod-progress-detail { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

/* ── Confetti ───────────────────────────────────────────────────────────── */
.confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  width: 100%; height: 100%;
}

/* ── Day filter bar ─────────────────────────────────────────────────────── */
.day-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  gap: 10px;
}
.day-filter-clear {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
  width: 32px !important; height: 32px !important;
  font-size: 0.8rem !important;
  flex-shrink: 0;
}

/* ── Home actions ───────────────────────────────────────────────────────── */
.home-actions { display: flex; justify-content: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* ── Notion links screen ────────────────────────────────────────────────── */
.links-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.5;
}

.link-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.link-info { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.link-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }
.link-name { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.link-desc { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-top: 1px; }
.link-url {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 700;
  word-break: break-all;
  margin-top: 3px;
  font-family: monospace;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.btn-copy {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  align-self: center;
}
.btn-copy:active { background: var(--border); }
.btn-copy.copied { background: var(--success-bg); color: var(--success); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
