/* ═══════════════════════════════════════════
   REACT BASICS COURSE — Shared Styles
   Import this in every session .html file
   ═══════════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=DM+Sans:wght@400;500;600;700&family=Fraunces:wght@700;900&display=swap');

/* ── Tokens ── */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a26;
  --surface-3: #222233;
  --border: #2a2a3d;
  --text: #e8e6f0;
  --text-dim: #8a87a0;
  --accent: #61dafb;
  --accent-glow: #61dafb33;
  --react-dark: #20232a;
  --green: #a3e635;
  --orange: #fb923c;
  --pink: #f472b6;
  --purple: #a78bfa;
  --red: #f87171;
  --yellow: #fbbf24;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Fraunces', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 820px;
  --max-width-wide: 1100px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  color: var(--accent);
}


/* ══════════════════════════════════════
   HERO
   ══════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: hero-pulse 4s ease-in-out infinite;
}

@keyframes hero-pulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

.react-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  animation: spin 20s linear infinite;
}

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

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--text);
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.hero h1 span { color: var(--accent); }

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.hero .session-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  justify-content: center;
}

.meta-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  border-radius: 99px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.meta-chip strong { color: var(--accent); margin-right: 0.3rem; }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  z-index: 1;
  animation: bounce 2s ease-in-out infinite;
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}


/* ══════════════════════════════════════
   STICKY LESSON NAV
   ══════════════════════════════════════ */
.lesson-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0.6rem 1.5rem;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { color: var(--accent); background: var(--surface-2); }

.nav-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 0.7rem;
  margin-right: 0.4rem;
  font-weight: 700;
}

.nav-btn.active .nav-number { background: var(--accent); color: var(--bg); }


/* ══════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════ */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.section p {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  max-width: 640px;
}

.section p strong { color: var(--text); }


/* ══════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════ */
.timeline {
  display: flex;
  flex-direction: column;
  margin: 2rem 0;
}

.timeline-item {
  display: flex;
  gap: 1.2rem;
  padding: 1.2rem 0;
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 1.6rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--accent);
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 70px;
  font-weight: 600;
}

.timeline-content h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.timeline-content p { font-size: 0.9rem; margin-bottom: 0; }


/* ══════════════════════════════════════
   CONCEPT CARDS
   ══════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.concept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: all 0.3s;
  cursor: default;
}

.concept-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  display: block;
}

.concept-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.concept-card p {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 0;
}


/* ══════════════════════════════════════
   CODE BLOCKS
   ══════════════════════════════════════ */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dots span:nth-child(1) { background: var(--red); opacity: 0.7; }
.code-dots span:nth-child(2) { background: var(--yellow); opacity: 0.7; }
.code-dots span:nth-child(3) { background: var(--green); opacity: 0.7; }

.code-body {
  padding: 1.2rem;
  overflow-x: auto;
}

.code-body pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text);
}

/* Syntax Highlighting */
.kw { color: var(--purple); }
.fn { color: var(--accent); }
.str { color: var(--green); }
.cmt { color: var(--text-dim); font-style: italic; }
.tag { color: var(--red); }
.attr { color: var(--orange); }
.val { color: var(--green); }
.comp { color: var(--accent); }
.punc { color: var(--text-dim); }
.num { color: var(--orange); }


/* ══════════════════════════════════════
   COMPARISON TABLE
   ══════════════════════════════════════ */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.92rem;
}

.compare-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  background: var(--surface-2);
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compare-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.compare-table tr:hover td { color: var(--text); background: var(--surface); }


/* ══════════════════════════════════════
   INTERACTIVE DEMO AREA
   ══════════════════════════════════════ */
.demo-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}

.demo-area h4 {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.demo-counter {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: var(--text);
  margin: 1rem 0;
  transition: transform 0.15s;
}

.demo-counter.bump { transform: scale(1.15); }

.demo-btns {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.demo-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
}

.demo-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}


/* ══════════════════════════════════════
   CALLOUTS
   ══════════════════════════════════════ */
.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}

.callout.tip { border-left-color: var(--green); }
.callout.warn { border-left-color: var(--orange); }

.callout-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  color: var(--accent);
}

.callout.tip .callout-title { color: var(--green); }
.callout.warn .callout-title { color: var(--orange); }
.callout p { font-size: 0.92rem; margin-bottom: 0; }


/* ══════════════════════════════════════
   QUIZ
   ══════════════════════════════════════ */
.quiz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  margin: 2rem 0;
}

.quiz-box h4 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.quiz-question {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.quiz-options { display: flex; flex-direction: column; gap: 0.5rem; }

.quiz-opt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: left;
  transition: all 0.2s;
}

.quiz-opt:hover { border-color: var(--text-dim); color: var(--text); }
.quiz-opt.correct { border-color: var(--green); color: var(--green); background: #a3e63515; }
.quiz-opt.wrong { border-color: var(--red); color: var(--red); background: #f8717115; }
.quiz-opt.disabled { pointer-events: none; }

.quiz-feedback {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.4rem;
}


/* ══════════════════════════════════════
   STEP LIST
   ══════════════════════════════════════ */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.step-text h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.step-text p { font-size: 0.88rem; margin-bottom: 0; }


/* ══════════════════════════════════════
   DIAGRAM
   ══════════════════════════════════════ */
.diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.diagram-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.diagram-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.diagram-box {
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid;
  text-align: center;
  min-width: 100px;
}

.d-state { border-color: var(--purple); color: var(--purple); background: #a78bfa10; }
.d-component { border-color: var(--accent); color: var(--accent); background: #61dafb10; }
.d-dom { border-color: var(--green); color: var(--green); background: #a3e63510; }
.d-warn { border-color: var(--orange); color: var(--orange); background: #fb923c10; }
.d-arrow { color: var(--text-dim); font-size: 1.2rem; }


/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer span { color: var(--accent); }


/* ══════════════════════════════════════
   HOMEPAGE — Session Cards
   ══════════════════════════════════════ */
.home-grid {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
}

.session-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--accent-glow);
  text-decoration: none;
}

.session-card .card-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.session-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.session-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}

.session-card .card-meta {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.3rem;
}

.session-card .card-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.session-card.locked {
  opacity: 0.45;
  pointer-events: none;
}

.session-card.locked h3::after {
  content: ' 🔒';
  font-size: 0.9rem;
}


/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* staggered children */
.stagger-in > * {
  opacity: 0;
  transform: translateY(15px);
  animation: stagger-up 0.5s ease forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes stagger-up {
  to { opacity: 1; transform: translateY(0); }
}


/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 600px) {
  .section { padding: 2.5rem 1rem; }
  .code-body { padding: 1rem 0.8rem; }
  .code-body pre { font-size: 0.75rem; }
  .demo-counter { font-size: 3rem; }
  .timeline-item { flex-direction: column; gap: 0.3rem; }
  .home-grid { grid-template-columns: 1fr; }
}
