/* ============================================================
   THEME TOGGLE & LESSON PAGE STYLES
   ============================================================ */

/* Theme icon states */
[data-theme="dark"] .icon--sun  { display: block; }
[data-theme="dark"] .icon--moon { display: none;  }
[data-theme="light"] .icon--sun  { display: none;  }
[data-theme="light"] .icon--moon { display: block; }

/* --- Lesson Page Sidebar --- */
.sidebar__header {
  padding: 0 var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}

.sidebar__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  margin-bottom: var(--space-3);
}

.sidebar__progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar__progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.sidebar__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.sidebar__progress-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* --- Lessons List Page --- */
.lessons-hero {
  padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-12);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.lessons-hero__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.lessons-hero__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.lessons-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* --- Playground Page --- */
.playground-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
}

.playground-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}

.playground-panel:last-child {
  border-right: none;
}

.playground-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.playground-panel__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.playground-panel__body {
  flex: 1;
  overflow: auto;
  background: var(--color-code-bg);
}

.playground-editor {
  width: 100%;
  height: 100%;
  background: var(--color-code-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  padding: var(--space-5);
  border: none;
  resize: none;
  outline: none;
  tab-size: 2;
}

.playground-output {
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-muted);
  white-space: pre-wrap;
}

.playground-examples {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.playground-example-btn {
  white-space: nowrap;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.playground-example-btn:hover,
.playground-example-btn.is-active {
  background: var(--color-accent-dim);
  border-color: var(--color-accent);
  color: var(--color-accent-light);
}

/* --- About Page --- */
.about-hero {
  padding: calc(var(--nav-height) + var(--space-16)) 0 var(--space-16);
  text-align: center;
}

.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-24);
}

.about-content h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: var(--space-12) 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.about-content p {
  margin-bottom: var(--space-4);
  line-height: 1.8;
}

.about-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.about-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-accent-dim);
  color: var(--color-accent-light);
  border: 1px solid rgba(49,120,198,0.2);
}

/* --- Syntax Highlight Tokens (custom minimal) --- */
.token-keyword  { color: #c678dd; }
.token-type     { color: #e5c07b; }
.token-string   { color: #98c379; }
.token-comment  { color: #5c6370; font-style: italic; }
.token-function { color: #61afef; }
.token-number   { color: #d19a66; }
.token-operator { color: #56b6c2; }
.token-punctuation { color: #abb2bf; }
.token-variable { color: #e06c75; }

/* --- Responsive Playground --- */
@media (max-width: 768px) {
  .playground-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: auto;
    min-height: calc(100vh - var(--nav-height));
  }

  .playground-panel {
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}
