/* ============================================================
   AI-команда с нуля — Premium Dark UI
   Aesthetic: Refined dark luxury. Purple dominant, teal accents.
   Fonts: Outfit (display) + DM Sans (body) + Fira Code (mono)
   ============================================================ */

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

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  /* surfaces */
  --bg-base:      #09090b;
  --bg-surface:   #111114;
  --bg-raised:    #18181b;
  --bg-overlay:   #1c1c22;
  --bg-code:      #0c0c0f;

  /* borders */
  --border:       rgba(255,255,255,.06);
  --border-subtle:rgba(255,255,255,.03);
  --border-focus: rgba(139,92,246,.5);

  /* primary — purple family */
  --purple-50:  #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-300: #c4b5fd;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;

  /* accent — teal (sparingly) */
  --teal-400:   #2dd4bf;
  --teal-500:   #14b8a6;

  /* semantic */
  --green:      #34d399;
  --orange:     #fb923c;
  --red:        #f87171;
  --blue:       #60a5fa;

  /* text — boosted contrast for readability */
  --text-primary:    rgba(255,255,255,.88);
  --text-secondary:  rgba(255,255,255,.58);
  --text-muted:      rgba(255,255,255,.32);
  --text-heading:    #ffffff;

  /* glows */
  --glow-sm: 0 0 20px rgba(139,92,246,.15);
  --glow-md: 0 0 40px rgba(139,92,246,.12);
  --glow-lg: 0 4px 60px rgba(139,92,246,.15);

  /* layout */
  --sidebar-w:   272px;
  --radius:      8px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --ease:        cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── Light Theme ───────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:      #f8f9fc;
  --bg-surface:   #ffffff;
  --bg-raised:    #f0f1f5;
  --bg-overlay:   #e8e9ef;
  --bg-code:      #f5f5f8;

  --border:       rgba(0,0,0,.08);
  --border-subtle:rgba(0,0,0,.04);
  --border-focus: rgba(139,92,246,.4);

  --text-primary:    rgba(0,0,0,.85);
  --text-secondary:  rgba(0,0,0,.5);
  --text-muted:      rgba(0,0,0,.3);
  --text-heading:    #111;

  --glow-sm: 0 0 20px rgba(139,92,246,.08);
  --glow-md: 0 0 40px rgba(139,92,246,.06);
  --glow-lg: 0 4px 60px rgba(139,92,246,.08);
}

[data-theme="light"] .sidebar {
  box-shadow: 2px 0 12px rgba(0,0,0,.04);
}

[data-theme="light"] .code-block code {
  color: var(--purple-700);
}

[data-theme="light"] .accordion-item {
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

[data-theme="light"] .callout.tip { background: rgba(52,211,153,.12); }
[data-theme="light"] .callout.warning { background: rgba(251,146,60,.12); }
[data-theme="light"] .callout.important { background: rgba(139,92,246,.09); }
[data-theme="light"] .callout.danger { background: rgba(248,113,113,.12); }

[data-theme="light"] .styled-table thead tr { background: rgba(139,92,246,.06); }
[data-theme="light"] .styled-table td { border-bottom-color: rgba(0,0,0,.1); }
[data-theme="light"] .styled-table tbody tr:hover { background: rgba(139,92,246,.06); }

/* Light: h4 contrast fix */
[data-theme="light"] h4 { color: var(--purple-600); }

/* Light: copy button visibility */
[data-theme="light"] .copy-btn {
  color: var(--purple-600);
  border-color: rgba(139,92,246,.25);
  background: rgba(139,92,246,.04);
}
[data-theme="light"] .copy-btn:hover {
  border-color: var(--purple-500);
  background: rgba(139,92,246,.1);
}

/* Light: code header separation */
[data-theme="light"] .code-header {
  background: rgba(0,0,0,.04);
  border-bottom-color: rgba(0,0,0,.07);
}

/* Light: theme toggle label contrast */
[data-theme="light"] .theme-toggle-label { color: var(--text-secondary); }

/* Light: secondary button visibility */
[data-theme="light"] .btn-secondary {
  border-color: rgba(0,0,0,.15);
  color: rgba(0,0,0,.7);
}

[data-theme="light"] ::selection {
  background: rgba(139,92,246,.2);
  color: #000;
}

[data-theme="light"] .lesson-status { border-color: rgba(0,0,0,.2); }
[data-theme="light"] .lesson-status.completed { background: var(--green); border-color: var(--green); }
[data-theme="light"] .lesson-status.completed::after { border-color: #fff; }

/* Light: scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); }
[data-theme="light"] * { scrollbar-color: rgba(0,0,0,.12) transparent; }

/* Light: progress track */
[data-theme="light"] .progress-track { background: rgba(0,0,0,.08); }

/* Light: hover effects */
[data-theme="light"] .accordion-header:hover { background: rgba(0,0,0,.03); }
[data-theme="light"] .lesson-item:hover { background: rgba(139,92,246,.05); color: var(--purple-600); }
[data-theme="light"] .module-header:hover { background: rgba(139,92,246,.04); }

/* Light: tab active */
[data-theme="light"] .tab.active { background: var(--purple-500); box-shadow: 0 2px 12px rgba(139,92,246,.2); }

/* Light: table hover */
[data-theme="light"] .styled-table tbody tr:hover { background: rgba(139,92,246,.04); }

/* Light: chevron visibility */
[data-theme="light"] .module-header .chevron { opacity: .5; }

/* Focus visible for accessibility */
.btn:focus-visible { outline: 2px solid var(--purple-400); outline-offset: 3px; }

/* Callout code spacing */
.callout-content code { display: inline-block; margin-bottom: .35rem; }

/* Code block scroll indicator */
.code-block pre { position: relative; }

/* Smooth theme transitions */
.sidebar, .main-content, .accordion-item, .code-block, .callout,
.tab-bar, .tab, .btn, .styled-table, .breadcrumbs {
  transition: background .3s, color .3s, border-color .3s, box-shadow .3s;
}

/* ── Theme Toggle ──────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.theme-toggle-label {
  font-size: .6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

.theme-switch {
  position: relative;
  width: 44px;
  height: 24px;
  margin-left: auto;
}

.theme-switch input { display: none; }

.theme-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .3s var(--ease);
}

.theme-slider::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--purple-500);
  border-radius: 50%;
  transition: transform .3s var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(20px);
  background: var(--orange);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

::selection {
  background: rgba(139,92,246,.3);
  color: #fff;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.08) transparent; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s var(--ease);
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  letter-spacing: -.01em;
}

.sidebar-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  flex-shrink: 0;
  box-shadow: var(--glow-sm);
}

/* ── Progress ──────────────────────────────────────────────── */
.progress-bar-wrap {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .6875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,.05);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-600), var(--purple-400));
  border-radius: 2px;
  transition: width .8s var(--ease);
}

