/* AI Awareness Course — Premium Minimal Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a1a1a;
  --primary-soft: #2c2c2c;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-muted: #ccfbf1;
  --accent-border: #99f6e4;
  --success: #047857;
  --success-light: #ecfdf5;
  --warning: #b45309;
  --warning-light: #fffbeb;
  --danger: #b91c1c;
  --danger-light: #fef2f2;
  --info-bg: #f0f9ff;
  --info-border: #0ea5e9;

  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  --text: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --text-faint: #a8a29e;

  /* Sidebar matches main dashboard (light); dark mode overrides below */
  --sidebar-bg: #f7f7f5;
  --sidebar-text: #57534e;
  --sidebar-text-strong: #1c1917;
  --sidebar-hover: #efeeec;
  --sidebar-active: #e7f7f4;
  --sidebar-border: #e7e5e4;
  --sidebar-muted: #78716c;
  --sidebar-chip: #ffffff;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 1px 3px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 4px 16px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 12px 40px rgba(28, 25, 23, 0.08);
  --transition: 0.18s ease;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sidebar-w: 280px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.sidebar-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.sidebar-mesh-svg {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 100%;
  animation: meshDrift 22s ease-in-out infinite alternate;
  transform-origin: center center;
}
.sidebar-mesh .mesh-lines {
  stroke-dasharray: 6 10;
  animation: meshDash 18s linear infinite;
}
.sidebar-mesh .node {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 3.2s ease-in-out infinite;
}
.sidebar-mesh .n2 { animation-delay: 0.2s; }
.sidebar-mesh .n4 { animation-delay: 0.5s; }
.sidebar-mesh .n6 { animation-delay: 0.8s; }
.sidebar-mesh .n8 { animation-delay: 1.1s; }
.sidebar-mesh .n10 { animation-delay: 1.4s; }
.sidebar-mesh .n12 { animation-delay: 0.3s; }
.sidebar-mesh .n14 { animation-delay: 0.7s; }
.sidebar-mesh .n16 { animation-delay: 1.0s; }
.sidebar-mesh .n20 { animation-delay: 0.4s; }
.sidebar-mesh .n21 { animation-delay: 0.9s; }
.sidebar-mesh .n22 { animation-delay: 1.3s; }
.sidebar-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
  overflow-y: auto;
  background: transparent;
}
.sidebar-header {
  padding: 28px 22px 28px;
  min-height: 320px;
  border-bottom: 1px solid var(--sidebar-border);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb, var(--sidebar-bg) 82%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* Author photo as soft background — taller crop to show full portrait */
.sidebar-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: -48px;
  z-index: 0;
  background-image: url("../images/ritche-gerona.png");
  background-size: 128% auto;
  background-position: center 8%;
  background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
}
.sidebar-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: -48px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sidebar-bg) 22%, transparent) 0%,
    color-mix(in srgb, var(--sidebar-bg) 38%, transparent) 40%,
    color-mix(in srgb, var(--sidebar-bg) 72%, transparent) 72%,
    color-mix(in srgb, var(--sidebar-bg) 92%, transparent) 100%
  );
}
.sidebar-header > * {
  position: relative;
  z-index: 1;
}
.sidebar-header h1,
.sidebar-header .sidebar-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--sidebar-text-strong);
  display: inline-block;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--sidebar-text-strong) 0%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* drop-shadow works with gradient-clipped text (text-shadow does not) */
  filter:
    drop-shadow(0 1px 1px rgba(28, 25, 23, 0.35))
    drop-shadow(0 3px 8px rgba(15, 118, 110, 0.35))
    drop-shadow(0 6px 14px rgba(28, 25, 23, 0.2));
  position: relative;
}
html[data-theme="dark"] .sidebar-header h1,
html[data-theme="dark"] .sidebar-header .sidebar-title {
  filter:
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.65))
    drop-shadow(0 3px 10px rgba(45, 212, 191, 0.45))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}
.sidebar-header .sidebar-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.sidebar-header h1 .icon { font-size: 18px; opacity: 0.9; }
.sidebar-header > p {
  font-size: 12px;
  color: var(--sidebar-text);
  margin-top: 6px;
  line-height: 1.5;
}
.sidebar-header .sidebar-tagline {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 0.35em;
  margin-bottom: 2px;
  line-height: 1.5;
  background: linear-gradient(135deg, var(--sidebar-text-strong) 0%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: none;
}
html[data-theme="dark"] .sidebar-header .sidebar-tagline {
  filter: none;
}
.course-author {
  display: none;
}
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
}
.btn-home {
  margin-top: 14px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-chip);
  color: var(--sidebar-text-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.btn-home:hover {
  background: var(--sidebar-active);
  border-color: var(--accent-border);
  color: var(--accent);
}
.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
  font-size: 20px;
  cursor: pointer;
}

