*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #4F46E5;
  --purple: #7C3AED;
  --sky: #0EA5E9;
  --green: #10B981;
  --red: #EF4444;
  --amber: #F59E0B;
  --bg: #F1F5F9;
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --border: #E2E8F0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 920px;
  margin: 0 auto;
}

/* ── Header ── */
#header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 10px;
}
#btn-menu {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 5px 10px;
  transition: all 0.15s;
}
#btn-menu::after { content: ' ▾'; font-size: 0.65rem; }
#btn-menu[aria-expanded="true"]::after { content: ' ▴'; }
#btn-menu:hover { background: var(--bg); border-color: var(--border); color: var(--text); }
#btn-menu[aria-expanded="true"] { color: var(--blue); background: #EEF2FF; border-color: #C7D2FE; }

#series-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

#header { position: relative; }
#menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px 0;
}
.menu-group { padding: 4px 0; }
.menu-group + .menu-group { border-top: 1px solid var(--border); }
.menu-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding: 8px 20px 3px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
}
.menu-item:hover { background: var(--bg); }
.menu-item.current { font-weight: 600; color: var(--blue); }
.menu-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  color: var(--muted);
}
.menu-item.done    .menu-icon { color: var(--green); }
.menu-item.current .menu-icon { color: var(--blue); }

.menu-group-sim { border-top: 1px dashed var(--border) !important; }
.menu-item-sim {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.12s;
}
.menu-item-sim:hover { background: #EEF2FF; }
.menu-sim-arrow { margin-left: auto; font-size: 0.75rem; opacity: 0.6; }
#slide-counter { font-size: 0.8rem; color: var(--muted); }
#progress-track { height: 4px; background: var(--border); }
#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Main ── */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#module-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  min-height: 26px;
  display: none;
}
#slide-area {
  width: 100%;
  max-width: 740px;
  transition: opacity 0.25s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-enter { animation: fadeUp 0.3s ease both; }

/* ── Footer ── */
#footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#nav-dots { display: flex; gap: 7px; align-items: center; }
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}
.nav-dot.active  { background: var(--blue); width: 24px; border-radius: 4px; }
.nav-dot.done    { background: var(--green); }

/* ── Buttons ── */
.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  font-family: inherit;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) {
  background: #4338CA;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
}
.btn-secondary { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); color: var(--text); }

/* ── Intro slide ── */
.slide-intro {
  text-align: center;
  padding: 52px 40px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.course-icon { font-size: 3.5rem; margin-bottom: 20px; display: block; }
.slide-intro h1 { font-size: 2rem; font-weight: 800; margin-bottom: 6px; }
.slide-intro .subtitle { color: var(--muted); margin-bottom: 36px; }
.agenda { display: flex; flex-direction: column; gap: 12px; max-width: 440px; margin: 0 auto; text-align: left; }
.agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--bg);
  border-left: 4px solid;
}
.agenda-item.mod-1 { border-color: var(--blue); }
.agenda-item.mod-2 { border-color: var(--purple); }
.agenda-item.mod-3 { border-color: var(--sky); }
.agenda-num { font-weight: 700; font-size: 0.78rem; color: var(--muted); flex-shrink: 0; padding-top: 2px; }
.agenda-title { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }

