/* ═══════════════════════════════════════════════════════════
   StackSimplified — AWS IAM Learning Portal
   Global Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ─── Design Tokens: Light Theme ─── */
:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #1e293b;
  --text-dim: #475569;
  --text-muted: #94a3b8;
  --aws-orange: #FF9900;
  --aws-orange-soft: #fff4e6;
  --aws-orange-border: #ffe0b2;
  --aws-dark: #232F3E;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --success: #10b981;
  --success-soft: #d1fae5;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}


/* ─── Design Tokens: Dark Theme ─── */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --bg-muted: #334155;
  --border: #334155;
  --border-light: #1e293b;
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --text-muted: #64748b;
  --aws-orange-soft: rgba(255,153,0,0.1);
  --aws-orange-border: rgba(255,153,0,0.3);
  --accent-soft: rgba(14,165,233,0.1);
  --purple-soft: rgba(124,58,237,0.1);
  --success-soft: rgba(16,185,129,0.1);
  --danger-soft: rgba(239,68,68,0.1);
  --warn-soft: rgba(245,158,11,0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
}


/* ─── Base Reset & Typography ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
#root { min-height: 100vh; }
code, .mono { font-family: 'JetBrains Mono', monospace; }
a { color: var(--aws-orange); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
::selection { background: rgba(255,153,0,0.2); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }


/* ─── Container ─── */
.container { max-width: 780px; margin: 0 auto; padding: 0 24px; width: 100%; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ─── Navbar ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: background 0.3s;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #FF9900, #ff7b00);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 16px;
  box-shadow: 0 4px 14px rgba(255,153,0,0.3);
}
.brand .logo-text { font-size: 16px; font-weight: 800; color: var(--text); }
.brand .logo-text span { color: var(--aws-orange); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-soft); display: grid; place-items: center; font-size: 16px;
  cursor: pointer; transition: all 0.2s;
}
.theme-toggle:hover { background: var(--bg-muted); border-color: var(--aws-orange); transform: scale(1.05); }


/* ─── Breadcrumbs ─── */
.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin-left: 16px;
  min-width: 0; overflow: hidden;
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.breadcrumbs a:hover { color: var(--aws-orange); text-decoration: none; }
.breadcrumbs .sep { opacity: 0.5; flex-shrink: 0; }
.breadcrumbs .current {
  color: var(--text-dim); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.breadcrumbs .section-crumb {
  color: var(--text-muted); font-weight: 500; max-width: 200px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Progress Bar (reading progress) ─── */
.reading-progress {
  position: fixed; top: 64px; left: 0; right: 0; height: 3px;
  z-index: 99; background: transparent;
}
.reading-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--aws-orange), #ff7b00);
  transition: width 0.1s linear; border-radius: 0 2px 2px 0;
}


