/* ============================================================
   Java & Kotlin Roadmap — Main Stylesheet
   Theme: Catppuccin Mocha (dark) / Latte (light)
   ============================================================ */

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

html { scroll-behavior: smooth; }

/* ---------- Theme Variables ---------- */
:root {
  --bg-base:       #1e1e2e;
  --bg-mantle:     #181825;
  --bg-crust:      #11111b;
  --bg-surface0:   #313244;
  --bg-surface1:   #45475a;
  --bg-surface2:   #585b70;
  --text-primary:  #cdd6f4;
  --text-secondary:#a6adc8;
  --text-muted:    #6c7086;
  --accent-blue:   #89b4fa;
  --accent-mauve:  #cba6f7;
  --accent-green:  #a6e3a1;
  --accent-red:    #f38ba8;
  --accent-yellow: #f9e2af;
  --accent-peach:  #fab387;
  --accent-teal:   #94e2d5;
  --border:        #313244;
  --border-hover:  #45475a;
  --shadow:        rgba(0,0,0,0.4);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --transition:    0.2s ease;
}

[data-theme="light"] {
  --bg-base:       #eff1f5;
  --bg-mantle:     #e6e9ef;
  --bg-crust:      #dce0e8;
  --bg-surface0:   #ccd0da;
  --bg-surface1:   #bcc0cc;
  --bg-surface2:   #acb0be;
  --text-primary:  #4c4f69;
  --text-secondary:#5c5f77;
  --text-muted:    #9ca0b0;
  --accent-blue:   #1e66f5;
  --accent-mauve:  #8839ef;
  --accent-green:  #40a02b;
  --accent-red:    #d20f39;
  --accent-yellow: #df8e1d;
  --accent-peach:  #fe640b;
  --accent-teal:   #179299;
  --border:        #ccd0da;
  --border-hover:  #bcc0cc;
  --shadow:        rgba(0,0,0,0.1);
}

/* ---------- Body ---------- */
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

main { flex: 1; }

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-mauve); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--bg-mantle);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--accent-blue); }

.nav-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-mauve));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-surface0);
  color: var(--text-primary);
}
.nav-links a.active {
  color: var(--accent-blue);
}

.nav-spacer { flex: 1; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}
.btn-icon:hover {
  background: var(--bg-surface0);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ---------- Page Container ---------- */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-blue);
  color: #1e1e2e;
}
.btn-primary:hover {
  background: var(--accent-mauve);
  color: #1e1e2e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
  background: var(--bg-surface0);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-surface1);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}
.btn-outline:hover {
  background: var(--accent-blue);
  color: #1e1e2e;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px var(--shadow);
  transform: translateY(-2px);
}

.card-sm { padding: 16px; }
.card-lg { padding: 32px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-blue   { background: rgba(137,180,250,0.15); color: var(--accent-blue);   }
.badge-mauve  { background: rgba(203,166,247,0.15); color: var(--accent-mauve);  }
.badge-green  { background: rgba(166,227,161,0.15); color: var(--accent-green);  }
.badge-red    { background: rgba(243,139,168,0.15); color: var(--accent-red);    }
.badge-yellow { background: rgba(249,226,175,0.15); color: var(--accent-yellow); }
.badge-peach  { background: rgba(250,179,135,0.15); color: var(--accent-peach);  }

.badge-level-1 { background: rgba(166,227,161,0.15); color: var(--accent-green);  }
.badge-level-2 { background: rgba(249,226,175,0.15); color: var(--accent-yellow); }
.badge-level-3 { background: rgba(250,179,135,0.15); color: var(--accent-peach);  }
.badge-level-4 { background: rgba(243,139,168,0.15); color: var(--accent-red);    }

.badge-java   { background: rgba(137,180,250,0.15); color: var(--accent-blue);   }
.badge-kotlin { background: rgba(203,166,247,0.15); color: var(--accent-mauve);  }
.badge-both   { background: rgba(148,226,213,0.15); color: var(--accent-teal);   }

/* ---------- Progress Bar ---------- */
.progress-bar {
  height: 4px;
  background: var(--bg-surface1);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-mauve));
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ---------- Tag / Level Indicator ---------- */
.level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- Search Input ---------- */
.search-wrapper {
  position: relative;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-blue); }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

/* ---------- Accordion ---------- */
.accordion { display: flex; flex-direction: column; gap: 8px; }

.accordion-item {
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}
.accordion-item:hover { border-color: var(--border-hover); }
.accordion-item.open { border-color: var(--border-hover); }

.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.accordion-header:hover { background: var(--bg-surface1); }

.accordion-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.accordion-title {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
}

.accordion-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

.accordion-progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-item.open .accordion-body { max-height: 2000px; }

.accordion-content {
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- Chapter Row in Accordion ---------- */
.chapter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
}
.chapter-row:hover { background: var(--bg-surface1); }

