/* ═══════════════════════════════════════════════════════════
   AI Systems Landscape 2026 — Shared Components
   ═══════════════════════════════════════════════════════════ */

/* ── BOTTOM PREV/NEXT NAV ── */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  gap: 16px;
}
.chapter-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text, #e6edf3);
  padding: 14px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
  max-width: 45%;
}
.chapter-nav a:hover {
  border-color: var(--accent);
  background: var(--glow);
}
.chapter-nav a small {
  display: block;
  color: var(--text2);
  font-size: 0.75rem;
  font-weight: 400;
}
.chapter-nav .home-link {
  color: var(--accent);
  font-size: 0.85rem;
}

/* ── DID YOU KNOW ── */
.did-you-know-section { margin: 40px 0; padding: 24px; background: linear-gradient(135deg, var(--glow), rgba(168,184,124,0.06)); border: 1px solid var(--border); border-radius: 14px; }
.did-you-know-section h3 { color: var(--accent2); font-size: 1.2rem; margin-bottom: 16px; }
.dyk-container { display: grid; gap: 12px; }
.dyk-card { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; transition: border-color 0.2s; }
.dyk-card:hover { border-color: var(--accent); }
.dyk-card p { color: var(--text2); font-size: 0.9rem; line-height: 1.6; margin: 0; }

/* ── KNOWLEDGE QUIZ ── */
.quiz-section { margin: 40px 0; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.quiz-section h3 { color: var(--accent3); font-size: 1.2rem; margin-bottom: 4px; }
.quiz-subtitle { color: var(--text2); font-size: 0.88rem; margin-bottom: 24px; }
.quiz-question { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.quiz-question:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.quiz-q { color: var(--text); font-size: 0.95rem; margin-bottom: 12px; line-height: 1.5; }
.quiz-option { display: block; width: 100%; text-align: left; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; color: var(--text2); font-size: 0.88rem; cursor: pointer; margin-bottom: 8px; transition: all 0.2s; }
.quiz-option:hover:not(.correct):not(.wrong) { border-color: var(--accent); color: var(--text); background: var(--glow); }
.quiz-option.correct { background: rgba(63,185,80,0.15); border-color: var(--accent2); color: var(--accent2); }
.quiz-option.wrong { background: rgba(255,123,114,0.1); border-color: var(--accent5); color: var(--accent5); }
.quiz-option.disabled { pointer-events: none; opacity: 0.6; }
.quiz-feedback { font-size: 0.85rem; margin-top: 8px; font-weight: 600; }
.quiz-score { text-align: center; font-size: 1rem; color: var(--accent2); font-weight: 700; margin-top: 16px; }

/* ── READING PROGRESS BAR ── */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--progress-gradient); z-index: 9999; width: 0%; transition: width 0.1s; }

/* ── SCROLL TO TOP ── */
.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: 1.2rem; cursor: pointer; display: none; z-index: 900; box-shadow: 0 4px 16px rgba(0,0,0,0.3); transition: all 0.2s; }
.scroll-top:hover { transform: scale(1.1); background: var(--accent3); }
.scroll-top.visible { display: flex; align-items: center; justify-content: center; }

/* ── READING TIME ── */
.reading-time { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); font-size: 0.82rem; margin-top: 8px; }

/* ═══════════════════════════════════════════════════════════
   Shared Styles — used by index.html + ALL chapter pages
   ═══════════════════════════════════════════════════════════ */

/* ── INFOGRAPHICS TAB ── */
.gif-gallery { display: flex; flex-direction: column; gap: 48px; margin-top: 24px; }
.gif-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.gif-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}
.gif-card img {
  width: 100%;
  max-width: 1200px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.gif-card .gif-caption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text2);
}

/* ── DEEP-DIVE NARRATIVE ── */
.deep-dive {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 24px 28px;
  margin-top: 32px;
}
.deep-dive-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 28px;
  transition: all 0.2s;
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
  gap: 8px;
}
.deep-dive-toggle:hover {
  background: var(--glow);
  border-color: var(--accent);
}
.deep-dive-toggle .arrow {
  transition: transform 0.3s;
  display: inline-block;
}
.deep-dive-toggle.open .arrow {
  transform: rotate(90deg);
}
.deep-dive.collapsed {
  display: none;
}
.deep-dive h3 {
  color: var(--accent2);
  font-size: 1.2rem;
  margin: 24px 0 10px;
}
.deep-dive h3:first-child {
  margin-top: 0;
}
.deep-dive h4 {
  color: var(--accent3);
  font-size: 1.05rem;
  margin: 18px 0 8px;
}
.deep-dive p {
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 12px;
}
.deep-dive strong {
  color: var(--text);
}
.deep-dive ul, .deep-dive ol {
  color: var(--text2);
  padding-left: 24px;
  margin-bottom: 14px;
}
.deep-dive li {
  margin-bottom: 6px;
  line-height: 1.65;
}
.deep-dive table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}
.deep-dive th {
  background: var(--surface2);
  color: var(--accent);
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 600;
}
.deep-dive td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text2);
}
.deep-dive tr:hover td {
  background: rgba(201,168,76,0.04);
}
.deep-dive code {
  background: var(--surface2);
  color: var(--accent3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}
.deep-dive pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 14px 0;
}
.deep-dive pre code {
  background: none;
  padding: 0;
  color: var(--text);
}
.deep-dive blockquote {
  border-left: 3px solid var(--accent3);
  padding: 12px 20px;
  margin: 14px 0;
  background: rgba(184,160,210,0.05);
  border-radius: 0 6px 6px 0;
}
.deep-dive blockquote p {
  color: var(--accent3);
  margin-bottom: 0;
}
.deep-dive hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── CROSS REFERENCES ── */
.cross-refs {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.cross-refs h3 {
  color: var(--accent4);
  margin-bottom: 12px;
}
.cross-refs a {
  display: inline-block;
  color: var(--accent);
  background: var(--surface2);
  padding: 6px 14px;
  border-radius: 6px;
  margin: 4px 6px 4px 0;
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.cross-refs a:hover {
  border-color: var(--accent);
  background: var(--glow);
}

/* ── BACK NAVIGATION ── */
.back-to-hub {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.back-to-hub:hover {
  background: var(--glow);
  border-color: var(--accent);
  transform: translateX(-2px);
}
.back-to-hub .back-arrow { font-size: 1rem; }

/* ── SCROLL TO TOP (chapter variant) ── */
.scroll-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: all 0.2s;
}
.scroll-to-top:hover {
  background: var(--glow);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.scroll-to-top.visible { display: flex; }

/* ── COLOR UTILITIES ── */
.c-blue { color: var(--accent); }
.c-green { color: var(--accent2); }
.c-purple { color: var(--accent3); }
.c-orange { color: var(--accent4); }
.c-red { color: var(--accent5); }
.c-cyan { color: var(--accent6); }
.bg-blue { background: rgba(201,168,76,0.10); }
.bg-green { background: rgba(168,184,124,0.10); }
.bg-purple { background: rgba(184,160,210,0.10); }
.bg-orange { background: rgba(201,149,106,0.10); }
.bg-red { background: rgba(201,138,130,0.10); }
.bg-cyan { background: rgba(121,192,255,0.12); }
.b-blue { border-color: var(--accent) !important; }
.b-green { border-color: var(--accent2) !important; }
.b-purple { border-color: var(--accent3) !important; }
.b-orange { border-color: var(--accent4) !important; }
.b-red { border-color: var(--accent5) !important; }
.b-cyan { border-color: var(--accent6) !important; }