/* ── Content slide ── */
.slide-content {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
}
.slide-content h2 { font-size: 1.55rem; font-weight: 800; margin-bottom: 18px; line-height: 1.3; }
.slide-content p { color: var(--muted); margin-bottom: 14px; font-size: 0.975rem; }
.slide-content p:last-child { margin-bottom: 0; }

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.93rem;
  padding: 13px 16px;
  background: var(--bg);
  border-radius: 8px;
}
.feature-list li .fi { font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.feature-list li .fl { font-weight: 600; display: block; margin-bottom: 2px; }
.feature-list li .fd { color: var(--muted); font-size: 0.86rem; }

.callout {
  border-left: 4px solid;
  padding: 13px 18px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  font-size: 0.9rem;
}
.callout.info    { border-color: var(--sky);   background: #F0F9FF; }
.callout.warning { border-color: var(--amber); background: #FFFBEB; }
.callout.danger  { border-color: var(--red);   background: #FEF2F2; }
.callout.success { border-color: var(--green); background: #F0FDF4; }
.callout strong  { display: block; margin-bottom: 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.col-card { padding: 16px; border-radius: 8px; background: var(--bg); }
.col-card h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.col-card ul { list-style: none; font-size: 0.875rem; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.col-card ul li::before { content: "• "; }

.prompt-box {
  background: #1E293B;
  color: #CBD5E1;
  border-radius: 8px;
  padding: 16px 20px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.84rem;
  line-height: 1.7;
  margin: 12px 0;
}
.prompt-box .plabel { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; margin-bottom: 6px; display: block; font-family: inherit; }
.prompt-box .bad  { color: #FCA5A5; }
.prompt-box .good { color: #6EE7B7; }

/* ── Quiz slide ── */
.slide-quiz {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
}
.slide-quiz h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.quiz-sub { font-size: 0.875rem; color: var(--muted); margin-bottom: 30px; }
.q-block { margin-bottom: 30px; }
.q-block:last-child { margin-bottom: 0; }
.q-text { font-size: 0.975rem; font-weight: 600; margin-bottom: 12px; line-height: 1.5; }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.opt-btn:hover:not(:disabled)  { border-color: var(--blue); background: #EEF2FF; }
.opt-btn.selected               { border-color: var(--blue); background: #EEF2FF; }
.opt-btn.correct                { border-color: var(--green); background: #F0FDF4; color: #065F46; }
.opt-btn.wrong                  { border-color: var(--red);   background: #FEF2F2; color: #991B1B; }
.opt-btn.show-correct           { border-color: var(--green); background: #F0FDF4; color: #065F46; opacity: 0.65; }
.opt-indicator {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--muted);
}
.opt-btn.selected .opt-indicator   { border-color: var(--blue); color: var(--blue); }
.opt-btn.correct .opt-indicator    { border-color: var(--green); color: var(--green); }
.opt-btn.wrong .opt-indicator      { border-color: var(--red); color: var(--red); }
.opt-btn.show-correct .opt-indicator { border-color: var(--green); color: var(--green); }
.feedback {
  margin-top: 10px;
  font-size: 0.86rem;
  padding: 10px 14px;
  border-radius: 6px;
  display: none;
  line-height: 1.5;
}
.feedback.show       { display: block; }
.feedback.correct-fb { background: #D1FAE5; color: #065F46; }
.feedback.wrong-fb   { background: #FEE2E2; color: #991B1B; }

/* ── Complete slide ── */
.slide-complete {
  text-align: center;
  padding: 52px 40px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.complete-icon { font-size: 4rem; display: block; margin-bottom: 16px; }
.slide-complete h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.complete-sub { color: var(--muted); margin-bottom: 36px; }
.takeaways { display: flex; flex-direction: column; gap: 10px; max-width: 480px; margin: 0 auto 32px; text-align: left; }
.takeaway {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.takeaway-icon { font-size: 1.1rem; flex-shrink: 0; }
.badge {
  display: inline-block;
  padding: 9px 22px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* ── Module tag colours ── */
.mod-tag-1 { background: #EEF2FF; color: var(--blue);   display: inline-block; }
.mod-tag-2 { background: #F5F3FF; color: var(--purple); display: inline-block; }
.mod-tag-3 { background: #F0F9FF; color: var(--sky);    display: inline-block; }

/* ── Responsive ── */
@media (max-width: 620px) {
  .slide-content, .slide-quiz { padding: 24px 20px; }
  .slide-content h2 { font-size: 1.25rem; }
  .two-col { grid-template-columns: 1fr; }
  #main { padding: 20px 14px 8px; }
  .slide-intro { padding: 36px 20px; }
  .slide-complete { padding: 36px 20px; }
  #series-label { display: none; }
}
