/* Battery Optimizer Learning — Shared Lesson Stylesheet */

:root {
  --bg: #fafafa;
  --bg-alt: #f0f4f8;
  --text: #1a202c;
  --text-muted: #4a5568;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warn: #d97706;
  --warn-light: #fef3c7;
  --error: #dc2626;
  --error-light: #fee2e2;
  --border: #e2e8f0;
  --radius: 6px;
  --font-body: 'Georgia', serif;
  --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --max-width: 720px;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding: 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.3; }
h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }

/* Links */
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}
pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

/* Lesson metadata */
.lesson-meta {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Callout boxes */
.callout {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
}
.callout.warn {
  border-left-color: var(--warn);
  background: var(--warn-light);
}
.callout.success {
  border-left-color: var(--success);
  background: var(--success-light);
}
.callout.error {
  border-left-color: var(--error);
  background: var(--error-light);
}
.callout p:last-child { margin-bottom: 0; }

/* Quiz */
.quiz {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-alt);
}
.quiz-question {
  font-weight: 600;
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
}
.quiz-options { list-style: none; padding-left: 0; }
.quiz-options li {
  padding: 0.6rem 1rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}
.quiz-options li:hover { background: var(--accent-light); border-color: var(--accent); }
.quiz-options li.correct { background: var(--success-light); border-color: var(--success); }
.quiz-options li.incorrect { background: var(--error-light); border-color: var(--error); }
.quiz-options li.disabled { pointer-events: none; opacity: 0.7; }
.quiz-feedback {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: var(--success-light); color: #166534; }
.quiz-feedback.incorrect { background: var(--error-light); color: #991b1b; }

/* Navigation footer */
.lesson-nav {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

/* Recommended reading */
.reading-rec {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.reading-rec h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Ask your teacher */
.ask-teacher {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 2rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

/* Print styles */
@media print {
  body { padding: 0; max-width: 100%; }
  pre { white-space: pre-wrap; }
  .quiz-options li { break-inside: avoid; }
  .lesson-nav { display: none; }
}