.module-list { flex: 1; padding: 12px 0 16px; list-style: none; background: transparent; }
.module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
  font-size: 13px;
  color: var(--sidebar-text);
}
.module-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}
.module-item.active {
  background: var(--sidebar-active);
  border-left-color: var(--accent);
  color: var(--sidebar-text-strong);
  font-weight: 500;
}
.module-item .num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sidebar-chip);
  border: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--sidebar-muted);
  box-shadow: var(--shadow);
}
.module-item.active .num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
}
.module-item.completed .num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: none;
}
.module-item .info { flex: 1; min-width: 0; }
.module-item .info .title {
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}
.module-item .info .duration {
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-top: 1px;
}
.module-item.exam-item {
  border-top: 1px solid var(--sidebar-border);
  margin-top: 8px;
  padding-top: 14px;
}
.module-item.about-item {
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 6px;
  padding-bottom: 12px;
}
.module-item.about-item .num {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--accent);
  font-size: 12px;
}

.sidebar-progress {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--sidebar-border);
  background: color-mix(in srgb, var(--sidebar-bg) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-top: auto;
}
.sidebar-progress .label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.sidebar-progress .bar {
  height: 4px;
  background: var(--sidebar-border);
  border-radius: 2px;
  overflow: hidden;
}
.sidebar-progress .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .45s ease;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  z-index: 0;
}
/* Full main area mesh (dashboard + modules) */
.main-mesh {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.main-mesh-svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: meshDrift 24s ease-in-out infinite alternate;
  transform-origin: 60% 40%;
}
.main-mesh .mesh-lines {
  stroke-dasharray: 8 12;
  animation: meshDash 20s linear infinite;
}
.main-mesh .node {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 3.4s ease-in-out infinite;
}
.main-mesh .node:nth-child(odd) { animation-delay: 0.35s; }
.main-mesh .node:nth-child(3n) { animation-delay: 0.8s; }
.main-mesh .node:nth-child(4n) { animation-delay: 1.2s; }
.main-content > *:not(.main-mesh) {
  position: relative;
  z-index: 1;
}
.dashboard,
.module-view {
  background: transparent;
}

/* ===== PAGE HEADER ===== */
.page-header {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  padding: 36px 48px 28px;
  border-bottom: 1px solid var(--border);
}
.header-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.header-mesh-svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
  animation: meshDrift 20s ease-in-out infinite alternate;
  transform-origin: 70% 40%;
}
.header-mesh-svg path {
  stroke-dasharray: 8 12;
  animation: meshDash 16s linear infinite;
}
.header-mesh-svg circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 3.6s ease-in-out infinite;
}
.header-mesh-svg circle:nth-child(odd) { animation-delay: 0.4s; }
.header-mesh-svg circle:nth-child(3n) { animation-delay: 0.9s; }
.page-header-inner {
  position: relative;
  z-index: 1;
}