/* ── Nav ───────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.module-item { margin-bottom: 1px; }

.module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: all .2s var(--ease);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.module-header:hover {
  background: rgba(139,92,246,.06);
  color: var(--purple-300);
}

.module-header .module-icon {
  font-size: .875rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.module-header .chevron {
  margin-left: auto;
  font-size: .625rem;
  opacity: .3;
  transition: transform .3s var(--ease), opacity .2s;
  flex-shrink: 0;
}

.module-item.open .module-header .chevron {
  transform: rotate(90deg);
  opacity: .6;
}

.module-item.open .module-header {
  color: var(--purple-300);
}

.module-lessons {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
}

.module-item.open .module-lessons {
  max-height: 1200px;
}

/* ── Lesson Items ──────────────────────────────────────────── */
.lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px 9px 48px;
  font-size: .8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all .2s var(--ease);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.lesson-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
  transition: background .2s;
}

.lesson-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.02);
}

.lesson-item.active {
  color: var(--purple-300);
  background: rgba(139,92,246,.08);
}

.lesson-item.active::before {
  background: var(--purple-500);
  box-shadow: 0 0 8px rgba(139,92,246,.4);
}

.lesson-status {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  flex-shrink: 0;
  transition: all .2s;
  position: relative;
}

.lesson-status.in-progress {
  border-color: var(--orange);
  background: linear-gradient(90deg, var(--orange) 50%, transparent 50%);
}

.lesson-status.completed {
  border-color: var(--green);
  background: var(--green);
}

.lesson-status.completed::after {
  content: '';
  position: absolute;
  top: 1px; left: 3px;
  width: 3px; height: 6px;
  border: solid var(--bg-surface);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.lesson-name {
  font-size: .8125rem;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.content-wrapper {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-weight: 500;
}

.breadcrumbs .crumb {
  cursor: pointer;
  transition: color .2s;
}

.breadcrumbs .crumb:hover { color: var(--purple-400); }
.breadcrumbs .crumb.current { color: var(--text-secondary); cursor: default; }
.breadcrumbs .crumb-sep { font-size: .5rem; opacity: .4; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -.01em;
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
}

h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 2rem 0 .75rem;
}

h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple-300);
  margin: 1.5rem 0 .5rem;
}

p { margin-bottom: 1rem; }

a {
  color: var(--purple-400);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: var(--purple-300); }

strong { color: var(--text-heading); font-weight: 600; }

code {
  font-family: 'Fira Code', monospace;
  font-size: .85em;
  background: var(--bg-raised);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--purple-300);
  border: 1px solid var(--border);
}

ol, ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
li { margin-bottom: .35rem; }

/* ============================================================
   TAB BAR
   ============================================================ */
.tab-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 2rem;
  background: var(--bg-raised);
  border-radius: var(--radius-lg);
  padding: 4px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-lg) - 3px);
  cursor: pointer;
  transition: all .25s var(--ease);
  letter-spacing: .01em;
}

.tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.04);
}

.tab.active {
  color: #fff;
  background: var(--purple-600);
  box-shadow: 0 2px 12px rgba(139,92,246,.3);
}

/* ============================================================
   TAB CONTENT
   ============================================================ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn .25s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   ACCORDIONS (Roadmap Steps)
   ============================================================ */
.accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all .3s var(--ease);
}

.accordion-item:hover {
  border-color: rgba(139,92,246,.15);
}

.accordion-item.open {
  border-color: rgba(139,92,246,.2);
  box-shadow: var(--glow-sm);
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
  transition: background .2s;
}

.accordion-header:hover {
  background: rgba(255,255,255,.02);
}

.accordion-chevron {
  font-size: .625rem;
  color: var(--text-muted);
  transition: transform .3s var(--ease);
  flex-shrink: 0;
}

.accordion-item.open .accordion-chevron {
  transform: rotate(90deg);
  color: var(--purple-400);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
  border-radius: 8px;
  font-size: .6875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .02em;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
  padding: 0 20px;
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
  padding: 0 20px 20px;
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.code-block {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-family: 'Fira Code', monospace;
  font-size: .6875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.copy-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: .6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all .2s;
}

.copy-btn:hover {
  color: var(--purple-300);
  border-color: var(--purple-500);
  background: rgba(139,92,246,.08);
}

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

.code-block pre {
  padding: 14px 18px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: 'Fira Code', monospace;
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--purple-200);
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* ============================================================
   CALLOUTS
   ============================================================ */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  border-left: 3px solid;
  font-size: .9rem;
  line-height: 1.6;
}

.callout-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.callout-content { flex: 1; }
.callout-content p { margin-bottom: .5rem; }
.callout-content p:last-child { margin-bottom: 0; }

.callout.tip {
  background: rgba(52,211,153,.06);
  border-color: var(--green);
}

.callout.warning {
  background: rgba(251,146,60,.06);
  border-color: var(--orange);
}

.callout.important {
  background: rgba(139,92,246,.06);
  border-color: var(--purple-500);
}

.callout.danger {
  background: rgba(248,113,113,.06);
  border-color: var(--red);
}

/* ============================================================
   OS TABS (inside accordions)
   ============================================================ */
.os-tabs {
  margin: 1rem 0;
}

.os-tab-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.os-tab-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
}

.os-tab-btn:hover {
  border-color: var(--purple-500);
  color: var(--purple-300);
}

.os-tab-btn.active {
  background: var(--purple-600);
  border-color: var(--purple-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,92,246,.25);
}

.os-tab-panel { display: none; }
.os-tab-panel.active { display: block; animation: fadeUp .3s var(--ease); }

/* ============================================================
   TABLES
   ============================================================ */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .875rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.styled-table thead tr {
  background: rgba(139,92,246,.1);
}

.styled-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: .8125rem;
  color: var(--purple-300);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}

.styled-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.styled-table tbody tr {
  transition: background .15s;
}

.styled-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}

.styled-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  font-size: .9rem;
  transition: opacity .2s;
}

.checklist-check { display: none; }

.checklist-box {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 6px;
  flex-shrink: 0;
  transition: all .25s var(--ease-spring);
  position: relative;
}

.checklist-check:checked ~ .checklist-box {
  background: var(--purple-600);
  border-color: var(--purple-600);
  box-shadow: 0 0 12px rgba(139,92,246,.3);
}

.checklist-check:checked ~ .checklist-box::after {
  content: '';
  position: absolute;
  top: 3px; left: 6px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist-check:checked ~ .checklist-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all .25s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: #fff;
  box-shadow: 0 4px 16px rgba(139,92,246,.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(139,92,246,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--purple-500);
  background: rgba(139,92,246,.06);
}

/* ============================================================
   LESSON NAV (prev/next)
   ============================================================ */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   HAMBURGER (mobile)
   ============================================================ */
.hamburger {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  width: 40px; height: 40px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background .2s;
}

.hamburger:hover { background: var(--bg-overlay); }

.hamburger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all .3s var(--ease);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 90;
}

.sidebar-overlay.visible { display: block; }

/* ============================================================
   LOADING
   ============================================================ */
.loading {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: .875rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
  50%      { box-shadow: 0 0 20px rgba(139,92,246,.15); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .content-wrapper {
    padding: 32px 28px 60px;
  }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,.5);
  }

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 24px 20px 60px;
    padding-top: 64px;
  }

  h1 { font-size: 1.5rem; }

  .tab-bar {
    flex-direction: column;
  }

  .lesson-nav {
    flex-direction: column;
    gap: 12px;
  }

  .lesson-nav .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .hamburger, .sidebar-overlay, .tab-bar, .lesson-nav { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: #fff; color: #000; }
  h1, h2, h3 { color: #000; }
  .code-block { border: 1px solid #ccc; }
}
