@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Syne:wght@600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ═══════════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════════ */
:root {
  --navy:        #00205d;
  --navy-dark:   #001240;
  --navy-mid:    #003080;
  --blue:        #1a56db;
  --blue-mid:    #2563eb;
  --sky:         #38bdf8;
  --cyan:        #06b6d4;
  --teal:        #0d9488;
  --ice:         #eff6ff;
  --ice2:        #dbeafe;
  --white:       #ffffff;
  --gray-bg:     #f1f5f9;
  --gray-card:   #f8fafc;
  --gray-border: #e2e8f0;
  --gray-muted:  #94a3b8;
  --gray-text:   #475569;
  --dark-text:   #1e293b;
  --green:       #10b981;
  --green-light: #d1fae5;
  --amber:       #f59e0b;
  --amber-light: #fef3c7;
  --rose:        #f43f5e;
  --rose-light:  #ffe4e6;
  --purple:      #8b5cf6;
  --purple-light:#ede9fe;
  --orange:      #f97316;
  --orange-light:#fff7ed;

  --s-sm: 0 1px 3px rgba(0,32,93,.07), 0 1px 2px rgba(0,32,93,.05);
  --s-md: 0 4px 16px rgba(0,32,93,.09), 0 2px 6px rgba(0,32,93,.06);
  --s-lg: 0 12px 40px rgba(0,32,93,.13), 0 4px 12px rgba(0,32,93,.07);
  --r:    14px;
  --r-sm: 8px;
  --r-lg: 22px;

  --page-bg: #0a0f1e;
  --page-bg2: #0d1a35;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--page-bg);
  color: #e2e8f0;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

h1,h2,h3,h4,h5 {
  font-family: 'Syne', 'Segoe UI', sans-serif;
  line-height: 1.2;
}

code, .mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════
   PROGRESS BAR TOP
═══════════════════════════════════════════════ */
#global-prog-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 3px; background: rgba(255,255,255,.06);
}
#global-prog-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue-mid), var(--cyan), var(--teal));
  transition: width .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(6,182,212,.6);
}

/* ═══════════════════════════════════════════════
   SIDEBAR NAV
═══════════════════════════════════════════════ */
#sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 260px; z-index: 200;
  background: linear-gradient(180deg, #060d20 0%, #0a1530 100%);
  border-right: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.sidebar-header {
  padding: 28px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-course {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 8px; font-family: 'Syne', sans-serif;
}
.sidebar-title {
  font-size: 1.05rem; font-weight: 800; color: white;
  font-family: 'Syne', sans-serif; line-height: 1.3;
}
.sidebar-sub { font-size: .75rem; color: var(--gray-muted); margin-top: 4px; }

.sidebar-nav { flex: 1; padding: 14px 12px; }
.nav-group { margin-bottom: 6px; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: rgba(255,255,255,.25); padding: 6px 10px 4px;
  font-family: 'Syne', sans-serif;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  font-size: .84rem; color: rgba(255,255,255,.55);
  transition: all .2s; border: none; background: none;
  width: 100%; text-align: left; font-family: 'DM Sans', sans-serif;
  font-weight: 400; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(26,86,219,.35), rgba(6,182,212,.18));
  color: white; font-weight: 600;
  border: 1px solid rgba(6,182,212,.2);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--blue-mid), var(--cyan));
}
.nav-item .nav-num {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  background: rgba(255,255,255,.08); font-family: 'Syne', sans-serif;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4);
}
.nav-item.active .nav-num {
  background: linear-gradient(135deg, var(--blue-mid), var(--cyan));
  color: white;
}
.nav-item.completed .nav-num { background: rgba(16,185,129,.2); color: var(--green); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.prog-label { font-size: 11px; color: var(--gray-muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.prog-track { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--blue-mid), var(--cyan)); border-radius: 3px; transition: width .5s ease; }

/* hamburger */
#menu-toggle {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 300;
  width: 40px; height: 40px; border-radius: 10px; border: none;
  background: rgba(10,15,30,.9); backdrop-filter: blur(8px);
  color: white; font-size: 1.1rem; cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
}
#overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════════════ */
#content-area {
  margin-left: 260px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ═══════════════════════════════════════════════
   PAGES