@keyframes meshDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-1.5%, 1%, 0) scale(1.03); }
  100% { transform: translate3d(1.2%, -0.8%, 0) scale(1.02); }
}
@keyframes meshDash {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -120; }
}
@keyframes nodePulse {
  0%, 100% { opacity: 0.28; transform: scale(0.92); }
  50% { opacity: 0.7; transform: scale(1.18); }
}
.page-header h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.25;
}
.page-header > p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.65;
}
.page-header .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.page-header .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
}
.page-header .meta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.page-header .meta-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}
.page-header .meta .version-pill {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

/* ===== DASHBOARD ===== */
.dashboard {
  display: block;
  padding: 32px 48px 48px;
  max-width: 1100px;
}
.dashboard > h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.dash-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.dash-card .icon {
  font-size: 22px;
  margin-bottom: 12px;
  opacity: 0.9;
}
.dash-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dash-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Version roadmap */
.version-path {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
@media (max-width: 800px) {
  .version-path { grid-template-columns: 1fr; }
}
.version-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
}
.version-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border), var(--shadow);
}
.version-card.coming {
  opacity: 0.72;
}
.version-card .v-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.version-card.coming .v-tag { color: var(--text-faint); }
.version-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.version-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.version-card .status {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.version-card.active .status { color: var(--accent); }
.version-card.coming .status { color: var(--text-faint); }

/* ===== MODULE VIEW ===== */
.module-view {
  display: none;
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 48px 56px;
}
.module-view.active { display: block; animation: fadeIn .25s ease; }
.module-content h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}
.module-content .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.content-section { margin-bottom: 28px; }
.content-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.content-section h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.content-section p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.content-section ul, .content-section ol {
  margin: 12px 0;
  padding-left: 22px;
}
.content-section li {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.callout {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  border-left: 3px solid;
  background: var(--surface);
}
.callout.info { background: var(--info-bg); border-color: var(--info-border); }
.callout.info p { color: var(--text-secondary); }
.callout.success { background: var(--success-light); border-color: var(--success); }
.callout.warning { background: var(--warning-light); border-color: var(--warning); }
.callout strong { display: block; margin-bottom: 4px; font-size: 13px; }

.concept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.concept-card h4 { font-size: 14px; margin-bottom: 6px; }
.concept-card p { font-size: 13px; color: var(--text-muted); margin: 0; }

.example-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 16px 0;
}
.example-box strong { color: var(--accent); }
.example-box p { margin-bottom: 4px; font-size: 14px; }

.stat-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat-card .number {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  background: var(--surface);
}
.compare-table th, .compare-table td {
  padding: 11px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.compare-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-table tr:nth-child(even) { background: var(--surface-2); }

/* ===== QUIZ / EXAM ===== */
.quiz-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.quiz-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
}
.question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.question .q-text {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text);
}
.question .options label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.question .options label:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text);
  transform: translateX(3px);
}
.question .options input[type="radio"] { margin-top: 3px; accent-color: var(--accent); }
.question .options label.selected {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--accent);
  transform: translateX(3px);
}
.question .feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}
.question .feedback.correct { display: block; background: var(--success-light); color: var(--success); }
.question .feedback.incorrect { display: block; background: var(--danger-light); color: var(--danger); }

.quiz-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.quiz-score {
  text-align: center;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 18px;
}
.quiz-score .score-num {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.quiz-score .score-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.exam-header {
  text-align: center;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.exam-header h3 { font-size: 22px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.02em; }
.exam-header p { color: var(--text-muted); font-size: 14px; }
.exam-header .exam-requirements {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.exam-header .exam-requirements .req.met { color: var(--success); }
.exam-header .exam-requirements .req.unmet { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-soft); }
.btn-primary:disabled { background: #d6d3d1; cursor: not-allowed; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #065f46; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--text);
  color: var(--text);
}
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.section-nav .btn-dashboard {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.section-nav .btn-dashboard:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.page-header .meta-link-dashboard {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--accent);
}
.page-header .meta-link-dashboard:hover {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border-color: var(--accent);
  color: var(--accent-hover);
}
.mobile-home-btn {
  border: 1px solid #404040;
  background: #262626;
  color: #fafaf9;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.mobile-home-btn:hover {
  background: #0f766e;
  border-color: #0f766e;
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid var(--border);
}
.modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.modal p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.modal input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  margin-bottom: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}
.modal input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.modal-author {
  max-width: 600px;
  text-align: left;
  max-height: min(88vh, 720px);
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--border); }
.modal-author-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  padding-right: 32px;
  border-bottom: 1px solid var(--border);
}
.about-author-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  object-position: center top;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border);
}
.modal-author-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  text-align: left;
}
.about-author-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.about-author-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-faint);
}
.about-author-meta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.about-author-meta a:hover { text-decoration: underline; }
.modal-author-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
  text-align: left;
}
.modal-author-body p:last-child { margin-bottom: 18px; }

/* ===== CERTIFICATE — NAVY & GOLD TEMPLATE ===== */
.certificate-wrapper {
  display: none;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 40px 48px;
}
.certificate-wrapper.active { display: block; }

