@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --accent: #f7c948;
  --accent2: #58a6ff;
  --accent3: #3fb950;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --red: #ff7b72;
  --purple: #d2a8ff;
  --sidebar-w: 280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* ── HEADINGS - Clean & Modern ── */
h1 {
  font-family: 'Inter', sans-serif;
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}
h1 .highlight { color: var(--accent); font-weight: 400; }

h2 {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin: 40px 0 16px;
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text);
  margin: 28px 0 12px;
}

h4 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 16px;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar-logo { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo a { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 18px; color: #000; flex-shrink: 0;
}
.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 18px;
  color: var(--text); line-height: 1.2; letter-spacing: -0.02em;
}
.logo-text span { color: var(--accent); }
.sidebar-search { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sidebar-search input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 12px; color: var(--text);
  font-size: 13px; font-family: 'Inter', sans-serif; outline: none; transition: border-color .2s;
}
.sidebar-search input:focus { border-color: var(--accent2); }
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-section {
  padding: 12px 16px 4px; font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); font-family: 'Inter', sans-serif;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; color: var(--text-muted);
  text-decoration: none; font-size: 14px; transition: all .15s;
  border-left: 2px solid transparent; margin: 1px 0;
}
.nav-item:hover { color: var(--text); background: var(--surface2); border-left-color: var(--border); }
.nav-item.active { color: var(--accent); background: rgba(247,201,72,.08); border-left-color: var(--accent); }
.nav-item .badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px;
  border-radius: 10px; font-family: 'JetBrains Mono', monospace;
}
.badge-beginner { background: rgba(63,185,80,.15); color: var(--accent3); }
.badge-intermediate { background: rgba(88,166,255,.15); color: var(--accent2); }
.badge-advanced { background: rgba(255,123,114,.15); color: var(--red); }

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

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0;
  background: rgba(13,17,23,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px; height: 56px;
  display: flex; align-items: center; justify-content: space-between; z-index: 90;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--accent2); text-decoration: none; }
.breadcrumb span { color: var(--border); }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.btn {
  padding: 6px 16px; border-radius: 6px; font-size: 13px;
  font-family: 'Inter', sans-serif; cursor: pointer; border: 1px solid var(--border);
  text-decoration: none; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: #e6b83a; }

/* ── CONTENT ── */
.content { max-width: 860px; margin: 0 auto; padding: 48px 40px 80px; }

/* ── HERO ── */
.hero { margin-bottom: 56px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(247,201,72,.1); border: 1px solid rgba(247,201,72,.2);
  border-radius: 20px; padding: 4px 12px; font-size: 12px;
  color: var(--accent); font-weight: 500; margin-bottom: 20px;
  font-family: 'JetBrains Mono', monospace;
}
.hero-sub { font-size: 18px; color: var(--text-muted); max-width: 600px; line-height: 1.6; font-weight: 300; }
.hero-meta { display: flex; gap: 24px; margin-top: 24px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.meta-item strong { color: var(--text); }

/* ── PROGRESS BAR ── */
.progress-bar { background: var(--surface2); border-radius: 4px; height: 4px; margin: 4px 0; }
.progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s;
}

/* ── CARDS ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 32px 0; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; text-decoration: none; color: var(--text);
  transition: all .2s; display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.card-icon { font-size: 24px; margin-bottom: 4px; }
.card-title { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.card-footer {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted);
}

/* ── ARTICLE ── */
.article h2 {
  font-family: 'Inter', sans-serif; font-size: 28px; font-weight: 400;
  letter-spacing: -0.02em; margin: 40px 0 16px; color: var(--text);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.article h3 {
  font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 500;
  letter-spacing: -0.01em; margin: 28px 0 12px; color: var(--text);
}
.article p { margin-bottom: 16px; color: var(--text-muted); }
.article p strong { color: var(--text); }
.article ul, .article ol { margin: 12px 0 20px 20px; color: var(--text-muted); }
.article li { margin-bottom: 6px; }

/* ── CODE BLOCKS ── */
.code-block { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; margin: 20px 0; overflow: hidden; }
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border);
  font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--text-muted);
}
.code-header .dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.copy-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 3px 10px; border-radius: 4px; font-size: 11px; cursor: pointer;
  transition: all .15s; font-family: 'JetBrains Mono', monospace;
}
.copy-btn:hover { background: var(--surface); color: var(--text); }
pre { padding: 20px; overflow-x: auto; font-family: 'JetBrains Mono', monospace; font-size: 14px; line-height: 1.7; }
code { font-family: 'JetBrains Mono', monospace; }
.article p code {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; font-size: 13px; color: var(--accent2);
}
.kw { color: var(--red); }
.fn { color: var(--accent2); }
.str { color: var(--accent3); }
.cm { color: var(--text-muted); font-style: italic; }
.num { color: var(--purple); }
.cls { color: var(--accent); }

/* ── CALLOUTS ── */
.callout { border-radius: 8px; padding: 16px 20px; margin: 20px 0; display: flex; gap: 12px; font-size: 14px; line-height: 1.6; }
.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout-info { background: rgba(88,166,255,.08); border-left: 3px solid var(--accent2); color: #c9d1d9; }
.callout-warn { background: rgba(247,201,72,.08); border-left: 3px solid var(--accent); color: #c9d1d9; }
.callout-tip  { background: rgba(63,185,80,.08);  border-left: 3px solid var(--accent3); color: #c9d1d9; }

/* ── QUIZ ── */
.quiz { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin: 32px 0; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.quiz-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  font-size: 14px; transition: all .15s; background: var(--surface2); color: var(--text-muted);
}
.quiz-option:hover { border-color: var(--accent2); color: var(--text); }
.quiz-option.correct { border-color: var(--accent3); background: rgba(63,185,80,.08); color: var(--accent3); }
.quiz-option.wrong { border-color: var(--red); background: rgba(255,123,114,.08); color: var(--red); }

/* ── PAGINATION ── */
.page-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.page-nav-btn {
  flex: 1; text-decoration: none; padding: 16px 20px; border: 1px solid var(--border);
  border-radius: 8px; display: flex; flex-direction: column; gap: 4px; transition: all .2s; max-width: 260px;
}
.page-nav-btn:hover { border-color: var(--accent); background: rgba(247,201,72,.04); }
.page-nav-btn.prev { align-items: flex-start; }
.page-nav-btn.next { align-items: flex-end; margin-left: auto; }
.nav-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.nav-title { font-size: 14px; font-weight: 500; color: var(--text); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: var(--surface2); padding: 10px 14px; text-align: left;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
td { padding: 10px 14px; border-bottom: 1px solid rgba(48,54,61,.5); color: var(--text-muted); }
tr:hover td { background: var(--surface2); }

/* ── HAMBURGER ── */
.hamburger {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 18px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .content { padding: 32px 20px 60px; }
  h1 { font-size: 32px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 20px; }
}
@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
  .page-nav { flex-direction: column; }
  .page-nav-btn.next { margin-left: 0; }
}
