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

body {
  font-family: 'Geist', system-ui, sans-serif;
}

/* ── Terminal cursor ──────────────────────────────────────────────────────── */
.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: #4ade80;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Terminal font rendering (consistent between input and output lines) ──── */
.terminal-body {
  font-variant-ligatures: none;
  font-feature-settings: 'liga' 0, 'calt' 0;
}

/* ── Terminal scrollbar (always dark — terminal stays dark) ──────────────── */
.terminal-body::-webkit-scrollbar       { width: 4px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* ── Feedback animations ──────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  60%       { transform: translateX(5px); }
  80%       { transform: translateX(-3px); }
}

.animate-fade-in { animation: fadeIn 0.25s ease; }
.animate-shake   { animation: shake 0.35s ease; }

/* ── Demo terminal (landing page) ────────────────────────────────────────── */
.demo-line {
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

/* ── Sidebar active item left border trick ───────────────────────────────── */
.lesson-active {
  border-left: 2px solid #4ade80;
  padding-left: calc(0.75rem - 2px);
}

/* ── Smooth scrolling ────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Page-level color transitions when switching theme ───────────────────── */
body,
nav, aside, main, header, footer,
.theme-transition {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

/* ── Terminal glow (demo + lessons) ─────────────────────────────────────── */
.terminal-glow {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ── Hero background radial gradient ─────────────────────────────────────── */
.hero-gradient {
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 222, 128, 0.07) 0%, transparent 70%);
}
html:not(.dark) .hero-gradient {
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(22, 163, 74, 0.06) 0%, transparent 70%);
}

/* ── Sidebar accordion animation ─────────────────────────────────────────── */
.sidebar-lesson-list {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
.sidebar-lesson-list.open {
  max-height: 1200px;
}

/* ── Collapsible challenge panel ─────────────────────────────────────────── */
#challenge-panel-full {
  overflow: hidden;
  max-height: 800px;
  opacity: 1;
  transition: max-height 0.55s ease, opacity 0.4s ease;
}
#challenge-panel.collapsed #challenge-panel-full {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.2s ease, opacity 0.15s ease;
}
#challenge-panel-summary {
  display: none;
  cursor: pointer;
}
#challenge-panel.collapsed #challenge-panel-summary {
  display: flex;
}
#challenge-panel-summary:hover {
  background-color: rgba(51, 65, 85, 0.4);
}
html:not(.dark) #challenge-panel-summary:hover {
  background-color: rgba(226, 232, 240, 0.7);
}