.certificate {
  --cert-navy: #0b1b3a;
  --cert-navy-2: #122a52;
  --cert-gold: #c9a227;
  --cert-gold-light: #e8d48b;
  --cert-ink: #0f172a;
  --cert-muted: #475569;
  position: relative;
  width: 1000px;
  height: 700px;
  background:
    radial-gradient(ellipse at 92% 18%, rgba(201, 162, 39, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 10% 85%, rgba(14, 165, 233, 0.06) 0%, transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  color: var(--cert-ink);
  font-family: var(--font);
}

.cert-outer-border {
  position: absolute;
  inset: 10px;
  border: 3px solid var(--cert-navy);
  pointer-events: none;
  z-index: 5;
}
.cert-inner-border {
  position: absolute;
  inset: 16px;
  border: 1.5px solid var(--cert-gold);
  pointer-events: none;
  z-index: 5;
}

.cert-corner-tl {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  background: linear-gradient(145deg, #071428 0%, #0b1b3a 55%, #123056 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  z-index: 3;
}
.cert-ai-head {
  position: absolute;
  top: 18px;
  left: 14px;
  width: 120px;
  height: 120px;
  opacity: 0.95;
}

.cert-ribbon {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 6;
  width: 118px;
}
.cert-ribbon-inner {
  background: linear-gradient(180deg, #0b1b3a 0%, #122a52 100%);
  border: 2px solid var(--cert-gold);
  color: #f8fafc;
  text-align: center;
  padding: 12px 8px 14px;
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 8px 20px rgba(11, 27, 58, 0.25);
}
.cert-ribbon-inner span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
}
.cert-ribbon-sub {
  margin-top: 4px;
  color: var(--cert-gold-light) !important;
  font-size: 11px !important;
}
.cert-ribbon-stars {
  margin-top: 6px;
  color: var(--cert-gold) !important;
  font-size: 9px !important;
  letter-spacing: 0.12em !important;
}

.cert-skills {
  position: absolute;
  left: 30px;
  top: 196px;
  width: 220px;
  list-style: none;
  z-index: 4;
  padding: 0;
  margin: 0;
}
.cert-skills::before {
  content: "Course Modules";
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cert-gold);
  margin-bottom: 11px;
  padding-left: 2px;
}
.cert-skills li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 7.5px;
}
.cert-skills .sk-num {
  flex-shrink: 0;
  min-width: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cert-gold);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.cert-skills .sk-ico {
  color: var(--cert-gold);
  font-size: 12px;
  line-height: 1.4;
  flex-shrink: 0;
}
.cert-skills strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--cert-navy);
  line-height: 1.35;
}
.cert-skills em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--cert-muted);
  line-height: 1.3;
  margin-top: 1px;
}

.cert-center {
  position: absolute;
  left: 240px;
  right: 150px;
  top: 42px;
  bottom: 36px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cert-crest { margin-bottom: 6px; }

.cert-kicker {
  font-family: "Cinzel", var(--font-serif), serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cert-navy);
  line-height: 1.1;
  margin: 0 0 2px;
}
.cert-kicker::after {
  content: "";
  display: block;
  width: 120px;
  height: 1px;
  margin: 8px auto 0;
  background: linear-gradient(90deg, transparent, var(--cert-gold), transparent);
}
.cert-presented {
  margin-top: 10px;
  font-size: 16px;
  font-style: italic;
  color: var(--cert-gold);
  font-family: var(--font-serif);
}
.certificate .recipient {
  font-family: "Great Vibes", cursive;
  font-size: 62px;
  font-weight: 400;
  color: var(--cert-gold);
  line-height: 1.15;
  margin: 6px 0 10px;
  min-height: 68px;
  max-width: 100%;
  word-break: break-word;
}
.cert-for {
  font-size: 14px;
  color: var(--cert-muted);
  margin-bottom: 5px;
}
.cert-program {
  font-family: "Cinzel", var(--font-serif), serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cert-navy);
  margin: 0 0 6px;
  line-height: 1.2;
}
.cert-level-line {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cert-gold);
  margin-bottom: 12px;
}
.certificate .completion-text {
  font-size: 14.5px;
  color: var(--cert-muted);
  max-width: 540px;
  line-height: 1.65;
  margin: 0 auto 14px;
}