═══════════════════════════════════════════════ */
.page {
  display: none; flex-direction: column;
  min-height: 100vh; animation: pageIn .4s ease both;
}
.page.active { display: flex; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Page header band */
.page-hero {
  padding: 56px 48px 44px;
  background: linear-gradient(135deg, #060d20 0%, var(--navy-dark) 50%, #0d1a35 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative; overflow: hidden; flex-shrink: 0;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 500px 300px at 90% -20%, rgba(56,189,248,.10) 0%, transparent 60%),
    radial-gradient(ellipse 350px 250px at -5% 110%, rgba(6,182,212,.08) 0%, transparent 60%);
}
.page-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 50px 50px;
}
.page-hero-inner { position: relative; z-index: 1; max-width: 820px; }
.page-breadcrumb {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 14px; font-family: 'Syne', sans-serif;
  display: flex; align-items: center; gap: 8px;
}
.page-breadcrumb span { color: rgba(255,255,255,.3); }
.page-num-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-mid), var(--cyan));
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; color: white;
  margin-bottom: 16px; box-shadow: 0 4px 16px rgba(6,182,212,.3);
}
.page-title {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; color: white;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #bfdbfe 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-subtitle { font-size: 1rem; color: rgba(255,255,255,.6); font-weight: 300; line-height: 1.65; max-width: 680px; }
.page-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.page-tag {
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700;
  font-family: 'Syne', sans-serif; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.65);
}

/* Page body */
.page-body { flex: 1; padding: 44px 48px 60px; }
.page-body-narrow { max-width: 960px; }

/* Page footer nav */
.page-footer {
  padding: 24px 48px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(6,13,32,.5); flex-shrink: 0;
}
.page-nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 22px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); color: rgba(255,255,255,.75);
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: .9rem; font-weight: 500;
  transition: all .2s;
}
.page-nav-btn:hover { background: rgba(255,255,255,.1); color: white; border-color: rgba(255,255,255,.25); }
.page-nav-btn.primary {
  background: linear-gradient(135deg, var(--blue-mid), var(--cyan));
  border-color: transparent; color: white; font-weight: 600;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.page-nav-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.45); }
.page-nav-btn:disabled { opacity: .3; cursor: default; pointer-events: none; }
.page-position { font-size: .82rem; color: var(--gray-muted); font-family: 'Syne', sans-serif; font-weight: 700; }

/* ═══════════════════════════════════════════════
   COMPONENTS — CARDS
═══════════════════════════════════════════════ */
.cards-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cards-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r); padding: 24px 22px;
  position: relative; overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: var(--card-top, linear-gradient(90deg, var(--blue-mid), var(--cyan)));
}
.card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.14); box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.card h3 { font-size: 1rem; font-weight: 700; color: white; margin-bottom: 8px; }
.card p  { font-size: .875rem; color: rgba(255,255,255,.6); line-height: 1.7; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  background: var(--icon-bg, rgba(37,99,235,.2));
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}

/* ═══════════════════════════════════════════════
   COMPONENTS — UML DIAGRAMS
═══════════════════════════════════════════════ */
.uml-box {
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.03);
  display: inline-block; min-width: 140px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.uml-class-name {
  background: var(--uml-header, rgba(37,99,235,.3));
  border-bottom: 2px solid rgba(255,255,255,.15);
  padding: 8px 16px; text-align: center;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem; color: white;
}
.uml-stereotype {
  font-size: .72rem; color: rgba(255,255,255,.6); display: block;
  font-family: 'JetBrains Mono', monospace; margin-bottom: 2px;
}
.uml-section {
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: rgba(255,255,255,.7);
  line-height: 1.8;
}
.uml-section:last-child { border-bottom: none; }
.uml-section .attr-vis { color: var(--cyan); margin-right: 3px; }
.uml-section .attr-name { color: white; }
.uml-section .attr-type { color: var(--amber); }
.uml-section .method-return { color: var(--green); }

.diagram-canvas {
  background: rgba(0,0,0,.25); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.07);
  padding: 32px; overflow-x: auto;
  position: relative;
}

