/* ===================================================================
   Macumba Learning — Custom styles (Bootstrap 5 CDN base)
   =================================================================== */

/* ── Root variables ─────────────────────────────────────────────── */
:root {
  --ml-primary:   #6366f1;   /* indigo */
  --ml-secondary: #8b5cf6;   /* violet */
  --ml-accent:    #06b6d4;   /* cyan */
  --ml-dark:      #0f172a;
  --ml-surface:   #1e293b;
  --ml-border:    #334155;
  --ml-text:      #e2e8f0;
  --ml-muted:     #94a3b8;
  --ml-beginner:  #22c55e;
  --ml-intermediate: #f59e0b;
  --ml-advanced:  #ef4444;
  --ml-infra:     #06b6d4;
  --ml-frontend:  #8b5cf6;
  --ml-backend:   #f97316;
  --ml-general:   #6366f1;
}

/* ── Base ───────────────────────────────────────────────────────── */
body {
  background-color: var(--ml-dark);
  color: var(--ml-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: var(--ml-primary); }
a:hover { color: var(--ml-secondary); }

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  background: var(--ml-surface) !important;
  border-bottom: 1px solid var(--ml-border);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ml-primary) !important;
}

.nav-link {
  color: var(--ml-muted) !important;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ml-text) !important;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--ml-surface) 0%, #1a1035 100%);
  border-bottom: 1px solid var(--ml-border);
  padding: 5rem 0 4rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--ml-primary), var(--ml-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p.lead {
  color: var(--ml-muted);
  max-width: 580px;
}

/* ── Stats bar ──────────────────────────────────────────────────── */
.stats-bar {
  background: var(--ml-surface);
  border-bottom: 1px solid var(--ml-border);
  padding: 1rem 0;
}

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

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ml-primary);
  display: block;
  line-height: 1;
}

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

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--ml-surface);
  border: 1px solid var(--ml-border);
  border-radius: 12px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--ml-primary);
  transform: translateY(-2px);
}

.card-title { color: var(--ml-text); font-weight: 600; }
.card-text  { color: var(--ml-muted); font-size: 0.9rem; }

/* ── Learning-path card ─────────────────────────────────────────── */
.path-card {
  cursor: pointer;
}

.path-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.path-audience {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ml-accent);
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Lesson cards ───────────────────────────────────────────────── */
.lesson-card { text-decoration: none; display: block; }
.lesson-card:hover { text-decoration: none; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge-difficulty-beginner    { background: var(--ml-beginner);     color: #fff; }
.badge-difficulty-intermediate{ background: var(--ml-intermediate);  color: #fff; }
.badge-difficulty-advanced    { background: var(--ml-advanced);      color: #fff; }

.badge-module-infrastructure  { background: var(--ml-infra);    color: #fff; }
.badge-module-frontend        { background: var(--ml-frontend);  color: #fff; }
.badge-module-backend         { background: var(--ml-backend);   color: #fff; }
.badge-module-general         { background: var(--ml-general);   color: #fff; }

.badge { font-size: 0.7rem; font-weight: 600; padding: 0.3em 0.65em; border-radius: 6px; }

/* ── Filter bar ─────────────────────────────────────────────────── */
.filter-bar {
  background: var(--ml-surface);
  border-bottom: 1px solid var(--ml-border);
  padding: 0.875rem 0;
  position: sticky;
  top: 56px;
  z-index: 100;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--ml-border);
  color: var(--ml-muted);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  margin: 0 0.2rem 0.3rem;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--ml-primary);
  color: var(--ml-text);
  background: rgba(99, 102, 241, 0.12);
}

/* ── Lesson viewer ──────────────────────────────────────────────── */
.lesson-header {
  background: var(--ml-surface);
  border-bottom: 1px solid var(--ml-border);
  padding: 2rem 0 1.5rem;
}

.lesson-meta span { margin-right: 0.75rem; }

.lesson-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  line-height: 1.8;
}

.lesson-body h2,
.lesson-body h3 {
  color: var(--ml-text);
  margin-top: 2rem;
}

.lesson-body pre {
  background: var(--ml-dark);
  border: 1px solid var(--ml-border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
}

.lesson-body code {
  background: rgba(99, 102, 241, 0.15);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.875em;
  color: var(--ml-accent);
}

.lesson-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.lesson-body blockquote {
  border-left: 3px solid var(--ml-primary);
  padding-left: 1rem;
  color: var(--ml-muted);
  font-style: italic;
}

/* Prev/next navigation */
.lesson-nav {
  border-top: 1px solid var(--ml-border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.lesson-nav a {
  color: var(--ml-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.lesson-nav a:hover { color: var(--ml-secondary); }

/* ── Glossary ───────────────────────────────────────────────────── */
.glossary-alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 1rem 0;
}

.alpha-link {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  border: 1px solid var(--ml-border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ml-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.alpha-link:hover,
.alpha-link.has-terms {
  border-color: var(--ml-primary);
  color: var(--ml-text);
  background: rgba(99, 102, 241, 0.12);
}

.glossary-letter-section {
  margin-top: 2rem;
}

.glossary-letter-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ml-primary);
  border-bottom: 1px solid var(--ml-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.glossary-term-card {
  background: var(--ml-surface);
  border: 1px solid var(--ml-border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.glossary-term-header {
  cursor: pointer;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.glossary-term-header:hover { background: rgba(255,255,255,0.03); }

.glossary-term-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ml-text);
}

.glossary-term-body {
  padding: 0 1.25rem 1.25rem;
  color: var(--ml-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.glossary-term-body .example {
  background: var(--ml-dark);
  border-left: 3px solid var(--ml-accent);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-style: italic;
  font-size: 0.875rem;
}

/* ── Loading & empty states ─────────────────────────────────────── */
.spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  flex-direction: column;
  gap: 1rem;
  color: var(--ml-muted);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ml-muted);
}

.empty-state .empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  background: var(--ml-surface);
  border-top: 1px solid var(--ml-border);
  padding: 1.5rem 0;
  color: var(--ml-muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}

/* ── Utilities ──────────────────────────────────────────────────── */
.text-primary-ml { color: var(--ml-primary) !important; }
.text-muted-ml   { color: var(--ml-muted)   !important; }
.bg-surface      { background: var(--ml-surface) !important; }

@media (max-width: 576px) {
  .hero { padding: 3rem 0 2.5rem; }
}