.cert-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 14px;
  width: 100%;
}
.cert-meta-item {
  text-align: center;
  min-width: 96px;
}
.cert-meta-item .meta-label {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cert-muted);
  margin-bottom: 2px;
}
.cert-meta-item .meta-value {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--cert-navy);
}
.cert-meta-item .meta-value.gold { color: #b45309; }

.certificate .signature-area {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
}
.certificate .signature-box {
  min-width: 150px;
  text-align: center;
}
.certificate .sig-name {
  font-family: "Great Vibes", cursive;
  font-size: 26px;
  font-style: normal;
  color: var(--cert-navy);
  margin-bottom: 2px;
  line-height: 1.1;
}
.certificate .sig-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cert-navy), transparent);
  margin: 4px 0 6px;
  opacity: 0.45;
}
.certificate .sig-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cert-navy);
  font-weight: 700;
}
.certificate .sig-role {
  font-size: 9px;
  color: var(--cert-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.cert-center-seal { flex-shrink: 0; margin-bottom: 4px; }

.cert-gold-seal {
  position: absolute;
  right: 36px;
  top: 48%;
  transform: translateY(-40%);
  z-index: 6;
  filter: drop-shadow(0 6px 12px rgba(138, 112, 20, 0.28));
}

.cert-qr-block {
  position: absolute;
  left: 36px;
  bottom: 28px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 90px;
}
.cert-qr {
  width: 72px;
  height: 72px;
  border: 2px solid var(--cert-navy);
  background: #fff;
  padding: 3px;
  display: block;
}
.cert-qr-block span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cert-navy);
  text-align: center;
  line-height: 1.2;
}

.cert-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* Hide old minimal cert leftovers if present */
.certificate-frame,
.certificate-frame-inner,
.certificate-mark,
.certificate-glow,
.certificate-brain,
.certificate-neurons,
.certificate-top-bar,
.certificate-bottom-bar,
.certificate-border-glow,
.certificate-border-inner,
.certificate-corner,
.certificate-bolt-left,
.certificate-bolt-right,
.certificate-seal,
.certificate-logo { display: none !important; }

@media (max-width: 768px) {
  .certificate { width: 1000px; height: 700px; }
  .certificate-wrapper.active { overflow-x: auto; }
}

@media print {
  @page { margin: 0.35in; size: landscape; }
  body { background: #fff !important; }
  .sidebar, .section-nav, .quiz-actions, .cert-actions, .btn,
  .mobile-topbar, .sidebar-backdrop, .toast, .menu-toggle,
  .page-header, .dashboard { display: none !important; }
  .main-content { margin-left: 0; }
  .certificate-wrapper.active {
    display: block !important;
    padding: 0;
    max-width: 100%;
  }
  .certificate {
    box-shadow: none !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1000/700;
    page-break-inside: avoid;
  }
}

/* ===== MOBILE ===== */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--sidebar-bg);
  color: #fafaf9;
  z-index: 150;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  border-bottom: 1px solid #262626;
}
.mobile-topbar-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-topbar-spacer { flex: 1; }
.menu-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: #262626;
  color: #fafaf9;
  font-size: 16px;
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 90;
}
.sidebar-backdrop.visible { display: block; }
body.sidebar-open { overflow: hidden; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: min(90vw, 400px);
  text-align: center;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .sidebar-close { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    width: min(280px, 86vw);
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-top: 52px; }
  .page-header { padding: 24px 20px; }
  .dashboard, .module-view, .certificate-wrapper { padding: 20px; }
  .page-header h1 { font-size: 22px; }
  .certificate { width: 920px; height: 650px; }
  .certificate-wrapper.active { overflow-x: auto; }
  .modal-author-header { flex-direction: column; align-items: center; text-align: center; }
  .about-author-meta { justify-content: center; }
  .modal-author-header h3,
  .about-author-role { text-align: center; }
}

