/* ============================================
   teach.logging.top — Shared Math Lesson Styles
   Dark theme, warm orange accent
   ============================================ */
:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --accent: #f97316;
  --accent2: #f59e0b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  padding: 20px;
}
.container { max-width: 740px; margin: 0 auto; }

/* Header */
.header {
  text-align: center;
  padding: 30px 0 20px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 30px;
}
.header h1 {
  font-size: 1.6em;
  color: var(--accent);
  margin-bottom: 8px;
}
.header .subtitle { color: var(--text-muted); font-size: 0.9em; }
.header .lesson-num {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75em;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.progress-bar {
  margin-top: 15px;
  height: 4px;
  background: #2d2d4e;
  border-radius: 2px;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Sections */
.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.section h2 {
  color: var(--accent);
  font-size: 1.2em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h2 .icon { font-size: 1.3em; }
.section h3 {
  color: var(--accent2);
  font-size: 1.05em;
  margin: 16px 0 10px;
}
.section p { margin-bottom: 12px; color: #cbd5e1; }
.section ul, .section ol { margin: 10px 0 10px 20px; color: #cbd5e1; }
.section li { margin-bottom: 8px; }

/* Code/math blocks */
.math-block {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  font-family: "Courier New", monospace;
  font-size: 1.05em;
  color: #f1f5f9;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.math-inline {
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  color: #fbbf24;
  font-size: 0.95em;
}

/* Highlight boxes */
.highlight-box {
  border-left: 4px solid var(--accent);
  background: rgba(249, 115, 22, 0.08);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
}
.highlight-box.green { border-left-color: var(--green); background: rgba(34, 197, 94, 0.08); }
.highlight-box.blue { border-left-color: var(--blue); background: rgba(59, 130, 246, 0.08); }
.highlight-box.purple { border-left-color: #a855f7; background: rgba(168, 85, 247, 0.08); }

/* Key term */
.term {
  display: inline-block;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 600;
  border-bottom: 2px solid rgba(249, 115, 22, 0.3);
}

/* Step indicators */
.steps {
  counter-reset: step;
  margin: 14px 0;
}
.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.03);
  padding: 12px 16px;
  border-radius: 8px;
}
.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 700;
}

/* Comparison table */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.compare .card {
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
}
.compare .card .label { font-size: 1.2em; font-weight: 700; margin-bottom: 6px; }
.compare .card .desc { font-size: 0.88em; color: var(--text-muted); }

/* Quiz */
.quiz { margin-top: 20px; }
.quiz .question {
  font-weight: 600;
  margin-bottom: 12px;
  color: #f1f5f9;
}
.quiz .options { display: flex; flex-direction: column; gap: 8px; }
.quiz .option {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95em;
  color: var(--text);
}
.quiz .option:hover { background: rgba(249, 115, 22, 0.1); border-color: var(--accent); }
.quiz .option.correct {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--green);
  color: var(--green);
}
.quiz .option.wrong {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--red);
  color: var(--red);
}
.quiz .feedback {
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  display: none;
  font-size: 0.9em;
}
.quiz .feedback.show { display: block; }
.quiz .feedback.correct { background: rgba(34, 197, 94, 0.1); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.quiz .feedback.wrong { background: rgba(239, 68, 68, 0.1); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Takeaway */
.takeaway {
  background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(245,158,11,0.1));
  border: 1px solid rgba(249,115,22,0.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.takeaway h3 { color: var(--accent); margin-bottom: 10px; }
.takeaway ol, .takeaway ul { margin-left: 18px; color: #cbd5e1; }
.takeaway li { margin-bottom: 6px; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
th { color: var(--accent); font-weight: 600; font-size: 0.9em; }
td { color: #cbd5e1; font-size: 0.93em; }

/* Tip */
.tip {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 20px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  text-align: center;
}

/* Bottom nav */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9em;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Diagrams */
.diagram {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 20px;
  margin: 14px 0;
  text-align: center;
  font-family: "Courier New", monospace;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
}
.diagram .highlight { color: var(--accent); font-weight: 700; }
.diagram .arrow { color: var(--green); }
.diagram .label { color: var(--text-muted); font-size: 0.85em; }

/* Responsive */
@media (max-width: 500px) {
  .compare { grid-template-columns: 1fr; }
  .step-item { flex-direction: column; align-items: flex-start; }
}