.chapter-row-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  background: transparent;
  cursor: pointer;
}
.chapter-row-check.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #1e1e2e;
}

.chapter-row-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
}
.chapter-row.completed .chapter-row-title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.chapter-row-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chapter-row-level {
  flex-shrink: 0;
}

/* ---------- Graph Page ---------- */
.graph-page {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.graph-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-mantle);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.graph-sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.graph-legend { display: flex; flex-direction: column; gap: 6px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.legend-item:hover { background: var(--bg-surface0); color: var(--text-primary); }
.legend-item.dimmed { opacity: 0.4; }

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.graph-stats { display: flex; flex-direction: column; gap: 8px; }

.graph-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}
.graph-stat-label { color: var(--text-muted); }
.graph-stat-value { color: var(--text-primary); font-weight: 600; }

.graph-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.graph-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#graph-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graph-canvas:active { cursor: grabbing; }

.graph-tooltip {
  position: absolute;
  background: var(--bg-crust);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 220px;
  z-index: 10;
  box-shadow: 0 4px 12px var(--shadow);
}
.graph-tooltip.visible { opacity: 1; }

.tooltip-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.tooltip-category {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tooltip-status {
  font-size: 0.72rem;
  font-weight: 500;
}
.tooltip-status.done { color: var(--accent-green); }
.tooltip-status.todo { color: var(--text-muted); }

.graph-search-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

/* ---------- Chapter Page ---------- */
.chapter-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

.chapter-main { min-width: 0; }

.chapter-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb-sep { color: var(--border-hover); }
.breadcrumb-current { color: var(--text-secondary); }

/* Chapter Header */
.chapter-header { margin-bottom: 32px; }

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chapter-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}

.chapter-subtitle {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.chapter-complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-green);
  background: transparent;
  color: var(--accent-green);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.chapter-complete-btn:hover,
.chapter-complete-btn.done {
  background: var(--accent-green);
  color: #1e1e2e;
}

/* Levels Tabs */
.level-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-surface0);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.level-tab {
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: none;
  background: transparent;
  font-family: var(--font-body);
}
.level-tab.active {
  background: var(--bg-base);
  color: var(--text-primary);
  box-shadow: 0 1px 4px var(--shadow);
}
.level-tab:hover:not(.active) { color: var(--text-primary); }

/* Level Content */
.level-content { display: none; }
.level-content.active { display: block; }

.skills-section { margin-bottom: 24px; }

.skills-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.skills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface0);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: border-color var(--transition);
}
.skill-item:hover { border-left-color: var(--accent-blue); }

.skill-item.optional {
  opacity: 0.75;
  border-left-color: var(--border);
}
.skill-item.optional:hover { border-left-color: var(--accent-yellow); }

.skill-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 6px;
}
.skill-item.optional .skill-bullet { background: var(--text-muted); }

/* Resources Section */
.resources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface0);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.resource-item:hover {
  background: var(--bg-surface1);
  color: var(--text-primary);
}

.resource-type-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.resource-title { flex: 1; }

/* Sidebar Cards */
.sidebar-card {
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.sidebar-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.related-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}
.related-item a:hover {
  background: var(--bg-surface1);
  color: var(--text-primary);
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.chapter-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition);
  max-width: 48%;
}
.chapter-nav-btn:hover {
  background: var(--bg-surface1);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.chapter-nav-btn.next { margin-left: auto; text-align: right; flex-direction: row-reverse; }

.chapter-nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: block;
}

/* ---------- Home Page ---------- */
.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 50%, var(--accent-mauve) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Feature Grid */
.feature-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Tracks section */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.track-card {
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.track-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.track-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.track-card.java::before { background: linear-gradient(90deg, #89b4fa, #74c7ec); }
.track-card.kotlin::before { background: linear-gradient(90deg, #cba6f7, #89b4fa); }

.track-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.track-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.track-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.topic-tag {
  padding: 3px 10px;
  background: var(--bg-surface1);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ---------- Progress Section ---------- */
.progress-overview {
  background: var(--bg-surface0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 40px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.progress-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-mantle);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Loader ---------- */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state-desc  { font-size: 0.875rem; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .chapter-layout {
    grid-template-columns: 1fr;
  }
  .chapter-sidebar {
    position: static;
    order: -1;
  }
  .graph-sidebar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .page-container { padding: 24px 16px; }
  .hero { padding: 48px 16px 40px; }
  .hero-stats { gap: 24px; }

  .nav-links { display: none; }

  .graph-page { flex-direction: column; }
  .graph-sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
  }
  .graph-main { height: calc(100vh - 260px - 60px); }

  .chapter-layout { padding: 24px 16px; }
  .level-tabs { width: 100%; }
  .level-tab { flex: 1; text-align: center; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