/* ─── Landing Page ─── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  background: var(--aws-orange-soft); border: 1px solid var(--aws-orange-border); color: var(--aws-orange);
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(36px, 5.5vw, 64px); font-weight: 900; line-height: 1.08;
  letter-spacing: -1.5px; color: var(--text); margin-bottom: 18px;
}
.hero-title span { color: var(--aws-orange); }
.hero-sub { font-size: 18px; line-height: 1.7; color: var(--text-dim); max-width: 600px; margin: 0 auto 28px; }
.cta-btn {
  padding: 14px 28px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #FF9900, #ff7b00); color: #fff;
  font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,153,0,0.3); transition: all 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,153,0,0.4); }


/* ─── Landing: Stats Bar ─── */
.stats-bar {
  display: flex; justify-content: center; gap: 32px; margin: 32px 0 48px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-value { font-size: 24px; font-weight: 900; color: var(--aws-orange); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ─── Landing: Roadmap ─── */
.roadmap-section { margin: 48px 0; }
.roadmap-title {
  font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 8px;
}
.roadmap-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 24px; }
.roadmap-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.roadmap-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all 0.2s; position: relative;
}
.roadmap-item:hover { border-color: var(--aws-orange-border); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.roadmap-item.active { border-color: var(--aws-orange); background: var(--aws-orange-soft); }
.roadmap-item.locked { opacity: 0.6; cursor: default; }
.roadmap-item.locked:hover { transform: none; box-shadow: none; }
.roadmap-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--bg-muted); color: var(--text-dim); border: 1px solid var(--border);
}
.roadmap-item.active .roadmap-num { background: var(--aws-orange); color: #fff; border-color: var(--aws-orange); }
.roadmap-item-text { font-size: 13px; font-weight: 600; color: var(--text); }
.roadmap-item .lock-icon { position: absolute; top: 8px; right: 8px; font-size: 10px; opacity: 0.5; }


/* ─── Landing: Chapter Cards ─── */
.chapters-heading { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.chapter-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-item {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all 0.25s; box-shadow: var(--shadow-sm);
}
.chapter-item:hover { border-color: var(--aws-orange-border); box-shadow: var(--shadow-md); transform: translateX(4px); }
.chapter-item-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: var(--aws-orange-soft); border: 1px solid var(--aws-orange-border); flex-shrink: 0;
}
.chapter-item-body { flex: 1; }
.chapter-item-body h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.chapter-item-body p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.chapter-item-meta {
  display: flex; gap: 8px; align-items: center; margin-top: 6px;
}
.chapter-item-arrow { font-size: 18px; color: var(--aws-orange); font-weight: 700; }
.footer { text-align: center; margin-top: 60px; color: var(--text-muted); font-size: 13px; }
.footer strong { color: var(--aws-orange); }


/* ─── Badges (difficulty, time, module) ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.3px;
}
.badge-beginner { background: var(--success-soft); color: var(--success); border: 1px solid #a7f3d0; }
.badge-intermediate { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }
.badge-advanced { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.badge-time { background: var(--bg-muted); color: var(--text-dim); border: 1px solid var(--border); }
.badge-module { background: var(--accent-soft); color: var(--accent); border: 1px solid #bae6fd; }
.badge-cli { background: var(--aws-orange-soft); color: var(--aws-orange); border: 1px solid var(--aws-orange-border); }


/* ─── Chapter Layout ─── */
.layout-with-nav { display: flex; min-height: calc(100vh - 64px); }
.chapter-sidebar {
  position: sticky; top: 64px; height: calc(100vh - 64px);
  width: 280px; min-width: 280px; padding: 16px 12px; overflow-y: auto;
  border-right: 1px solid var(--border); background: var(--bg-soft); transition: background 0.3s;
  display: flex; flex-direction: column;
}

/* Sidebar: Home Button */
.sidebar-home-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  text-decoration: none; border: 1px solid var(--border); background: var(--bg);
  transition: all 0.2s;
}
.sidebar-home-btn:hover { color: var(--aws-orange); border-color: var(--aws-orange-border); background: var(--aws-orange-soft); text-decoration: none; }

/* Sidebar: Chapters list */
.sidebar-chapters { flex: 1; overflow-y: auto; }
.sidebar-chapter-group { margin-bottom: 2px; }
.sidebar-chapter-group.current { }

/* Chapter header row */
.sidebar-chapter-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.sidebar-chapter-header:hover { background: var(--bg-muted); }
.sidebar-chapter-header.active {
  background: var(--aws-orange-soft); color: var(--aws-orange);
}
.sidebar-chapter-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
  background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border);
}
.sidebar-chapter-header.active .sidebar-chapter-num {
  background: var(--aws-orange); color: #fff; border-color: var(--aws-orange);
}
.sidebar-chapter-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); flex: 1;
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-chapter-header.active .sidebar-chapter-title { color: var(--aws-orange); font-weight: 700; }
.sidebar-chapter-arrow {
  font-size: 9px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0;
}
.sidebar-chapter-arrow.open { transform: rotate(90deg); }
.sidebar-chapter-header.active .sidebar-chapter-arrow { color: var(--aws-orange); }