/* SVG diagrams */
.uml-svg { overflow: visible; }
.uml-svg text { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.uml-svg .class-header { fill: rgba(37,99,235,.4); }
.uml-svg .class-body   { fill: rgba(255,255,255,.04); }
.uml-svg .class-border { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 1.5; }
.uml-svg .class-label  { fill: white; font-weight: 700; font-size: 13px; }
.uml-svg .attr-text    { fill: rgba(255,255,255,.7); font-size: 11px; }
.uml-svg .type-text    { fill: #fbbf24; font-size: 11px; }
.uml-svg .line-solid   { stroke: rgba(255,255,255,.5); stroke-width: 1.5; fill: none; }
.uml-svg .line-dashed  { stroke: rgba(255,255,255,.5); stroke-width: 1.5; fill: none; stroke-dasharray: 6 4; }
.uml-svg .arrow-open   { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.uml-svg .arrow-filled { fill: rgba(255,255,255,.5); stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.uml-svg .arrow-empty  { fill: rgba(10,15,30,1); stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.uml-svg .diamond-empty  { fill: rgba(10,15,30,1); stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.uml-svg .diamond-filled { fill: rgba(255,255,255,.6); stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.uml-svg .line-label   { fill: var(--cyan); font-size: 11px; font-weight: 600; font-family: 'Syne', sans-serif; }
.uml-svg .mult-label   { fill: rgba(255,255,255,.55); font-size: 11px; }

/* ═══════════════════════════════════════════════
   COMPONENTS — RELATION TABS
═══════════════════════════════════════════════ */
.rel-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px;
}
.rel-tab {
  padding: 8px 18px; border-radius: 30px; border: 1.5px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04); color: rgba(255,255,255,.55);
  cursor: pointer; font-family: 'Syne', sans-serif; font-weight: 700; font-size: .8rem;
  transition: all .2s; white-space: nowrap;
}
.rel-tab:hover { border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.85); }
.rel-tab.active {
  background: linear-gradient(135deg, rgba(37,99,235,.4), rgba(6,182,212,.25));
  border-color: rgba(6,182,212,.4); color: white;
}
.rel-panel { display: none; animation: fadeSlide .3s ease; }
.rel-panel.active { display: block; }

@keyframes fadeSlide { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ═══════════════════════════════════════════════
   COMPONENTS — INFO PANELS
═══════════════════════════════════════════════ */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.info-panel {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r); padding: 24px;
}
.info-panel h3 { font-size: 1.05rem; font-weight: 700; color: white; margin-bottom: 10px; }
.info-panel h4 { font-size: .9rem; font-weight: 700; color: rgba(255,255,255,.8); margin-bottom: 8px; }
.info-panel p  { font-size: .88rem; color: rgba(255,255,255,.6); line-height: 1.75; margin-bottom: 10px; }
.info-panel ul { padding-left: 16px; margin-bottom: 10px; }
.info-panel li { font-size: .87rem; color: rgba(255,255,255,.6); margin-bottom: 5px; line-height: 1.6; }
.info-panel li strong { color: rgba(255,255,255,.9); }

.tip-box {
  border-radius: var(--r-sm); padding: 14px 16px; margin-top: 14px;
  border-left: 3px solid var(--tip-color, var(--cyan));
  background: rgba(6,182,212,.08);
  font-size: .85rem; color: rgba(255,255,255,.7); line-height: 1.65;
}
.tip-box strong { color: var(--tip-color, var(--cyan)); }

.highlight-box {
  border-radius: var(--r-sm); padding: 16px 18px;
  background: var(--hl-bg, rgba(37,99,235,.12));
  border: 1px solid var(--hl-border, rgba(37,99,235,.25));
  margin-bottom: 16px;
}
.highlight-box .hl-title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .85rem;
  color: var(--hl-color, var(--sky)); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.highlight-box p { font-size: .85rem; color: rgba(255,255,255,.65); line-height: 1.65; margin: 0; }

/* ═══════════════════════════════════════════════
   COMPONENTS — NOTATION TABLE
═══════════════════════════════════════════════ */
.notation-table {
  width: 100%; border-collapse: collapse; margin-top: 8px;
}
.notation-table th {
  background: rgba(37,99,235,.2); border: 1px solid rgba(255,255,255,.08);
  padding: 11px 14px; font-family: 'Syne', sans-serif; font-size: .82rem;
  font-weight: 700; color: var(--sky); text-align: left;
}
.notation-table td {
  border: 1px solid rgba(255,255,255,.06); padding: 11px 14px;
  font-size: .855rem; color: rgba(255,255,255,.65); vertical-align: middle;
}
.notation-table tr:hover td { background: rgba(255,255,255,.03); }
.notation-table td:first-child { font-weight: 600; color: rgba(255,255,255,.85); }
.notation-table td code {
  background: rgba(6,182,212,.12); border: 1px solid rgba(6,182,212,.2);
  border-radius: 4px; padding: 2px 7px; font-size: .8rem; color: var(--cyan);
}
.notation-table td .arrow-demo { display: inline-flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════════════
   COMPONENTS — STEREOTYPE CARDS
═══════════════════════════════════════════════ */
.stereo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.stereo-card {
  background: rgba(255,255,255,.04); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.08); padding: 18px 16px;
  transition: transform .2s, border-color .2s; cursor: default;
}
.stereo-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.18); }
.stereo-name {
  font-family: 'JetBrains Mono', monospace; font-size: .82rem; font-weight: 600;
  color: var(--cyan); margin-bottom: 6px;
  background: rgba(6,182,212,.12); border: 1px solid rgba(6,182,212,.2);
  border-radius: 6px; padding: 4px 10px; display: inline-block;
}
.stereo-title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem; color: white; margin-bottom: 6px;
}
.stereo-desc { font-size: .82rem; color: rgba(255,255,255,.55); line-height: 1.6; }
.stereo-example {
  margin-top: 10px; font-size: .78rem; color: rgba(255,255,255,.4);
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,.04); padding: 6px 10px; border-radius: 6px;
}

