/* ═══════════════════════════════════════════════════════════
   SPR Drone Ground School — Shared Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --navy:    #0a1628;
  --navy-mid:#122040;
  --sky:     #2563c4;
  --amber:   #f59e0b;
  --green:   #16a34a;
  --white:   #ffffff;
  --off:     #f8fafc;
  --border:  #e2e8f0;
  --muted:   #64748b;
  --display: 'Fraunces', serif;
  --mono:    'JetBrains Mono', monospace;
  --body:    'Source Serif 4', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--body); color: #1e293b; background: var(--off); display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOP BAR ── */
.topbar { background: var(--navy); height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; position: sticky; top: 0; z-index: 200; gap: 1rem; }
.topbar-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.topbar-logo-mark { background: var(--sky); color: #fff; font-family: var(--display); font-weight: 700; font-size: .72rem; padding: 3px 7px; border-radius: 5px; }
.topbar-logo-text { color: rgba(255,255,255,.75); font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; }
.topbar-course { color: rgba(255,255,255,.4); font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; border-left: 1px solid rgba(255,255,255,.15); padding-left: 1rem; margin-left: .25rem; }
.topbar-progress { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.topbar-progress-bar { width: 120px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.topbar-progress-fill { height: 100%; background: var(--amber); border-radius: 2px; transition: width .4s ease; width: 0%; }
.topbar-progress-text { font-family: var(--mono); font-size: .68rem; color: rgba(255,255,255,.5); white-space: nowrap; }
.topbar-back { color: rgba(255,255,255,.5); font-family: var(--mono); font-size: .68rem; text-decoration: none; }
.topbar-back:hover { color: #fff; }

/* ── LAYOUT ── */
.course-wrap { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.course-sidebar { width: 240px; background: #fff; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; padding: 1.25rem 0; }
.sidebar-head { padding: .5rem 1.25rem 1rem; }
.sidebar-course-title { font-family: var(--display); font-size: .82rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.sidebar-subtitle { font-family: var(--mono); font-size: .62rem; color: var(--muted); margin-top: 3px; letter-spacing: .04em; text-transform: uppercase; }
.sidebar-module { display: flex; align-items: center; gap: .625rem; padding: .55rem 1.25rem; text-decoration: none; border-left: 3px solid transparent; transition: background .15s; }
.sidebar-module:hover { background: var(--off); }
.sidebar-module.active { border-left-color: var(--sky); background: #eff6ff; }
.sidebar-module.completed { opacity: .65; }
.sm-number { font-family: var(--mono); font-size: .62rem; color: var(--muted); width: 18px; flex-shrink: 0; }
.sm-title { font-size: .82rem; color: #1e293b; line-height: 1.3; flex: 1; }
.sidebar-module.active .sm-title { color: var(--sky); font-weight: 600; }
.sm-meta { display: flex; align-items: center; }
.sm-check { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .55rem; color: transparent; flex-shrink: 0; }
.sm-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.sidebar-divider { height: 1px; background: var(--border); margin: .75rem 1.25rem; }

/* ── MAIN CONTENT ── */
.course-main { flex: 1; overflow-y: auto; padding: 0; }
article.lesson-content { max-width: 760px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }

/* ── LESSON HEADER ── */
.lesson-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.lesson-eyebrow { font-family: var(--mono); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin-bottom: .5rem; }
.lesson-title { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; color: var(--navy); line-height: 1.15; margin-bottom: .75rem; }
.lesson-meta { font-family: var(--mono); font-size: .68rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.lesson-objectives { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 1.1rem 1.25rem; margin-bottom: 2rem; }
.lesson-objectives-title { font-family: var(--mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sky); margin-bottom: .6rem; }
.lesson-objectives ul { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.lesson-objectives li { font-size: .85rem; color: #1e40af; display: flex; gap: .5rem; }
.lesson-objectives li::before { content: '✓'; color: var(--sky); font-size: .75rem; flex-shrink: 0; margin-top: 1px; }

/* ── PROSE ── */
article.lesson-content h2 { font-family: var(--display); font-size: 1.5rem; font-weight: 800; color: var(--navy); margin: 2.5rem 0 .875rem; padding-top: .5rem; border-top: 2px solid var(--border); }
article.lesson-content h3 { font-family: var(--display); font-size: 1.1rem; font-weight: 700; color: var(--navy); margin: 1.75rem 0 .625rem; }
article.lesson-content p { font-size: .975rem; color: #334155; line-height: 1.85; margin-bottom: 1.1rem; }
article.lesson-content strong { color: #1e293b; }
article.lesson-content ul, article.lesson-content ol { margin: .75rem 0 1.1rem 1.5rem; }
article.lesson-content li { font-size: .95rem; color: #334155; line-height: 1.75; margin-bottom: .35rem; }

/* ── CALLOUTS ── */
.callout { border-radius: 10px; padding: 1.1rem 1.25rem; margin: 1.5rem 0; }
.callout-warning { background: #fef3c7; border-left: 4px solid #f59e0b; }
.callout-warning .callout-title { font-family: var(--mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; color: #92400e; margin-bottom: .4rem; letter-spacing: .06em; }
.callout-warning p { color: #78350f; font-size: .9rem; margin: 0; }
.callout-danger { background: #fee2e2; border-left: 4px solid #dc2626; }
.callout-danger .callout-title { font-family: var(--mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; color: #991b1b; margin-bottom: .4rem; }
.callout-danger p { color: #7f1d1d; font-size: .9rem; margin: 0; }
.callout-info { background: #eff6ff; border-left: 4px solid var(--sky); }
.callout-info .callout-title { font-family: var(--mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; color: #1e40af; margin-bottom: .4rem; }
.callout-info p { color: #1e3a8a; font-size: .9rem; margin: 0; }
.callout-success { background: #f0fdf4; border-left: 4px solid var(--green); }
.callout-success .callout-title { font-family: var(--mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; color: #14532d; margin-bottom: .4rem; }
.callout-success p { color: #14532d; font-size: .9rem; margin: 0; }

/* ── DATA TABLES ── */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .875rem; }
.data-table th { background: var(--navy); color: #fff; padding: .625rem .875rem; text-align: left; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.data-table td { padding: .6rem .875rem; border-bottom: 1px solid var(--border); color: #334155; }
.data-table tr:nth-child(even) td { background: var(--off); }
.data-table tr:hover td { background: #eff6ff; }

/* ── IMAGES ── */
.article-image { margin: 2rem 0; text-align: center; }
.article-image img { max-width: 100%; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.12); display: block; margin: 0 auto; }
.article-image p { font-size: .72rem; color: var(--muted); margin-top: .5rem; font-style: italic; }

/* ── REFERENCES ── */
.ref-block { background: var(--off); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; margin: 2rem 0; }
.ref-block-label { font-family: var(--mono); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .625rem; }
.ref-link { display: inline-block; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-family: var(--mono); font-size: .68rem; color: var(--sky); text-decoration: none; margin: 2px; }
.ref-link:hover { background: #eff6ff; }

/* ── QUIZ ── */
#quiz-container { margin-top: 2rem; }
.quiz-question { background: var(--navy-mid); border-radius: 14px; padding: 1.5rem; margin-bottom: 1rem; }
.qq-num { font-family: var(--mono); font-size: .65rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.qq-text { font-family: var(--display); font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.4; margin-bottom: 1rem; }
.qq-options { display: flex; flex-direction: column; gap: .5rem; }
.qq-option { display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: .75rem 1rem; cursor: pointer; text-align: left; color: rgba(255,255,255,.85); font-size: .9rem; transition: background .15s; }
.qq-option:hover:not(.disabled) { background: rgba(255,255,255,.12); }
.qq-option.correct { background: rgba(74,222,128,.15); border-color: #4ade80; color: #4ade80; }
.qq-option.incorrect { background: rgba(248,113,113,.15); border-color: #f87171; color: #f87171; }
.qq-option.show-correct { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.5); }
.qq-option.disabled { cursor: default; pointer-events: none; }
.qq-letter { background: rgba(255,255,255,.1); border-radius: 5px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.qq-explanation { display: none; background: rgba(255,255,255,.06); border-radius: 8px; padding: .75rem 1rem; margin-top: .75rem; font-size: .875rem; color: rgba(255,255,255,.7); line-height: 1.6; }
.qq-explanation.show { display: block; }
.quiz-btn { padding: .75rem 1.5rem; border-radius: 9px; font-family: var(--display); font-weight: 700; font-size: .9rem; cursor: pointer; border: none; transition: opacity .15s; }
.quiz-btn-submit { display: block; width: 100%; background: var(--amber); color: var(--navy); margin-top: 1rem; }
.quiz-btn-submit:disabled { opacity: .35; cursor: not-allowed; }
.quiz-btn-retry { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.2); }
.quiz-btn-next { background: #4ade80; color: var(--navy); }
.quiz-score-panel { display: none; text-align: center; padding: 2rem; background: var(--navy-mid); border-radius: 14px; margin-top: 1rem; }
.quiz-score-panel.show { display: block; }
.score-num { font-family: var(--display); font-size: 3rem; font-weight: 900; }
.score-label { font-family: var(--mono); font-size: .75rem; color: rgba(255,255,255,.5); margin: .25rem 0 .75rem; }
.score-msg { font-size: .9rem; color: rgba(255,255,255,.7); margin-bottom: 1rem; line-height: 1.6; }

/* ── LESSON NAV ── */
.lesson-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 2rem; background: #fff; border-top: 1px solid var(--border); position: sticky; bottom: 0; z-index: 50; }
.lesson-nav-btn { font-family: var(--display); font-weight: 700; font-size: .88rem; padding: .625rem 1.25rem; border-radius: 9px; cursor: pointer; text-decoration: none; border: none; }
.btn-prev { background: var(--off); border: 1px solid var(--border); color: var(--muted); }
.btn-prev:hover { border-color: var(--sky); color: var(--sky); }
.btn-complete { background: var(--sky); color: #fff; }
.btn-complete:hover { background: #1d4ed8; }

/* ── MOBILE ── */
#sidebar-toggle { display: none; background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; padding: 4px; }
@media (max-width: 860px) {
  #sidebar-toggle { display: flex; }
  .course-sidebar { position: fixed; left: -240px; top: 52px; bottom: 0; z-index: 150; transition: left .25s; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .course-sidebar.open { left: 0; }
  .topbar-course { display: none; }
}
@media (max-width: 600px) {
  article.lesson-content { padding: 1.5rem 1rem 3rem; }
  .lesson-nav { padding: 1rem; gap: .5rem; }
  .lesson-nav-btn { font-size: .8rem; padding: .5rem 1rem; }
}

/* ── YOUTUBE EMBEDS ── */
.yt-embed-wrap { margin: 2rem 0; }
.yt-embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.yt-embed-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.yt-embed-desc { font-size: .78rem; color: var(--muted); margin-top: .5rem; text-align: center; font-style: italic; }