/* Section links inside expanded chapter */
.sidebar-sections-list {
  padding: 4px 0 8px 20px; margin-left: 10px;
  border-left: 2px solid var(--border);
}
.sidebar-sec-link {
  display: block; padding: 5px 12px; margin-bottom: 1px;
  font-size: 11.5px; color: var(--text-muted); line-height: 1.4;
  text-decoration: none; border-radius: 4px; transition: all 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-sec-link:hover { color: var(--text); background: var(--bg-muted); text-decoration: none; }
.sidebar-sec-link.active {
  color: var(--aws-orange); font-weight: 600; background: var(--aws-orange-soft);
}

/* Sidebar: Next chapter button */
.sidebar-next-chapter {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}
.sidebar-next-btn {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  text-decoration: none; background: var(--bg); border: 1px solid var(--border);
  transition: all 0.2s;
}
.sidebar-next-btn:hover { border-color: var(--aws-orange-border); background: var(--aws-orange-soft); text-decoration: none; }
.sidebar-next-btn span:first-child {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
}
.sidebar-next-title {
  font-size: 12.5px; font-weight: 700; color: var(--aws-orange);
}


/* ─── Chapter Content ─── */
.chapter-content { flex: 1; min-width: 0; padding: 48px 56px 120px; max-width: 860px; }
.chapter-badge {
  display: inline-flex; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 1.5px;
  color: var(--aws-orange); background: var(--aws-orange-soft); border: 1px solid var(--aws-orange-border);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; font-weight: 600;
}
.chapter-title { font-size: clamp(26px, 3.5vw, 36px); font-weight: 900; color: var(--text); margin-bottom: 10px; }
.chapter-overview { font-size: 16px; line-height: 1.8; color: var(--text-dim); margin-bottom: 24px; max-width: 700px; }

/* ─── Chapter Meta Bar ─── */
.chapter-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}

/* ─── Learning Objectives ─── */
.learning-objectives {
  padding: 24px; border-radius: var(--radius); margin-bottom: 40px;
  background: var(--accent-soft); border: 1px solid #bae6fd;
}
[data-theme="dark"] .learning-objectives { border-color: rgba(14,165,233,0.3); }
.learning-objectives h3 {
  font-size: 14px; font-weight: 800; color: var(--accent); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.learning-objectives ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.learning-objectives li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--text-dim); line-height: 1.6;
}
.learning-objectives li::before { content: '🎯'; flex-shrink: 0; }


/* ─── Sections ─── */
.section { margin-bottom: 56px; scroll-margin-top: 80px; }
.section-heading { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.section-intro { font-size: 15px; line-height: 1.8; color: var(--text-dim); margin-bottom: 20px; max-width: 700px; }

/* ─── Cards ─── */
.cards { display: grid; gap: 14px; margin: 20px 0; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  padding: 22px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); box-shadow: var(--shadow-sm); transition: all 0.25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--aws-orange-border); }
.card .card-icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--aws-orange-soft), rgba(255,153,0,0.02));
  border: 1px solid var(--aws-orange-border);
}
.card h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.card p { font-size: 13px; line-height: 1.7; color: var(--text-dim); }


/* ─── Diagram / Flow ─── */
.diagram {
  padding: 32px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-soft); margin: 20px 0; box-shadow: var(--shadow-sm);
}
.flow { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 16px 0; }
.flow-node {
  padding: 16px 20px; border-radius: 12px; text-align: center; min-width: 130px;
  border: 1.5px solid var(--border); background: var(--bg); cursor: pointer;
  transition: all 0.25s; box-shadow: var(--shadow-sm);
}
.flow-node:hover { transform: scale(1.05); border-color: var(--aws-orange); box-shadow: var(--shadow-md); }
.flow-node.active { border-color: var(--aws-orange); background: var(--aws-orange-soft); box-shadow: 0 4px 16px rgba(255,153,0,0.15); }
.flow-node .fi { font-size: 24px; margin-bottom: 6px; }
.flow-node .ft { font-weight: 700; font-size: 13px; color: var(--text); }
.flow-node .fs { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.flow-arrow { color: var(--aws-orange); font-size: 20px; font-weight: 800; animation: pulse 1.8s infinite ease-in-out; }
@keyframes pulse { 0%,100%{opacity:.4;transform:translateX(0)} 50%{opacity:1;transform:translateX(4px)} }
.node-detail {
  margin-top: 16px; padding: 16px 20px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--aws-orange-border);
  font-size: 14px; line-height: 1.8; color: var(--text-dim); box-shadow: var(--shadow-sm);
}
.node-detail strong { color: var(--text); }
.diagram-hint { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 12px; font-family: 'JetBrains Mono', monospace; }


