/* ──────────────────────────────────────────────
   AC LEARNING — candlestick chart UI
   demo2026/css/learn.css
   ────────────────────────────────────────────── */

/* Page layout */
.learn-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.learn-hero { margin-bottom: 32px; }
.learn-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.learn-title .chrome-text-subtle { font-weight: 700; }
.learn-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0;
  line-height: 1.5;
}

/* Login gate */
.learn-gate {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}
.learn-gate-card {
  text-align: center;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 48px 32px;
  max-width: 480px;
}
.learn-gate-icon { font-size: 48px; margin-bottom: 16px; }
.learn-gate-card h2 { font-size: 22px; font-weight: 700; margin: 0 0 12px; color: var(--text); }
.learn-gate-card p { color: var(--text-secondary); margin: 0 0 24px; font-size: 14px; line-height: 1.5; }
.learn-gate-actions { display: flex; justify-content: center; gap: 12px; }

/* Legend */
.learn-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-item--free .legend-dot         { background: #00C566; }
.legend-item--intermediate .legend-dot { background: #4A90E2; }
.legend-item--expert .legend-dot       { background: #A855F7; }

/* Stats */
.learn-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  padding: 16px 24px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.stat-block { flex: 1; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* Chart */
.learn-chart-container {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 24px;
  overflow-x: auto;
}
.learn-chart-svg {
  width: 100%;
  min-width: 900px;
  height: 360px;
  display: block;
}

/* Tooltip */
.learn-tooltip {
  position: fixed;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-width: 280px;
  font-size: 12px;
}
.learn-tooltip-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.learn-tooltip-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.learn-tooltip-status { font-size: 12px; color: var(--text-secondary); }

/* SVG candle interactivity */
.candle-group { cursor: pointer; transition: opacity 200ms; }
.candle-group:hover { opacity: 0.85; }
.candle-group.is-locked { cursor: not-allowed; }

/* ──────────────────────────────────────────────
   SECTION DETAIL PAGE (learn-section.html)
   ────────────────────────────────────────────── */

.section-page { max-width: 800px; margin: 0 auto; padding: 32px 24px 80px; }

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 200ms;
}
.back-link:hover { color: var(--green, #00C566); }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.section-title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}
.section-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin: 0 0 32px;
}

.section-lessons-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: border-color 200ms;
}
.lesson-item:hover { border-color: var(--border-default); }
.lesson-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 28px;
}
.lesson-title { flex: 1; color: var(--text); font-size: 14px; }
.lesson-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.section-locked { display: flex; justify-content: center; padding: 60px 20px; }
.locked-card {
  text-align: center;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 48px 32px;
  max-width: 420px;
}
.locked-icon { font-size: 48px; margin-bottom: 16px; }
.locked-card h2 { margin: 0 0 12px; font-size: 22px; color: var(--text); }
.locked-card p { color: var(--text-secondary); margin: 0 0 24px; font-size: 14px; line-height: 1.5; }

.section-coming-soon {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-surface-2);
  border: 1px dashed var(--border-default);
  border-radius: 12px;
  text-align: center;
}
.section-coming-soon h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.section-coming-soon p { margin: 0; color: var(--text-secondary); font-size: 13px; }

/* ──────────────────────────────────────────────
   LESSON READER (lesson.html)
   ────────────────────────────────────────────── */

.lesson-page { max-width: 720px; margin: 0 auto; padding: 32px 24px 80px; }

.lesson-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.lesson-title {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}
.lesson-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin: 0 0 24px;
}
.lesson-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border-subtle);
  transition: background 200ms;
  text-decoration: none;
}
.progress-dot.is-past { background: #00C566; opacity: 0.6; }
.progress-dot.is-current { background: #00C566; }

.lesson-body { display: flex; flex-direction: column; gap: 24px; }
.lesson-block { font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
.lesson-block p { margin: 0 0 14px; }
.lesson-block p:last-child { margin-bottom: 0; }
.lesson-block strong { color: var(--text); font-weight: 600; }
.lesson-core {
  background: var(--bg-surface-1);
  border-left: 3px solid var(--green, #00C566);
  border-radius: 8px;
  padding: 16px 20px;
}
.lesson-core-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--green, #00C566);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lesson-block-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
  letter-spacing: -0.005em;
}
.lesson-takeaways { padding-left: 20px; margin: 0; color: var(--text-secondary); }
.lesson-takeaways li { margin-bottom: 6px; line-height: 1.5; }

.lesson-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}
.lesson-footer button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ──────────────────────────────────────────────
   QUIZ (quiz.html)
   ────────────────────────────────────────────── */

.quiz-page { max-width: 720px; margin: 0 auto; padding: 32px 24px 80px; }
.quiz-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.quiz-title { font-size: 30px; font-weight: 300; margin: 0 0 8px; color: var(--text); }
.quiz-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin: 0 0 32px;
}
.quiz-progress { margin-bottom: 24px; }
.quiz-progress-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.quiz-progress-bar {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: #00C566;
  transition: width 300ms;
}
.quiz-question {
  font-size: 20px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 20px;
  font-weight: 500;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color 200ms, background 200ms;
}
.quiz-option:hover:not(:disabled) {
  border-color: #00C566;
  background: var(--bg-surface-2);
}
.quiz-option:disabled { cursor: default; }
.quiz-option .opt-letter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.quiz-option.is-correct {
  border-color: #00C566;
  background: rgba(0, 197, 102, 0.08);
}
.quiz-option.is-correct .opt-letter { background: #00C566; color: #fff; }
.quiz-option.is-wrong {
  border-color: #E54360;
  background: rgba(229, 67, 96, 0.08);
}
.quiz-option.is-wrong .opt-letter { background: #E54360; color: #fff; }
.quiz-feedback {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}
.quiz-feedback.is-correct { border-left: 3px solid #00C566; }
.quiz-feedback.is-wrong   { border-left: 3px solid #E54360; }
.quiz-actions { display: flex; justify-content: flex-end; }

/* Result */
.quiz-result { display: flex; justify-content: center; padding: 32px 0; }
.result-card {
  text-align: center;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 48px 32px;
  max-width: 440px;
}
.result-card--passed { border-color: #00C566; box-shadow: 0 0 32px rgba(0, 197, 102, 0.15); }
.result-card--failed { border-color: #E54360; box-shadow: 0 0 32px rgba(229, 67, 96, 0.10); }
.result-icon { font-size: 56px; margin-bottom: 16px; }
.result-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}
.result-message {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
}
.result-score { margin-bottom: 24px; }
.score-num {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.score-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Section-page quiz CTA + clickable lesson item variants */
.section-quiz-cta {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-surface-1);
  border: 1px solid #00C566;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 24px rgba(0, 197, 102, 0.12);
}
.section-quiz-cta h3 { margin: 0 0 8px; font-size: 18px; color: var(--text); }
.section-quiz-cta p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.lesson-item--ready { padding: 0; }
.lesson-item--ready .lesson-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  width: 100%;
}
.lesson-item--ready:hover { border-color: #00C566; }
.lesson-item--ready .lesson-status { color: #00C566; font-weight: 600; }
.lesson-item--coming-soon { opacity: 0.6; }

/* ──────────────────────────────────────────────
   LESSON WIDGETS — shared framework + helpers
   ────────────────────────────────────────────── */

.lesson-widget { margin: 24px 0; }
.widget-wrap {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 200ms;
}
.widget-wrap.is-completed {
  border-color: #00C566;
  box-shadow: 0 0 24px rgba(0, 197, 102, 0.08);
}
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.widget-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #00C566;
  text-transform: uppercase;
}
.widget-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.widget-status--completed { color: #00C566; }
.widget-body { min-height: 80px; }
.widget-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border-left: 3px solid var(--text-tertiary);
}
.widget-feedback--success { border-left-color: #00C566; }
.widget-feedback--info    { border-left-color: #4A90E2; }
.widget-feedback--warning { border-left-color: var(--warning, #F59E0B); }

/* Generic widget primitives */
.w-row { display: flex; gap: 8px; flex-wrap: wrap; }
.w-col { display: flex; flex-direction: column; gap: 8px; }

.w-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 200ms;
  user-select: none;
}
.w-card:hover     { border-color: #00C566; }
.w-card.is-active { border-color: #00C566; background: rgba(0, 197, 102, 0.08); }
.w-card.is-broken { border-color: #E54360; background: rgba(229, 67, 96, 0.08); opacity: 0.7; }
.w-card.is-disabled { opacity: 0.5; cursor: default; }

.w-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all 200ms;
}
.w-btn:hover { border-color: #00C566; color: #00C566; }
.w-btn--primary {
  background: #00C566;
  color: #0A0E14;
  border-color: #00C566;
}
.w-btn--primary:hover { background: #00C566; opacity: 0.9; color: #0A0E14; }
.w-btn:disabled { opacity: 0.4; cursor: default; }

.w-slider {
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
}
.w-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #00C566;
  cursor: pointer;
}
.w-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #00C566;
  cursor: pointer;
  border: none;
}

.w-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface-2);
  border-radius: 6px;
  font-size: 12px;
}
.w-stat-label {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}
.w-stat-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
}
.w-stat-value--green   { color: #00C566; }
.w-stat-value--red     { color: #E54360; }
.w-stat-value--warning { color: var(--warning, #F59E0B); }

/* Drag and drop primitives */
.w-droppable {
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  padding: 12px;
  min-height: 60px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 200ms;
}
.w-droppable.is-over    { border-color: #00C566; background: rgba(0, 197, 102, 0.05); }
.w-droppable.is-correct { border-color: #00C566; background: rgba(0, 197, 102, 0.08); border-style: solid; }
.w-droppable.is-wrong   { border-color: #E54360; background: rgba(229, 67, 96, 0.08); border-style: solid; }
.w-draggable           { cursor: grab; user-select: none; }
.w-draggable.is-dragging { opacity: 0.4; cursor: grabbing; }
.w-draggable.is-placed   { cursor: default; opacity: 0.7; }