/* ═══════════════════════════════════════════════
   COMPONENTS — MULTIPLICITY
═══════════════════════════════════════════════ */
.mult-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.mult-card {
  background: rgba(255,255,255,.04); border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.08); padding: 16px 14px; text-align: center;
}
.mult-symbol {
  font-family: 'JetBrains Mono', monospace; font-size: 1.6rem; font-weight: 700;
  color: var(--amber); margin-bottom: 6px; display: block;
}
.mult-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: .82rem; color: white; margin-bottom: 4px; }
.mult-desc { font-size: .78rem; color: rgba(255,255,255,.5); line-height: 1.55; }

/* ═══════════════════════════════════════════════
   COMPONENTS — ACCORDION
═══════════════════════════════════════════════ */
.accordion { display: flex; flex-direction: column; gap: 8px; }
.acc-item {
  background: rgba(255,255,255,.04); border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.07); overflow: hidden;
}
.acc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; cursor: pointer; user-select: none;
  transition: background .2s;
}
.acc-header:hover { background: rgba(255,255,255,.04); }
.acc-header.open  { background: rgba(37,99,235,.12); }
.acc-title {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .92rem; color: white;
}
.acc-chevron { color: rgba(255,255,255,.4); font-size: .8rem; transition: transform .3s; }
.acc-header.open .acc-chevron { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.acc-body.open { max-height: 800px; }
.acc-content { padding: 0 18px 18px; }
.acc-content p { font-size: .87rem; color: rgba(255,255,255,.6); line-height: 1.7; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════
   COMPONENTS — QUIZ (same style as previous)
═══════════════════════════════════════════════ */
.quiz-wrap {
  background: rgba(255,255,255,.04); border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.08); padding: 36px;
}
.quiz-topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.quiz-bar-bg { flex: 1; height: 7px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.quiz-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-mid), var(--cyan)); border-radius: 4px; transition: width .4s ease; }
.quiz-counter { font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem; color: white; white-space: nowrap; }
.quiz-q-label { font-size: .8rem; color: var(--gray-muted); margin-bottom: 6px; }
.quiz-q-text  { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; color: white; margin-bottom: 22px; line-height: 1.45; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  padding: 13px 18px; border-radius: var(--r-sm);
  border: 1.5px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
  cursor: pointer; text-align: left; font-family: 'DM Sans', sans-serif;
  font-size: .92rem; color: rgba(255,255,255,.75); transition: all .2s;
}
.quiz-opt:hover:not(:disabled) { border-color: rgba(6,182,212,.4); background: rgba(6,182,212,.08); color: white; }
.quiz-opt.correct { border-color: var(--green); background: rgba(16,185,129,.15); color: #6ee7b7; }
.quiz-opt.wrong   { border-color: var(--rose);  background: rgba(244,63,94,.12);  color: #fda4af; }
.quiz-opt:disabled { cursor: default; }
.quiz-fb {
  margin-top: 14px; padding: 12px 16px; border-radius: var(--r-sm);
  font-size: .88rem; display: none; line-height: 1.6;
}
.quiz-fb.correct { display: block; background: rgba(16,185,129,.12); color: #6ee7b7; border-left: 3px solid var(--green); }
.quiz-fb.wrong   { display: block; background: rgba(244,63,94,.1);   color: #fda4af; border-left: 3px solid var(--rose); }
.quiz-next {
  margin-top: 18px; padding: 11px 28px; border-radius: 30px;
  background: linear-gradient(135deg, var(--blue-mid), var(--cyan));
  color: white; border: none; cursor: pointer; font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: .95rem; display: none; transition: opacity .2s;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.quiz-next:hover { opacity: .9; }
.quiz-next.show  { display: inline-block; }
.quiz-result { display: none; text-align: center; animation: fadeSlide .4s ease; }
.quiz-result.show { display: block; }
.score-big { font-family: 'Syne', sans-serif; font-size: 4.5rem; font-weight: 800; color: white; line-height: 1; }
.score-sub { font-size: 1rem; color: rgba(255,255,255,.55); margin: 8px 0 20px; }
.score-bar-bg { height: 12px; background: rgba(255,255,255,.08); border-radius: 6px; max-width: 400px; margin: 0 auto 10px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 6px; transition: width 1.2s ease; }
.score-msg { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 24px; }
.quiz-restart {
  padding: 12px 32px; border-radius: 30px;
  background: linear-gradient(135deg, var(--blue-mid), var(--cyan));
  color: white; border: none; cursor: pointer; font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}

/* ═══════════════════════════════════════════════
   SECTION TITLES INSIDE PAGES
═══════════════════════════════════════════════ */
.section-title {
  font-size: 1.2rem; font-weight: 800; color: white;
  margin-bottom: 6px; margin-top: 36px; display: flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif;
}
.section-title:first-child { margin-top: 0; }
.section-sub { font-size: .85rem; color: rgba(255,255,255,.45); margin-bottom: 20px; margin-left: 2px; }
.section-divider {
  height: 1px; background: rgba(255,255,255,.06); margin: 36px 0;
}

/* ═══════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════ */
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-h { display: flex; flex-direction: column; gap: 16px; }
.text-cyan   { color: var(--cyan); }
.text-amber  { color: var(--amber); }
.text-green  { color: var(--green); }
.text-muted  { color: rgba(255,255,255,.45); }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap   { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 11.5px;
  font-weight: 700; font-family: 'Syne', sans-serif;
}
.badge-blue   { background: rgba(37,99,235,.2); color: #93c5fd; border: 1px solid rgba(37,99,235,.3); }
.badge-cyan   { background: rgba(6,182,212,.15); color: #67e8f9; border: 1px solid rgba(6,182,212,.25); }
.badge-green  { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); }
.badge-amber  { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.badge-purple { background: rgba(139,92,246,.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,.25); }
.badge-rose   { background: rgba(244,63,94,.15);  color: #fda4af; border: 1px solid rgba(244,63,94,.25); }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #overlay.open { display: block; }
  #content-area { margin-left: 0; }
  #menu-toggle { display: flex; align-items: center; justify-content: center; }
  .page-hero { padding: 60px 24px 36px; }
  .page-body { padding: 32px 24px 48px; }
  .page-footer { padding: 18px 24px; }
  .info-grid { grid-template-columns: 1fr; }
  .cards-grid-2 { grid-template-columns: 1fr; }
  .cards-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .quiz-wrap { padding: 24px 18px; }
  .page-hero { padding: 60px 18px 28px; }
  .page-body { padding: 24px 18px 40px; }
  .page-footer { padding: 16px 18px; flex-wrap: wrap; gap: 10px; }
  .page-position { width: 100%; text-align: center; order: -1; }
}