/* ===== UI ENHANCEMENTS V1.1 ===== */
.page-header {
  background:
    radial-gradient(ellipse 70% 100% at 95% -10%, rgba(15, 118, 110, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 50% 80% at 5% 110%, rgba(56, 189, 248, 0.07) 0%, transparent 45%),
    linear-gradient(180deg, #fbfcfb 0%, #f7f7f5 100%);
  padding: 32px 48px 28px;
}
.page-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  max-width: 1100px;
}
.page-header-copy { flex: 1; min-width: 0; }
.hero-progress-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.page-header .meta span {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
}
.page-header .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.page-header h1 {
  background: linear-gradient(135deg, #1c1917 0%, #292524 50%, #0f766e 160%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-progress-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 260px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.hero-progress-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-border);
}
.ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
.progress-ring { transform: rotate(-90deg); }
.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset .7s cubic-bezier(.22,1,.36,1), stroke .3s ease;
  filter: drop-shadow(0 0 6px rgba(15, 118, 110, 0.35));
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.ring-label span { font-size: 22px; line-height: 1; }
.ring-label small { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.hero-progress-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.hero-progress-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.hero-progress-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.hero-progress-stats strong { color: var(--accent); font-weight: 700; }

.interactive-card {
  animation: cardIn .45s ease both;
  animation-delay: calc(var(--i, 0) * 0.06s);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-card {
  position: relative;
  overflow: hidden;
  cursor: default;
}
.dash-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #5eead4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.dash-card:hover::before { transform: scaleX(1); }
.dash-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.1);
}
.dash-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  transition: transform .25s ease, background .25s ease;
}
.dash-card:hover .icon {
  transform: scale(1.08);
  background: #99f6e4;
}
.dash-card.module-card {
  cursor: pointer;
  text-align: left;
}
.dash-card.module-card .module-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.dash-card.module-card .mod-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-faint);
  border: 1px solid var(--border);
}
.dash-card.module-card.done .mod-status {
  background: var(--success-light);
  color: var(--success);
  border-color: #a7f3d0;
}
.dash-card.module-card.failed .mod-status {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fca5a5;
}
.dash-card.module-card .mod-status.failed-text,
.dash-card.exam-card .mod-status.failed-text,
html[data-theme="dark"] .dash-card.module-card .mod-status.failed-text,
html[data-theme="dark"] .dash-card.exam-card .mod-status.failed-text {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fca5a5;
}
html[data-theme="dark"] .dash-card.module-card.failed .mod-status {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}
.dash-card.module-card .mini-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
}
.dash-card.module-card .mini-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #2dd4bf);
  border-radius: 99px;
  transition: width .5s ease;
}
.dash-card.module-card.done .mini-bar > i { width: 100%; }
.dash-card.module-card:active { transform: translateY(-1px) scale(0.99); }

