/* =========================================================================
   CodeKids — design system foundation
   Dark navy/graphite base, cyan/violet/lime accents, soft glow, rounded
   cards. Light animations only (no heavy/infinite effects).
   ========================================================================= */

:root {
  --ink: #0b1220;
  --surface: #121d35;
  --surface-2: #16213c;
  --line: #1e2a45;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --lime: #a3e635;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(139, 92, 246, 0.13), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(34, 211, 238, 0.1), transparent 55%),
    var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.muted {
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- Cards */

.card {
  background: linear-gradient(180deg, #131f38, #0f1830);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

.card-hover {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: #334155;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.6);
}

/* -------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #8b5cf6);
  color: #06121f;
  box-shadow: 0 4px 18px rgba(34, 211, 238, 0.25);
}

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

.btn-ghost {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.16);
}

.btn-outline {
  background: transparent;
  border-color: #334155;
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 0.6rem;
}

/* --------------------------------------------------------------- Forms */

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  background: #0d1526;
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

/* ------------------------------------------------------------- Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
}

.badge-violet {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}

.badge-lime {
  background: rgba(163, 230, 53, 0.15);
  color: #bef264;
}

.badge-muted {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

/* ------------------------------------------------------------ Progress */

.progress {
  height: 0.75rem;
  border-radius: 999px;
  background: #0d1526;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #8b5cf6);
  transition: width 0.5s ease;
}

.progress-fill-lime {
  background: linear-gradient(90deg, #a3e635, #22d3ee);
}

/* ------------------------------------------------------------- Glow */

.glow {
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15), 0 0 28px rgba(34, 211, 238, 0.18);
}

.glow-violet {
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.18), 0 0 28px rgba(139, 92, 246, 0.2);
}

.glow-text {
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}

/* --------------------------------------------------------- Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: rgba(13, 21, 38, 0.4);
}

.empty-state .icon {
  font-size: 2.5rem;
}

/* ----------------------------------------------------------- Sidebar */

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #fff;
}

.nav-link-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(139, 92, 246, 0.15));
  color: #fff;
}

/* --------------------------------------------------------- Notifications */

.alert {
  padding: 0.8rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.alert-success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}

.alert-info {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
  color: #a5f3fc;
}

.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

/* -------------------------------------------------------------- Callouts */

.callout {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}

.callout .callout-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.callout-info {
  border-left-color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
}

.callout-tip {
  border-left-color: #a3e635;
  background: rgba(163, 230, 53, 0.08);
}

.callout-warning {
  border-left-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.callout-important {
  border-left-color: #f472b6;
  background: rgba(244, 114, 182, 0.1);
}

.callout-success {
  border-left-color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}

.callout-danger {
  border-left-color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

/* ---------------------------------------------------------- Code blocks */

.code-block {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1rem 0;
}

.code-block .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: #0d1526;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: #0a0f1c;
  color: #e2e8f0;
  font-family: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* Pygments (dracula-inspired, light) */
.highlight .c, .highlight .c1, .highlight .cm { color: #64748b; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kt { color: #c4b5fd; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb { color: #bef264; }
.highlight .n { color: #e2e8f0; }
.highlight .nf, .highlight .nc { color: #67e8f9; }
.highlight .o, .highlight .p { color: #94a3b8; }
.highlight .m, .highlight .mi, .highlight .mf { color: #fcd34d; }
.highlight .nb, .highlight .bp { color: #f0abfc; }
.highlight .nd, .highlight .nn { color: #7dd3fc; }

/* --------------------------------------------------------- Video embed */

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------- Lesson blocks */

.lesson-block {
  margin: 1rem 0;
}

.lesson-heading {
  font-weight: 800;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.2;
}

/* --------------------------------------------------- Achievement rarity */

.rarity-badge-COMMON {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.rarity-badge-UNCOMMON {
  background: rgba(163, 230, 53, 0.15);
  color: #bef264;
}

.rarity-badge-RARE {
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
}

.rarity-badge-EPIC {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
}

.rarity-badge-LEGENDARY {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}

.rarity-card-EPIC {
  border-color: rgba(139, 92, 246, 0.4);
}

.rarity-card-LEGENDARY {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}

.optional-block {
  border: 1px dashed #334155;
  border-radius: 0.75rem;
  margin: 1rem 0;
  overflow: hidden;
}