/* ─── Code Block (basic) ─── */
pre.code {
  background: var(--aws-dark); color: #e2e8f0; border-radius: var(--radius);
  padding: 20px 22px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  line-height: 1.75; overflow-x: auto; margin: 18px 0; border: 1px solid rgba(255,255,255,0.05);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] pre.code { background: #0b1426; border-color: #1e293b; }

/* ─── CLI Block (enhanced code with copy button) ─── */
.cli-block {
  position: relative; margin: 20px 0; border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm);
}
.cli-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--aws-dark); border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cli-header-left { display: flex; align-items: center; gap: 8px; }
.cli-dots {
  display: flex; gap: 5px;
}
.cli-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.cli-dots span:nth-child(1) { background: #ef4444; }
.cli-dots span:nth-child(2) { background: #f59e0b; }
.cli-dots span:nth-child(3) { background: #10b981; }
.cli-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: #94a3b8; font-weight: 600;
}
.cli-copy-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05); color: #94a3b8; font-size: 11px;
  font-family: 'JetBrains Mono', monospace; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
}
.cli-copy-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: var(--aws-orange); }
.cli-copy-btn.copied { color: var(--success); border-color: var(--success); }
.cli-body {
  padding: 18px 20px; background: var(--aws-dark);
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  line-height: 1.8; color: #e2e8f0; overflow-x: auto; white-space: pre;
}
[data-theme="dark"] .cli-body { background: #0b1426; }
[data-theme="dark"] .cli-header { background: #0a0f1e; }


/* ─── CLI Syntax Highlighting ─── */
.cli-body .cli-comment { color: #64748b; font-style: italic; }
.cli-body .cli-command { color: #7dd3fc; }
.cli-body .cli-flag { color: #c4b5fd; }
.cli-body .cli-string { color: #86efac; }
.cli-body .cli-output { color: #94a3b8; }
.cli-body .cli-json-key { color: #fcd34d; }
.cli-body .cli-json-value { color: #86efac; }
.cli-body .cli-prompt { color: #f59e0b; user-select: none; }

/* ─── Expandable Section ─── */
.expandable {
  margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all 0.2s;
}
.expandable:hover { border-color: var(--aws-orange-border); }
.expandable-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; cursor: pointer; background: var(--bg-soft);
  transition: background 0.2s; user-select: none;
}
.expandable-header:hover { background: var(--bg-muted); }
.expandable-icon {
  font-size: 12px; color: var(--aws-orange); transition: transform 0.2s;
  width: 20px; text-align: center;
}
.expandable-icon.open { transform: rotate(90deg); }
.expandable-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.expandable-badge { margin-left: auto; }
.expandable-body {
  padding: 20px; border-top: 1px solid var(--border); background: var(--bg);
}


/* ─── Tabs ─── */
.tabs { margin: 20px 0; }
.tab-list {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--aws-orange); border-bottom-color: var(--aws-orange); }
.tab-panel { padding: 20px 0; }

/* ─── Callout ─── */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 20px; border-radius: var(--radius); margin: 18px 0;
  font-size: 14px; line-height: 1.75;
}
.callout-info { background: var(--accent-soft); border: 1px solid #bae6fd; color: #0369a1; }
.callout-success { background: var(--success-soft); border: 1px solid #a7f3d0; color: #047857; }
.callout-warn { background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; }
.callout-danger { background: var(--danger-soft); border: 1px solid #fecaca; color: #b91c1c; }
.callout-myth { background: var(--purple-soft); border: 1px solid #c4b5fd; color: #5b21b6; }
.callout-exam { background: var(--aws-orange-soft); border: 1px solid var(--aws-orange-border); color: #92400e; }
[data-theme="dark"] .callout-info { color: #7dd3fc; border-color: rgba(14,165,233,0.3); }
[data-theme="dark"] .callout-success { color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
[data-theme="dark"] .callout-warn { color: #fcd34d; border-color: rgba(245,158,11,0.3); }
[data-theme="dark"] .callout-danger { color: #fca5a5; border-color: rgba(239,68,68,0.3); }
[data-theme="dark"] .callout-myth { color: #c4b5fd; border-color: rgba(124,58,237,0.3); }
[data-theme="dark"] .callout-exam { color: #fcd34d; border-color: rgba(255,153,0,0.3); }


/* ─── Points List ─── */
.points { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.points li {
  display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.75; color: var(--text-dim);
}
.points li .bullet {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--success-soft); border: 1px solid #a7f3d0;
  display: grid; place-items: center; font-size: 11px; color: var(--success); font-weight: 800; margin-top: 2px;
}

/* ─── Interview Questions ─── */
.interview-section { margin: 24px 0; }
.interview-section h3 {
  font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.interview-question {
  margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.interview-q-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; background: var(--bg-soft);
  transition: background 0.2s;
}
.interview-q-header:hover { background: var(--bg-muted); }
.interview-q-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
  background: var(--aws-orange-soft); color: var(--aws-orange); border: 1px solid var(--aws-orange-border);
}
.interview-q-text { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.interview-q-diff {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.interview-q-toggle { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; }
.interview-q-toggle.open { transform: rotate(90deg); }
.interview-answer {
  padding: 16px 18px; border-top: 1px solid var(--border); background: var(--bg);
  font-size: 14px; line-height: 1.8; color: var(--text-dim);
}


/* ─── Quiz / Knowledge Check ─── */
.quiz-section {
  margin: 24px 0; padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-soft);
}
.quiz-section h3 {
  font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.quiz-question { margin-bottom: 20px; }
.quiz-question p { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.quiz-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 6px;
  border: 1px solid var(--border); background: var(--bg); cursor: pointer;
  transition: all 0.2s; font-size: 13px; color: var(--text-dim);
}
.quiz-option:hover { border-color: var(--aws-orange-border); background: var(--aws-orange-soft); }
.quiz-option.selected { border-color: var(--aws-orange); background: var(--aws-orange-soft); color: var(--text); font-weight: 600; }
.quiz-option.correct { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.quiz-option .option-letter {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--bg-muted); border: 1px solid var(--border);
}
.quiz-explanation {
  margin-top: 8px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--success-soft); border: 1px solid #a7f3d0;
  font-size: 13px; color: #047857; line-height: 1.7;
}
[data-theme="dark"] .quiz-explanation { color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.quiz-check-btn {
  padding: 10px 20px; border-radius: 10px; border: none;
  background: var(--aws-orange); color: #fff; font-weight: 700;
  font-size: 13px; cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.quiz-check-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,153,0,0.3); }


/* ─── Production Scenario Box ─── */
.scenario-box {
  margin: 24px 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.scenario-header {
  padding: 18px 22px; background: linear-gradient(135deg, var(--aws-dark), #1a2332);
  color: #f1f5f9; display: flex; align-items: center; gap: 12px;
}
.scenario-header h4 { font-size: 15px; font-weight: 800; }
.scenario-header .scenario-icon { font-size: 22px; }
.scenario-body { padding: 22px; background: var(--bg); }
.scenario-body p { font-size: 14px; line-height: 1.8; color: var(--text-dim); margin-bottom: 12px; }
.scenario-requirements {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0;
}
.scenario-req-item {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px;
}
.scenario-req-item .req-icon { font-size: 16px; }


/* ─── Table Styles ─── */
.content-table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  font-size: 13px;
}
.content-table th {
  padding: 12px 16px; text-align: left; font-weight: 700;
  background: var(--bg-soft); color: var(--text); border-bottom: 1px solid var(--border);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.content-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-dim); line-height: 1.6;
}
.content-table tr:last-child td { border-bottom: none; }
.content-table tr:hover td { background: var(--bg-soft); }
.content-table code {
  padding: 2px 6px; border-radius: 4px; font-size: 11.5px;
  background: var(--bg-muted); border: 1px solid var(--border);
}

/* ─── Chapter Nav Footer ─── */
.chapter-nav-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
}
.nav-prev { font-size: 14px; color: var(--text-muted); text-decoration: none; }
.nav-prev:hover { color: var(--text); text-decoration: none; }
.nav-next { font-size: 14px; font-weight: 700; color: var(--aws-orange); text-decoration: none; }
.nav-next:hover { text-decoration: underline; }
.nav-done { font-size: 14px; color: var(--success); font-weight: 600; }


/* ─── Request Flow Interactive Component ─── */
.request-flow-container {
  padding: 32px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-soft); margin: 24px 0; box-shadow: var(--shadow-sm);
}
.play-btn {
  padding: 10px 22px; border-radius: 10px; border: 1px solid var(--aws-orange-border);
  background: var(--aws-orange-soft); color: var(--aws-orange); font-weight: 700;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.play-btn:hover:not(:disabled) { background: var(--aws-orange); color: #fff; transform: scale(1.03); }
.play-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.rf-flow {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; padding: 20px 0;
}
.rf-node {
  padding: 14px 16px; border-radius: 12px; text-align: center; min-width: 110px;
  border: 2px solid var(--border); background: var(--bg); cursor: pointer;
  transition: all 0.3s; position: relative;
}
.rf-node:hover { transform: scale(1.06); border-color: var(--node-color, var(--aws-orange)); }
.rf-node.active { border-color: var(--node-color, var(--aws-orange)); background: var(--aws-orange-soft); box-shadow: 0 4px 20px rgba(255,153,0,0.15); }
.rf-node.animating { border-color: var(--node-color, var(--aws-orange)); transform: scale(1.1); }
.rf-node .rf-icon { font-size: 26px; margin-bottom: 6px; }
.rf-node .rf-label { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; }
.rf-arrow { font-size: 18px; color: var(--aws-orange); font-weight: 800; }
.rf-hint { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 12px; font-family: 'JetBrains Mono', monospace; }


.rf-detail-panel {
  margin-top: 20px; padding: 24px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--aws-orange-border);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.rf-detail-header {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.rf-detail-icon { font-size: 28px; }
.rf-detail-header h4 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.rf-detail-header p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.rf-detail-subtitle {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--aws-orange); margin-bottom: 12px;
}
.rf-detail-items { display: flex; flex-direction: column; gap: 10px; }
.rf-detail-item {
  display: grid; grid-template-columns: 140px 1fr; gap: 4px 16px;
  padding: 12px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border);
}
.rf-item-key { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--aws-orange); }
.rf-item-value { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); font-weight: 500; }
.rf-item-desc { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); margin-top: 2px; }


/* ─── Certification Tips ─── */
.cert-tips {
  margin: 24px 0; padding: 24px; border-radius: var(--radius);
  background: var(--aws-orange-soft); border: 1px solid var(--aws-orange-border);
}
.cert-tips h3 {
  font-size: 15px; font-weight: 800; color: var(--aws-orange); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.cert-tips ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cert-tips li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.7;
}
.cert-tips li::before { content: '📝'; flex-shrink: 0; }

/* ─── Best Practices ─── */
.best-practices {
  margin: 24px 0; padding: 24px; border-radius: var(--radius);
  background: var(--success-soft); border: 1px solid #a7f3d0;
}
[data-theme="dark"] .best-practices { border-color: rgba(16,185,129,0.3); }
.best-practices h3 {
  font-size: 15px; font-weight: 800; color: var(--success); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.best-practices ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.best-practices li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.7;
}
.best-practices li::before { content: '✅'; flex-shrink: 0; }


/* ─── Common Mistakes ─── */
.common-mistakes {
  margin: 24px 0; padding: 24px; border-radius: var(--radius);
  background: var(--danger-soft); border: 1px solid #fecaca;
}
[data-theme="dark"] .common-mistakes { border-color: rgba(239,68,68,0.3); }
.common-mistakes h3 {
  font-size: 15px; font-weight: 800; color: var(--danger); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.common-mistakes ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.common-mistakes li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.7;
}
.common-mistakes li::before { content: '❌'; flex-shrink: 0; }

/* ─── Summary Section ─── */
.summary-section {
  margin: 24px 0; padding: 24px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border);
}
.summary-section h3 {
  font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
}
.summary-item {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px;
}
.summary-item .sum-icon { font-size: 16px; }


/* ─── Responsive ─── */
@media (max-width: 900px) {
  .chapter-sidebar { display: none; }
  .chapter-content { padding: 28px 20px 80px; }
  .cards-2, .cards-3 { grid-template-columns: 1fr; }
  .flow { gap: 8px; }
  .flow-node { min-width: 100px; padding: 12px 14px; }
  .rf-flow { gap: 6px; }
  .rf-node { min-width: 80px; padding: 10px 12px; }
  .rf-node .rf-icon { font-size: 20px; }
  .rf-node .rf-label { font-size: 10px; }
  .rf-detail-item { grid-template-columns: 1fr; }
  .scenario-requirements { grid-template-columns: 1fr; }
  .roadmap-grid { grid-template-columns: 1fr 1fr; }
  .breadcrumbs { display: none; }
  .stats-bar { gap: 20px; }
  .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .chapter-item { padding: 14px 16px; }
  .chapter-item-icon { width: 36px; height: 36px; font-size: 18px; }
  .roadmap-grid { grid-template-columns: 1fr; }
  .chapter-meta { gap: 8px; }
  .tab-btn { padding: 8px 12px; font-size: 12px; }
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.animate-fadeInUp { animation: fadeInUp 0.4s ease forwards; }