.version-card {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.version-card.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.12);
}
.version-card .status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.5);
  animation: pulseDot 1.8s infinite;
  vertical-align: middle;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(15, 118, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

.sidebar-progress .bar-fill {
  background: linear-gradient(90deg, #0f766e, #2dd4bf, #5eead4);
  background-size: 200% 100%;
  animation: shimmer 2.8s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .5s ease;
}
.btn:hover::after { transform: translateX(120%); }
.btn-primary {
  background: linear-gradient(135deg, #1a1a1a 0%, #292524 100%);
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.18);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #292524 0%, #0f766e 140%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.22);
}
.btn-glow {
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.25);
}
.btn-outline:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 12px;
}
.cta-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.modal-overlay {
  animation: fadeOverlay .2s ease;
}
.modal-overlay.active .modal {
  animation: modalPop .28s cubic-bezier(.22,1,.36,1);
}
@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-theme="dark"] .toast {
  background: #0f766e;
  border: 1px solid var(--accent-border);
  color: #fff;
}
html[data-theme="dark"] .toast.success {
  background: #059669;
}
html[data-theme="dark"] .toast.celebrate {
  background: linear-gradient(135deg, #0f766e, #134e4a);
}

.module-view.active {
  animation: fadeSlide .35s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.certificate-wrapper.active {
  animation: fadeSlide .4s ease;
}

.quiz-score .score-num {
  transition: transform .3s ease;
}
.quiz-score:not([style*="display: none"]) .score-num {
  animation: scorePop .45s ease;
}
@keyframes scorePop {
  0% { transform: scale(0.8); opacity: 0.5; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* Confetti burst container */
.confetti-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.2; }
}

@media (max-width: 900px) {
  .page-header-inner { flex-direction: column; }
  .hero-progress-card { width: 100%; }
}
@media (max-width: 768px) {
  .page-header { padding: 24px 20px; }
  .hero-progress-card { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .header-mesh-svg,
  .sidebar-mesh-svg,
  .main-mesh-svg,
  .sidebar-mesh .mesh-lines,
  .main-mesh .mesh-lines,
  .sidebar-mesh .node,
  .main-mesh .node,
  .header-mesh-svg path,
  .header-mesh-svg circle {
    animation: none !important;
  }
}
@media (max-width: 768px) {
  .main-mesh {
    left: 0;
    top: 52px;
  }
}

/* ===== THEME + BOLD PASS V1.2 ===== */
html[data-theme="dark"] {
  --primary: #f5f5f4;
  --primary-soft: #e7e5e4;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-muted: rgba(45, 212, 191, 0.12);
  --accent-border: rgba(45, 212, 191, 0.35);
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.12);
  --info-bg: rgba(56, 189, 248, 0.1);
  --info-border: #38bdf8;
  --bg: #0c0c0c;
  --surface: #161616;
  --surface-2: #1c1c1c;
  --border: #2a2a2a;
  --border-strong: #3f3f3f;
  --text: #f5f5f4;
  --text-secondary: #d6d3d1;
  --text-muted: #a8a29e;
  --text-faint: #78716c;
  /* Sidebar matches dark dashboard surface */
  --sidebar-bg: #0c0c0c;
  --sidebar-text: #a8a29e;
  --sidebar-text-strong: #f5f5f4;
  --sidebar-hover: #161616;
  --sidebar-active: rgba(45, 212, 191, 0.12);
  --sidebar-border: #2a2a2a;
  --sidebar-muted: #78716c;
  --sidebar-chip: #161616;
  color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .page-header {
  background:
    radial-gradient(ellipse 70% 100% at 95% -10%, rgba(45, 212, 191, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 80% at 5% 110%, rgba(56, 189, 248, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #121212 0%, #0c0c0c 100%);
  border-bottom-color: var(--border);
}
html[data-theme="dark"] .page-header h1 {
  background: linear-gradient(135deg, #fafaf9 0%, #e7e5e4 40%, #2dd4bf 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="dark"] .header-mesh-svg {
  opacity: 0.7;
  filter: brightness(1.35) saturate(1.1);
}
html[data-theme="dark"] .sidebar-mesh-svg {
  opacity: 0.75;
  filter: brightness(1.4) saturate(1.15);
}
html[data-theme="dark"] .main-mesh-svg {
  opacity: 0.72;
  filter: brightness(1.35) saturate(1.12);
}
html[data-theme="dark"] .sidebar-header,
html[data-theme="dark"] .sidebar-progress {
  background: color-mix(in srgb, var(--sidebar-bg) 78%, transparent);
}
html[data-theme="dark"] .sidebar-header::before {
  opacity: 0.5;
  filter: brightness(0.85) saturate(0.95);
}
html[data-theme="dark"] .sidebar-header::after {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sidebar-bg) 28%, transparent) 0%,
    color-mix(in srgb, var(--sidebar-bg) 48%, transparent) 42%,
    color-mix(in srgb, var(--sidebar-bg) 78%, transparent) 75%,
    color-mix(in srgb, var(--sidebar-bg) 94%, transparent) 100%
  );
}
html[data-theme="dark"] .hero-progress-card,
html[data-theme="dark"] .page-header .meta span {
  background: rgba(22, 22, 22, 0.9);
  border-color: var(--border);
}
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .version-card,
html[data-theme="dark"] .question,
html[data-theme="dark"] .exam-header,
html[data-theme="dark"] .quiz-score,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .concept-card,
html[data-theme="dark"] .modal {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .content-section p,
html[data-theme="dark"] .content-section li,
html[data-theme="dark"] .dash-card p { color: var(--text-muted); }
html[data-theme="dark"] .compare-table th { background: var(--surface-2); color: var(--text-secondary); }
html[data-theme="dark"] .compare-table td,
html[data-theme="dark"] .compare-table th { border-color: var(--border); }
html[data-theme="dark"] .compare-table tr:nth-child(even) { background: var(--surface-2); }
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%);
  color: #042f2e;
}
html[data-theme="dark"] .btn-outline {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
html[data-theme="dark"] .mobile-topbar {
  background: var(--sidebar-bg);
  border-bottom-color: var(--sidebar-border);
  color: var(--sidebar-text-strong);
}
html[data-theme="dark"] .menu-toggle {
  background: var(--sidebar-chip);
  color: var(--sidebar-text-strong);
}
html[data-theme="dark"] .mobile-home-btn {
  background: var(--sidebar-chip);
  border-color: var(--sidebar-border);
  color: var(--sidebar-text-strong);
}
html[data-theme="dark"] .module-item.active .num {
  color: #042f2e;
}
html[data-theme="dark"] .module-item.completed .num {
  color: #042f2e;
}
html[data-theme="dark"] .mobile-topbar {
  background: var(--sidebar-bg) !important;
  color: var(--sidebar-text-strong);
  border-bottom: 1px solid var(--sidebar-border);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.menu-toggle {
  background: var(--sidebar-chip);
  color: var(--sidebar-text-strong);
  border: 1px solid var(--sidebar-border);
}
.mobile-home-btn {
  background: var(--sidebar-chip);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text-strong);
}
/* Brand + hierarchy */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0f766e, #134e4a);
  color: #ecfdf5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-right: 8px;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}
.sidebar-header h1 {
  font-size: 16px;
  letter-spacing: -0.01em;
}
.dashboard > h2 {
  font-size: 12px;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.module-content h2 {
  font-size: 30px;
  letter-spacing: -0.03em;
}
.module-content .subtitle {
  font-size: 15px;
  margin-bottom: 20px;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}
/* Theme toggle switch (sidebar) - Slide Switch Style */
.theme-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--sidebar-border);
  background: color-mix(in srgb, var(--sidebar-chip) 88%, transparent);
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.theme-switch:hover {
  background: color-mix(in srgb, var(--sidebar-chip) 95%, transparent);
  border-color: var(--accent-border);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.theme-switch-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--sidebar-text-strong);
  transition: color 0.2s ease;
}
.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.theme-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  border: 1px solid var(--sidebar-border);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-switch input:checked + .theme-switch-track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted), inset 0 1px 3px rgba(0, 0, 0, 0.15);
}
.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  transform: translateX(18px);
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.theme-switch input:focus-visible + .theme-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
html[data-theme="dark"] .theme-switch {
  background: color-mix(in srgb, var(--sidebar-chip) 92%, transparent);
}
html[data-theme="dark"] .theme-switch:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Continue learning bar */
.continue-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-border);
  background: linear-gradient(120deg, var(--accent-muted), transparent 70%);
  box-shadow: var(--shadow);
  animation: cardIn .4s ease both;
}
.continue-bar.visible { display: flex; }
.continue-bar .continue-copy strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.continue-bar .continue-copy span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Module checklist */
.module-checklist {
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.module-checklist h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.module-checklist ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.module-checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}
.module-checklist li:first-child { border-top: none; }
.module-checklist .chk {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: var(--transition);
}
.module-checklist li.done .chk {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.module-checklist li.done { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }

/* Empty / locked states */
.empty-state {
  text-align: center;
  padding: 36px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin: 16px 0 24px;
}
.empty-state .empty-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 16px;
  line-height: 1.55;
}

