/* ===== CLR via C# — O'zbek tilida ===== */
/* Interactive Learning Platform Style */

:root {
  --bg-primary: #0a0a23;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e3a;
  --bg-card-hover: #252550;
  --border: #2a2a4a;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0c0;
  --text-muted: #707090;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --accent-dark: #c0354a;
  --success: #4caf50;
  --warning: #ffc107;
  --info: #58a6ff;
  --code-bg: #0d1117;
  --code-border: #30363d;
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-code: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  --max-width: 1200px;
  --sidebar-width: 300px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-bottom: 2px solid var(--accent);
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}
.site-logo span { color: var(--accent); }

.header-nav { display: flex; gap: 8px; }
.header-nav a {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s;
}
.header-nav a:hover, .header-nav a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #0a0a23 0%, #1b1b4b 50%, #2d0a3e 100%);
  padding: 80px 48px;
  text-align: center;
}
.hero h1 { font-size: 48px; color: #fff; margin-bottom: 16px; }
.hero h1 .highlight {
  background: linear-gradient(90deg, #f0db4f, #e94560);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 32px;
}
.hero-stats { display: flex; gap: 48px; justify-content: center; margin-top: 32px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 36px; font-weight: 800; color: #f0db4f; }
.hero-stat .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== PROGRESS OVERVIEW ===== */
.progress-overview {
  max-width: var(--max-width);
  margin: -40px auto 48px;
  padding: 28px 32px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.progress-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.progress-circle .inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}
.progress-info h3 { color: var(--text-primary); font-size: 17px; }
.progress-info p { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.btn-continue {
  margin-left: auto;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-continue:hover { background: var(--accent-light); }

/* ===== PARTS & CHAPTERS ===== */
.parts-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px 64px;
}
.part { margin-bottom: 40px; }
.part-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.part-num {
  background: var(--accent);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.part-header h2 { color: var(--text-primary); font-size: 22px; }

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}
.chapter-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(233,69,96,0.15);
  color: inherit;
}
.ch-num {
  background: #232345;
  color: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.ch-info h3 { color: var(--text-primary); font-size: 15px; margin-bottom: 4px; }
.ch-meta { font-size: 12px; color: var(--text-muted); }
.ch-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.ch-progress-bar .fill { height: 100%; border-radius: 2px; transition: width 0.5s; }
.ch-progress-bar .fill.done { background: var(--success); }
.ch-progress-bar .fill.partial { background: var(--warning); }

.chapter-card.completed .ch-num { background: #1a3a1a; color: var(--success); }
.chapter-card.completed { border-color: #1a3a1a; }
.chapter-card.locked { opacity: 0.5; cursor: default; }
.chapter-card.locked:hover { transform: none; box-shadow: none; border-color: var(--border); }

/* ===== CHAPTER CONTENT PAGE ===== */
.chapter-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.chapter-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 60px;
  bottom: 0;
  overflow-y: auto;
  padding: 24px 0;
  z-index: 50;
}
.sidebar-section-title {
  padding: 12px 24px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
}
.sidebar-item {
  display: block;
  padding: 10px 24px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-left-color: var(--accent);
}
.sidebar-item.active {
  background: var(--bg-card);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-sub {
  padding: 6px 24px 6px 44px;
  font-size: 13px;
}
.sidebar-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 20px;
  font-size: 14px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-back:hover { color: var(--accent-light); }

/* Main content */
.chapter-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 48px 64px;
  max-width: 860px;
}

.chapter-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.chapter-breadcrumb a { color: var(--accent); }

.chapter-title {
  font-size: 36px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}
.chapter-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.chapter-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.chapter-meta div { font-size: 13px; color: var(--text-muted); }
.chapter-meta div strong {
  color: var(--text-primary);
  display: block;
  font-size: 15px;
}

/* Sections */
.section { margin-bottom: 40px; scroll-margin-top: 80px; }
.section h2 {
  font-size: 26px;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin: 24px 0 12px;
}
.section p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.section ul, .section ol {
  margin: 12px 0 16px 24px;
  color: var(--text-secondary);
}
.section li {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.7;
}

/* Code blocks */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.6;
  color: #c9d1d9;
  overflow-x: auto;
  position: relative;
}
.code-block .lang-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.code-block .kw { color: #ff7b72; }
.code-block .str { color: #a5d6ff; }
.code-block .cmt { color: #8b949e; }
.code-block .type { color: #79c0ff; }
.code-block .num { color: #f0db4f; }
code {
  font-family: var(--font-code);
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #e06c75;
}

/* Callout boxes */
.callout {
  padding: 16px 20px;
  border-radius: 0 10px 10px 0;
  margin: 20px 0;
}
.callout strong { display: block; margin-bottom: 4px; }
.callout p { font-size: 14px; margin: 0; }

.callout.tip { background: #1a2332; border-left: 4px solid var(--info); }
.callout.tip strong { color: var(--info); }
.callout.tip p { color: var(--text-secondary); }

.callout.warning { background: #2d1f0f; border-left: 4px solid var(--warning); }
.callout.warning strong { color: var(--warning); }
.callout.warning p { color: var(--text-secondary); }

.callout.important { background: #2d0f1a; border-left: 4px solid var(--accent); }
.callout.important strong { color: var(--accent); }
.callout.important p { color: var(--text-secondary); }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}
td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
tr:hover td { background: rgba(233,69,96,0.05); }

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}
.nav-card {
  flex: 1;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  max-width: 45%;
}
.nav-card:hover { border-color: var(--accent); color: inherit; }
.nav-card .direction {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.nav-card .nav-title {
  color: var(--accent);
  font-size: 15px;
  margin-top: 4px;
  font-weight: 600;
}
.nav-card.next { text-align: right; }

/* Diagram boxes */
.diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  text-align: center;
}
.diagram-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}
.diagram-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
}
.diagram-box {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  text-align: center;
  min-width: 120px;
}
.diagram-box.highlight {
  border-color: var(--accent);
  background: rgba(233,69,96,0.1);
}
.diagram-arrow { color: var(--accent); font-size: 24px; font-weight: bold; }

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== VISUAL ANIMATIONS ===== */

/* Container */
.visual-demo {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #12122a 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin: 28px 0;
  overflow: hidden;
  position: relative;
}
.visual-demo::before {
  content: 'VIZUAL';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  opacity: 0.4;
  font-weight: 700;
}
.visual-demo-title {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  text-align: center;
}
.visual-demo-caption {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  font-style: italic;
}

/* --- Pipeline / Flow Animation --- */
.anim-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.anim-pipeline .step {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 90px;
  animation: pipelinePulse 4s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.8s);
}
.anim-pipeline .step.highlight {
  border-color: var(--accent);
  background: rgba(233,69,96,0.1);
}
.anim-pipeline .step .step-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}
.anim-pipeline .arrow {
  color: var(--accent);
  font-size: 20px;
  font-weight: bold;
  animation: arrowPulse 4s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.8s + 0.4s);
}
@keyframes pipelinePulse {
  0%,15% { border-color: var(--border); background: var(--bg-card); transform: scale(1); box-shadow: none; }
  20%,35% { border-color: var(--accent); background: rgba(233,69,96,0.15); transform: scale(1.06); box-shadow: 0 0 20px rgba(233,69,96,0.3); }
  40%,100% { border-color: var(--border); background: var(--bg-card); transform: scale(1); box-shadow: none; }
}
@keyframes arrowPulse {
  0%,15% { color: var(--text-muted); transform: translateX(0); }
  20%,35% { color: var(--accent); transform: translateX(4px); }
  40%,100% { color: var(--text-muted); transform: translateX(0); }
}

/* --- Stack & Heap Memory --- */
.anim-memory {
  display: flex;
  gap: 32px;
  justify-content: center;
  padding: 12px 0;
  flex-wrap: wrap;
}
.anim-memory .mem-col {
  min-width: 180px;
  max-width: 220px;
}
.anim-memory .mem-label {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  color: #fff;
}
.anim-memory .mem-label.stack-label { background: var(--info); }
.anim-memory .mem-label.heap-label { background: var(--accent); }
.anim-memory .mem-block {
  padding: 10px 14px;
  margin: 4px 0;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-code);
  text-align: center;
  animation: memPulse 5s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.4s);
}
.mem-block.val { background: #1a3a1a; border: 1px solid var(--success); color: var(--success); }
.mem-block.ref { background: #1a1a3a; border: 1px solid var(--info); color: var(--info); }
.mem-block.obj { background: #2a1525; border: 1px solid var(--accent); color: var(--accent-light); }
.mem-block.empty { background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }
.mem-pointer {
  text-align: center;
  font-size: 18px;
  color: var(--warning);
  padding: 2px 0;
  animation: pointerBounce 2s ease infinite;
}
@keyframes memPulse {
  0%,70% { transform: scale(1); box-shadow: none; }
  75%,85% { transform: scale(1.04); box-shadow: 0 0 12px rgba(233,69,96,0.2); }
  90%,100% { transform: scale(1); box-shadow: none; }
}
@keyframes pointerBounce {
  0%,100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(8px); opacity: 1; }
}

/* --- Boxing / Unboxing --- */
.anim-boxing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.anim-boxing .box-stage {
  padding: 16px 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-family: var(--font-code);
  font-weight: 600;
  animation: boxingFlow 6s ease infinite;
  animation-delay: calc(var(--i, 0) * 1.2s);
}
.anim-boxing .box-stage.on-stack {
  background: #1a3a1a;
  border: 2px solid var(--success);
  color: var(--success);
}
.anim-boxing .box-stage.on-heap {
  background: #2a1525;
  border: 2px solid var(--accent);
  color: var(--accent-light);
}
.anim-boxing .box-arrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--warning);
  animation: boxArrowMove 6s ease infinite;
  animation-delay: calc(var(--i, 0) * 1.2s);
}
@keyframes boxingFlow {
  0%,10% { transform: scale(1); box-shadow: none; opacity: 0.7; }
  15%,30% { transform: scale(1.08); box-shadow: 0 0 20px rgba(233,69,96,0.35); opacity: 1; }
  35%,100% { transform: scale(1); box-shadow: none; opacity: 0.7; }
}
@keyframes boxArrowMove {
  0%,10% { transform: translateX(0) scale(1); opacity: 0.4; }
  15%,30% { transform: translateX(5px) scale(1.3); opacity: 1; color: var(--accent); }
  35%,100% { transform: translateX(0) scale(1); opacity: 0.4; }
}

/* --- GC Mark-Sweep-Compact --- */
.anim-gc-phases {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gc-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: gcPhaseHighlight 8s ease infinite;
  animation-delay: calc(var(--i, 0) * 2s);
}
.gc-phase-label {
  min-width: 80px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: right;
}
.gc-objects {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gc-obj {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-code);
  transition: all 0.3s;
}
.gc-obj.alive { background: #1a3a1a; border: 2px solid var(--success); color: var(--success); }
.gc-obj.dead { background: #3a1a1a; border: 2px solid #ff4444; color: #ff4444; }
.gc-obj.marked { background: #2a2a1a; border: 2px solid var(--warning); color: var(--warning); }
.gc-obj.swept { opacity: 0.15; border: 2px dashed #555; color: #555; background: transparent; }
.gc-obj.compacted { background: #1a3a1a; border: 2px solid var(--success); color: var(--success); }
@keyframes gcPhaseHighlight {
  0%,15% { transform: scale(1); opacity: 0.6; }
  20%,35% { transform: scale(1.03); opacity: 1; filter: brightness(1.3); }
  40%,100% { transform: scale(1); opacity: 0.6; }
}

/* GC Animated Version */
.anim-gc-live .gc-obj {
  animation: gcLive 6s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.15s);
}
.anim-gc-live .gc-obj.alive {
  animation-name: gcAlive;
}
.anim-gc-live .gc-obj.dead {
  animation-name: gcDead;
}
@keyframes gcAlive {
  0%,25% { background: #1a3a1a; border-color: var(--success); color: var(--success); transform: scale(1); }
  30%,50% { background: #2a2a1a; border-color: var(--warning); color: var(--warning); transform: scale(1.08); }
  55%,100% { background: #1a3a1a; border-color: var(--success); color: var(--success); transform: scale(1); }
}
@keyframes gcDead {
  0%,25% { background: #3a1a1a; border-color: #ff4444; color: #ff4444; opacity: 1; transform: scale(1); }
  30%,50% { background: #2a2a1a; border-color: var(--warning); color: var(--warning); opacity: 1; transform: scale(1.08); }
  55%,75% { opacity: 0; transform: scale(0.3); }
  80%,100% { background: #3a1a1a; border-color: #ff4444; color: #ff4444; opacity: 1; transform: scale(1); }
}

/* --- Generational GC --- */
.anim-generations {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-end;
  padding: 12px 0;
  flex-wrap: wrap;
}
.gen-box {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  animation: genPulse 6s ease infinite;
  animation-delay: calc(var(--i, 0) * 1.5s);
}
.gen-box .gen-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.gen-box .gen-items {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}
.gen-box .gen-item {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-code);
  animation: genItemFloat 3s ease infinite;
  animation-delay: calc(var(--j, 0) * 0.2s);
}
.gen-0 { border-color: var(--success); min-width: 100px; }
.gen-0 .gen-title { color: var(--success); }
.gen-0 .gen-item { background: rgba(76,175,80,0.15); color: var(--success); border: 1px solid var(--success); }
.gen-1 { border-color: var(--warning); min-width: 120px; }
.gen-1 .gen-title { color: var(--warning); }
.gen-1 .gen-item { background: rgba(255,193,7,0.15); color: var(--warning); border: 1px solid var(--warning); }
.gen-2 { border-color: var(--accent); min-width: 150px; }
.gen-2 .gen-title { color: var(--accent); }
.gen-2 .gen-item { background: rgba(233,69,96,0.1); color: var(--accent); border: 1px solid var(--accent); }
.gen-arrow {
  font-size: 24px;
  color: var(--text-muted);
  align-self: center;
  animation: genArrowPush 3s ease infinite;
}
@keyframes genPulse {
  0%,15% { transform: scale(1); box-shadow: none; }
  20%,35% { transform: scale(1.04); box-shadow: 0 0 15px rgba(233,69,96,0.2); }
  40%,100% { transform: scale(1); box-shadow: none; }
}
@keyframes genItemFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes genArrowPush {
  0%,100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(6px); opacity: 1; }
}

/* --- Delegate Chain --- */
.anim-delegate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.del-node {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-code);
  color: var(--info);
  animation: delegateLight 4s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.8s);
}
.del-node .del-label {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-main);
  margin-top: 2px;
}
.del-link {
  color: var(--accent);
  font-weight: bold;
  font-size: 16px;
  animation: delLinkPulse 4s ease infinite;
  display: inline-block;
  animation-delay: calc(var(--i, 0) * 0.8s + 0.4s);
}
@keyframes delegateLight {
  0%,15% { border-color: var(--border); background: var(--bg-card); transform: scale(1); }
  20%,35% { border-color: var(--accent); background: rgba(233,69,96,0.12); box-shadow: 0 0 18px rgba(233,69,96,0.3); transform: scale(1.05); }
  40%,100% { border-color: var(--border); background: var(--bg-card); box-shadow: none; transform: scale(1); }
}
@keyframes delLinkPulse {
  0%,15% { transform: scaleX(1); color: var(--text-muted); }
  20%,35% { transform: scaleX(1.3); color: var(--accent); }
  40%,100% { transform: scaleX(1); color: var(--text-muted); }
}

/* --- Event Publisher/Subscriber --- */
.anim-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.evt-publisher {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  animation: evtPulse 3s ease infinite;
}
.evt-arrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.evt-arrow .evt-signal {
  width: 40px;
  height: 3px;
  background: var(--warning);
  border-radius: 2px;
  animation: evtSignal 3s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.15s);
}
.evt-subscribers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.evt-sub {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  animation: evtReceive 3s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.2s);
}
@keyframes evtPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 rgba(233,69,96,0); }
  50% { transform: scale(1.08); box-shadow: 0 0 30px rgba(233,69,96,0.5); }
}
@keyframes evtSignal {
  0% { width: 0; opacity: 0; transform: translateX(0); }
  30% { width: 60px; opacity: 1; transform: translateX(10px); }
  50% { width: 60px; opacity: 1; background: var(--accent); transform: translateX(20px); }
  70% { width: 30px; opacity: 0.5; transform: translateX(30px); }
  100% { width: 0; opacity: 0; transform: translateX(40px); }
}
@keyframes evtReceive {
  0%,40% { border-color: var(--border); background: var(--bg-card); transform: scale(1); }
  50%,60% { border-color: var(--success); background: rgba(76,175,80,0.12); box-shadow: 0 0 15px rgba(76,175,80,0.25); transform: scale(1.04); }
  70%,100% { border-color: var(--border); background: var(--bg-card); transform: scale(1); }
}

/* --- Async vs Sync Timeline --- */
.anim-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}
.tl-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl-label {
  min-width: 65px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}
.tl-bar {
  flex: 1;
  height: 34px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  overflow: hidden;
  position: relative;
}
.tl-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #fff;
  opacity: 0.6;
  border-radius: 2px;
  animation: tlProgress 4s linear infinite;
}
.tl-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.tl-segment.work { background: var(--info); animation: tlSegGlow 4s ease infinite; }
.tl-segment.wait { background: #333; color: #777; }
.tl-segment.io { background: var(--warning); color: #333; animation: tlSegGlow 4s ease infinite 0.5s; }
.tl-segment.free { background: rgba(76,175,80,0.3); color: var(--success); animation: tlSegGlow 4s ease infinite 1s; }
.tl-segment.done { background: var(--success); animation: tlSegGlow 4s ease infinite 1.5s; }
.tl-time {
  display: flex;
  justify-content: space-between;
  margin-left: 75px;
  font-size: 10px;
  color: var(--text-muted);
}
@keyframes tlProgress {
  0% { left: 0; opacity: 0.8; }
  100% { left: 100%; opacity: 0; }
}
@keyframes tlSegGlow {
  0%,70% { filter: brightness(1); }
  80% { filter: brightness(1.4); }
  90%,100% { filter: brightness(1); }
}

/* --- Thread States --- */
.anim-states {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.state-node {
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid;
  animation: stateRotate 6s ease infinite;
  animation-delay: calc(var(--i, 0) * 1.5s);
}
.state-node.s-new { border-color: var(--text-muted); color: var(--text-muted); background: rgba(128,128,128,0.1); }
.state-node.s-run { border-color: var(--success); color: var(--success); background: rgba(76,175,80,0.1); }
.state-node.s-wait { border-color: var(--warning); color: var(--warning); background: rgba(255,193,7,0.1); }
.state-node.s-stop { border-color: var(--accent); color: var(--accent); background: rgba(233,69,96,0.1); }
.state-arrow {
  color: var(--text-muted);
  font-size: 16px;
  animation: stateArrowPulse 2s ease infinite;
}
@keyframes stateRotate {
  0%,15% { transform: scale(1); box-shadow: none; opacity: 0.6; }
  20%,35% { transform: scale(1.12); box-shadow: 0 0 18px rgba(233,69,96,0.3); opacity: 1; }
  40%,100% { transform: scale(1); box-shadow: none; opacity: 0.6; }
}
@keyframes stateArrowPulse {
  0%,100% { transform: translateX(0); opacity: 0.4; }
  50% { transform: translateX(3px); opacity: 1; }
}

/* --- Lock / Monitor --- */
.anim-lock {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
}
.lock-resource {
  padding: 12px 24px;
  border: 3px solid var(--warning);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--warning);
  background: rgba(255,193,7,0.08);
  animation: lockSwitch 5s ease infinite;
}
.lock-threads {
  display: flex;
  gap: 16px;
}
.lock-thread {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-code);
}
.lock-thread.t-inside {
  border: 2px solid var(--success);
  color: var(--success);
  background: rgba(76,175,80,0.1);
  animation: lockT1 5s ease infinite;
}
.lock-thread.t-waiting {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: rgba(233,69,96,0.08);
  animation: lockT2 5s ease infinite;
}
@keyframes lockSwitch {
  0%,42% { border-color: var(--success); color: var(--success); transform: scale(1); }
  45%,55% { border-color: var(--warning); color: var(--warning); transform: scale(1.06); box-shadow: 0 0 20px rgba(255,193,7,0.3); }
  58%,100% { border-color: var(--info); color: var(--info); transform: scale(1); }
}
@keyframes lockT1 {
  0%,42% { border-color: var(--success); opacity: 1; box-shadow: 0 0 12px rgba(76,175,80,0.4); transform: scale(1.03); }
  48%,52% { opacity: 0.6; box-shadow: none; transform: scale(0.97); }
  58%,100% { border-color: var(--accent); color: var(--accent); opacity: 0.4; box-shadow: none; transform: scale(0.95); }
}
@keyframes lockT2 {
  0%,42% { border-color: var(--accent); opacity: 0.4; box-shadow: none; transform: scale(0.95); }
  48%,52% { opacity: 0.6; transform: scale(0.97); }
  58%,100% { border-color: var(--success); color: var(--success); opacity: 1; box-shadow: 0 0 12px rgba(76,175,80,0.4); transform: scale(1.03); }
}

/* --- Exception Flow --- */
.anim-exception {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 12px 0;
}
.exc-frame {
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-code);
  color: var(--text-secondary);
  width: 80%;
  max-width: 300px;
  text-align: center;
  animation: excUnwind 5s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.4s);
}
.exc-frame.has-catch {
  border-color: var(--success);
  color: var(--success);
}
.exc-throw {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  animation: excThrow 5s ease infinite;
}
@keyframes excUnwind {
  0%,30% { border-color: var(--border); background: var(--bg-card); transform: scale(1); }
  35%,50% { border-color: var(--accent); background: rgba(233,69,96,0.1); transform: scale(1.03); box-shadow: 0 0 12px rgba(233,69,96,0.2); }
  55%,100% { border-color: var(--border); background: var(--bg-card); transform: scale(1); box-shadow: none; }
}
@keyframes excThrow {
  0%,30% { opacity: 0.3; transform: translateY(0); }
  40%,60% { opacity: 1; transform: translateY(-6px); }
  70%,100% { opacity: 0.3; transform: translateY(0); }
}

/* --- Object Layout --- */
.anim-obj-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 12px 0;
}
.obj-field {
  padding: 10px 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--font-code);
  text-align: center;
  width: 80%;
  max-width: 280px;
  animation: objScan 4s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.8s);
}
.obj-field:first-child { border-radius: 10px 10px 0 0; }
.obj-field:last-child { border-radius: 0 0 10px 10px; }
.obj-field.sync { background: #1a1a3a; border-color: var(--info); color: var(--info); }
.obj-field.typeptr { background: #2a1a2a; border-color: #b388ff; color: #b388ff; }
.obj-field.field { background: #1a2a1a; border-color: var(--success); color: var(--success); }
@keyframes objScan {
  0%,15% { transform: scale(1); filter: brightness(1); box-shadow: none; }
  20%,35% { transform: scale(1.03); filter: brightness(1.4); box-shadow: 0 0 15px rgba(233,69,96,0.2); }
  40%,100% { transform: scale(1); filter: brightness(1); box-shadow: none; }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  body { overflow-x: hidden; }

  /* --- Header --- */
  .site-header { padding: 10px 16px; }
  .site-logo { font-size: 16px; }
  .header-nav { gap: 4px; }
  .header-nav a { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

  /* --- Hero --- */
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; margin-bottom: 20px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .hero-stat .num { font-size: 28px; }
  .hero-stat .label { font-size: 11px; }

  /* --- Progress --- */
  .progress-overview {
    flex-direction: column;
    text-align: center;
    margin: -20px 16px 24px;
    padding: 20px 16px;
    gap: 16px;
  }
  .progress-circle { width: 70px; height: 70px; }
  .progress-circle .inner { width: 56px; height: 56px; font-size: 16px; }
  .btn-continue { margin: 0; width: 100%; text-align: center; display: block; }

  /* --- Parts & Chapters --- */
  .parts-container { padding: 0 16px 40px; }
  .part-header h2 { font-size: 18px; }
  .chapters-grid { grid-template-columns: 1fr; gap: 12px; }
  .chapter-card { padding: 14px; gap: 12px; }
  .ch-num { width: 36px; height: 36px; font-size: 14px; border-radius: 8px; }
  .ch-info h3 { font-size: 14px; }

  /* --- Chapter content page --- */
  .chapter-sidebar { display: none; }
  .chapter-main { margin-left: 0; padding: 24px 16px; max-width: 100%; }
  .chapter-breadcrumb { font-size: 12px; margin-bottom: 16px; word-break: break-word; }
  .chapter-title { font-size: 24px; }
  .chapter-subtitle { font-size: 14px; margin-bottom: 20px; }
  .chapter-meta { gap: 8px; padding: 12px; }
  .chapter-meta div { font-size: 12px; flex: 1 1 40%; min-width: 0; text-align: center; }
  .chapter-meta div strong { font-size: 13px; }

  /* --- Sections text --- */
  .section h2 { font-size: 20px; }
  .section h3 { font-size: 17px; }
  .section p { font-size: 15px; line-height: 1.75; }
  .section li { font-size: 14px; }
  .section ul, .section ol { margin-left: 16px; }

  /* --- Tables scrollable --- */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  th, td { padding: 8px 10px; font-size: 12px; }
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* --- Code blocks --- */
  .code-block { padding: 14px 12px; font-size: 12px; margin: 12px 0; border-radius: 8px; }
  code { font-size: 12px; word-break: break-all; }

  /* --- Callouts --- */
  .callout { padding: 12px 14px; margin: 16px 0; }
  .callout p { font-size: 13px; }

  /* --- Diagrams --- */
  .diagram { padding: 16px 12px; }
  .diagram-flow { gap: 8px; }
  .diagram-box { padding: 8px 12px; font-size: 11px; min-width: 80px; }
  .diagram-arrow { font-size: 18px; }

  /* --- Navigation cards --- */
  .chapter-nav { flex-direction: column; gap: 12px; margin-top: 32px; }
  .nav-card { max-width: 100%; padding: 14px 16px; }
  .nav-card .nav-title { font-size: 14px; }

  /* --- Footer --- */
  .site-footer { padding: 24px 16px; font-size: 12px; }

  /* ===== Animation containers ===== */
  .visual-demo { padding: 16px 12px; margin: 20px 0; border-radius: 12px; }
  .visual-demo::before { font-size: 8px; top: 6px; right: 8px; }
  .visual-demo-title { font-size: 11px; letter-spacing: 1px; margin-bottom: 14px; }
  .visual-demo-caption { font-size: 11px; margin-top: 10px; }

  /* Pipeline — vertical on mobile */
  .anim-pipeline { gap: 4px; flex-direction: column; align-items: center; }
  .anim-pipeline .step { min-width: unset; width: 100%; max-width: 220px; padding: 10px 14px; font-size: 12px; }
  .anim-pipeline .arrow { font-size: 16px; transform: rotate(90deg); line-height: 1; }

  /* Memory — stack vertically */
  .anim-memory { gap: 12px; flex-direction: column; align-items: center; }
  .anim-memory .mem-col { min-width: unset; max-width: 240px; width: 100%; }

  /* Boxing — vertical */
  .anim-boxing { gap: 6px; flex-direction: column; align-items: center; }
  .anim-boxing .box-stage { padding: 12px 16px; font-size: 12px; width: 100%; max-width: 200px; }
  .anim-boxing .box-arrow { transform: rotate(90deg); line-height: 1; }

  /* GC phases */
  .gc-phase-row { flex-wrap: wrap; }
  .gc-phase-label { min-width: 55px; font-size: 10px; }
  .gc-obj { width: 36px; height: 36px; font-size: 10px; }

  /* Generations — vertical */
  .anim-generations { flex-direction: column; align-items: center; gap: 8px; }
  .gen-box { min-width: unset !important; width: 100%; max-width: 260px; }
  .gen-arrow { transform: rotate(90deg); line-height: 1; }

  /* Delegate — vertical */
  .anim-delegate { gap: 4px; flex-direction: column; align-items: center; }
  .del-node { padding: 10px 14px; font-size: 11px; width: 100%; max-width: 200px; text-align: center; }
  .del-link { transform: rotate(90deg); font-size: 14px; line-height: 1; display: block; text-align: center; }

  /* Event — vertical */
  .anim-event { flex-direction: column; gap: 12px; align-items: center; }
  .evt-publisher { width: 100%; max-width: 180px; }
  .evt-arrow { flex-direction: row; gap: 4px; }
  .evt-arrow .evt-signal { width: 3px; height: 24px; }
  .evt-subscribers { align-items: center; }
  .evt-sub { text-align: center; }

  /* Timeline */
  .tl-label { min-width: 45px; font-size: 10px; }
  .tl-bar { height: 26px; }
  .tl-segment { font-size: 8px; padding: 0 2px; }
  .tl-time { margin-left: 55px; font-size: 9px; }

  /* Thread States */
  .anim-states { gap: 4px; }
  .state-node { padding: 7px 10px; font-size: 10px; }
  .state-arrow { font-size: 14px; }

  /* Lock */
  .lock-resource { padding: 10px 16px; font-size: 12px; }
  .lock-threads { gap: 10px; flex-wrap: wrap; justify-content: center; }
  .lock-thread { padding: 8px 12px; font-size: 11px; }

  /* Exception */
  .exc-frame { width: 95%; max-width: 260px; padding: 8px 14px; font-size: 11px; }

  /* Object layout */
  .obj-field { width: 95%; max-width: 240px; padding: 8px 14px; font-size: 11px; }
}

/* ===== Extra small screens ===== */
@media (max-width: 380px) {
  .site-header { padding: 8px 12px; }
  .site-logo { font-size: 14px; }
  .header-nav a { padding: 5px 8px; font-size: 11px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .hero-stats { gap: 12px; }
  .hero-stat .num { font-size: 22px; }
  .chapter-title { font-size: 22px; }
  .section h2 { font-size: 18px; }
  .section p { font-size: 14px; }
  .chapter-meta div { flex: 1 1 100%; }
}

/* ===== QUIZ SYSTEM ===== */

/* --- Quiz Trigger (mavzu oxiridagi tugma) --- */
.quiz-trigger {
  margin-top: 32px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(233,69,96,0.08) 0%, rgba(88,166,255,0.08) 100%);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  transition: all 0.3s ease;
}
.quiz-trigger:hover {
  border-style: solid;
  background: linear-gradient(135deg, rgba(233,69,96,0.15) 0%, rgba(88,166,255,0.12) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(233,69,96,0.15);
}
.quiz-trigger-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}
.quiz-trigger-icon { font-size: 28px; flex-shrink: 0; }
.quiz-trigger-text { flex: 1; }
.quiz-trigger-text strong { display: block; color: var(--text-primary); font-size: 15px; }
.quiz-trigger-text span { font-size: 13px; color: var(--text-muted); }
.quiz-btn-start {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-main);
}
.quiz-btn-start:hover { background: var(--accent-light); transform: scale(1.05); }

/* --- Quiz Container --- */
.quiz-container {
  margin-top: 24px;
  padding: 28px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(233,69,96,0.1);
  animation: quizSlideIn 0.3s ease;
}
@keyframes quizSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Quiz Header --- */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.quiz-progress { flex: 1; margin-right: 16px; }
.quiz-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.quiz-progress-text { font-size: 13px; color: var(--text-muted); }
.quiz-btn-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
}
.quiz-btn-close:hover { border-color: var(--accent); color: var(--accent); background: rgba(233,69,96,0.1); }

/* --- Question --- */
.quiz-question {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* --- Answer Options --- */
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--text-secondary);
  width: 100%;
}
.quiz-option:hover:not(.disabled) {
  border-color: var(--accent);
  background: rgba(233,69,96,0.08);
  color: var(--text-primary);
  transform: translateX(4px);
}
.quiz-option.disabled { cursor: default; opacity: 0.7; }
.quiz-option.correct {
  border-color: var(--success) !important;
  background: rgba(76,175,80,0.12) !important;
  color: var(--success) !important;
  opacity: 1 !important;
}
.quiz-option.wrong {
  border-color: var(--accent) !important;
  background: rgba(233,69,96,0.12) !important;
  color: var(--accent) !important;
  opacity: 1 !important;
}
.quiz-option-letter {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}
.quiz-option:hover:not(.disabled) .quiz-option-letter { background: var(--accent); color: #fff; }
.quiz-option.correct .quiz-option-letter { background: var(--success); color: #fff; }
.quiz-option.wrong .quiz-option-letter { background: var(--accent); color: #fff; }
.quiz-option-text { flex: 1; }

/* --- Feedback --- */
.quiz-feedback {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: feedbackPop 0.3s ease;
}
.quiz-feedback.feedback-correct { background: rgba(76,175,80,0.1); border-left: 4px solid var(--success); }
.quiz-feedback.feedback-wrong { background: rgba(233,69,96,0.1); border-left: 4px solid var(--accent); }
.feedback-icon { font-size: 24px; flex-shrink: 0; }
.feedback-correct .feedback-icon { color: var(--success); }
.feedback-wrong .feedback-icon { color: var(--accent); }
.feedback-text strong { display: block; margin-bottom: 4px; font-size: 15px; }
.feedback-correct .feedback-text strong { color: var(--success); }
.feedback-wrong .feedback-text strong { color: var(--accent); }
.feedback-text p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
@keyframes feedbackPop {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Next/Finish Button --- */
.quiz-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.quiz-btn-next {
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
}
.quiz-btn-next:hover { background: var(--accent-light); transform: scale(1.05); }

/* --- Results --- */
.quiz-results { text-align: center; padding: 24px 0; }
.quiz-results-icon { font-size: 56px; margin-bottom: 12px; }
.quiz-results h3 { font-size: 24px; color: var(--text-primary); margin-bottom: 20px; }
.quiz-score-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: rgba(233,69,96,0.08);
}
.score-value { font-size: 32px; font-weight: 800; color: var(--accent); }
.score-detail { font-size: 13px; color: var(--text-muted); }
.quiz-results-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.quiz-results-actions { display: flex; gap: 12px; justify-content: center; }
.quiz-btn-retry {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
}
.quiz-btn-retry:hover { background: var(--accent-light); }
.quiz-results-actions .quiz-btn-close {
  width: auto; height: auto;
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
}

/* --- Quiz Mobile --- */
@media (max-width: 768px) {
  .quiz-trigger { padding: 16px; }
  .quiz-trigger-inner { flex-wrap: wrap; }
  .quiz-trigger-icon { font-size: 22px; }
  .quiz-trigger-text strong { font-size: 14px; }
  .quiz-btn-start { width: 100%; text-align: center; margin-top: 8px; }
  .quiz-container { padding: 20px 16px; border-radius: 12px; }
  .quiz-question { font-size: 15px; }
  .quiz-option { padding: 12px 14px; font-size: 14px; }
  .quiz-option-letter { width: 28px; height: 28px; font-size: 12px; }
  .quiz-feedback { padding: 12px 14px; }
  .feedback-text p { font-size: 13px; }
  .quiz-score-circle { width: 100px; height: 100px; }
  .score-value { font-size: 26px; }
  .quiz-results-actions { flex-direction: column; }
}