/* Utility links row */
.utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 28px;
}
.utility-links a, .utility-links button.linkish {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-border);
  background: var(--accent-muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.utility-links a:hover, .utility-links button.linkish:hover {
  background: #99f6e4;
  color: #0f766e;
}
html[data-theme="dark"] .utility-links a:hover,
html[data-theme="dark"] .utility-links button.linkish:hover {
  background: rgba(45, 212, 191, 0.2);
  color: #5eead4;
}

/* Hover styles for dark mode - ensure text visibility */
html[data-theme="dark"] .module-item:hover {
  background: color-mix(in srgb, var(--sidebar-hover) 70%, var(--sidebar-bg) 30%);
  color: var(--sidebar-text-strong);
}
html[data-theme="dark"] .question .options label:hover {
  background: rgba(45, 212, 191, 0.18);
  color: var(--text);
}
html[data-theme="dark"] .page-header .meta-link-dashboard:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* Stronger section motion */
.dashboard > h2,
.continue-bar,
.version-path,
.overview-grid,
#moduleCards,
.cta-row {
  animation: fadeSlide .4s ease both;
}
.version-path { animation-delay: .05s; }
.overview-grid { animation-delay: .1s; }
#moduleCards { animation-delay: .15s; }
.cta-row { animation-delay: .2s; }

/* Version card click animation */
.version-card.clicked {
  animation: cardClick 0.4s ease forwards;
}
@keyframes cardClick {
  0% { transform: scale(1); }
  20% { transform: scale(0.96); background: var(--accent-muted); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Locked track cards */
.version-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
  border-color: var(--border);
}
.version-card.locked:hover {
  transform: none;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.version-card.locked .status-dot.locked {
  background: var(--text-faint);
  box-shadow: none;
}
.version-card .status-dot.completed {
  background: var(--accent);
  box-shadow: none;
  animation: none;
}
.version-card.locked .v-tag {
  opacity: 0.7;
}
.version-card.locked h3 {
  color: var(--text-muted);
}
.version-card.locked p {
  color: var(--text-faint);
}

/* Failed module status in sidebar */
.module-item.failed .module-title {
  color: var(--danger);
}
.module-item.failed .module-num {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}
html[data-theme="dark"] .module-item.failed .module-title {
  color: var(--danger);
}
html[data-theme="dark"] .module-item.failed .module-num {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}
