/*
 * This is a manifest file that'll be compiled into application.css.
 */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ── Animations ─────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.char {
  display: inline-block;
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 0.06s);
}

.anim {
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--step) * 0.12s);
}

/* ── Layout ─────────────────────────────────────────────────── */

.onboarding-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 2rem 4rem;
  gap: 3.5rem;
  background: #0a0a0a;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────── */

.onboarding-header {
  text-align: center;
}

.onboarding-title {
  margin: 0 0 0.6rem;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #f8fafc;
}

.onboarding-sub {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #64748b;
  font-weight: 400;
}

/* ── Steps ──────────────────────────────────────────────────── */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 600px;
}

.step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.step-desc {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.6;
}

.step-code {
  margin: 0;
  padding: 0.6rem 0.9rem;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: #7dd3fc;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Footer ─────────────────────────────────────────────────── */

.onboarding-footer {
  max-width: 600px;
  text-align: center;
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
  width: 100%;
}

.onboarding-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

.footer-link {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(148, 163, 184, 0.35);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.footer-link:hover {
  color: #f1f5f9;
  text-decoration-color: rgba(241, 245, 249, 0.5);
}

/* ── Brain Explorer ──────────────────────────────────────────── */

.brain-explorer {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  color: #e6edf3;
  font-family: system-ui, -apple-system, sans-serif;
}

.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
}

.explorer-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.explorer-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f0f6fc;
}

.explorer-subtitle {
  font-size: 0.8rem;
  color: #8b949e;
}

.explorer-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 0;
}

/* ── Brain Canvas ── */

.brain-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 0.75rem;
}

.brain-svg {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  cursor: default;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.5));
}

/* ── SVG Region Styles ── */

.brain-region {
  stroke: #0d1117;
  stroke-width: 2;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.brain-region.hovered {
  filter: brightness(1.25) drop-shadow(0 0 8px rgba(255,255,255,0.15));
}

.brain-region.active {
  stroke: rgba(255,255,255,0.9);
  stroke-width: 2.5;
  filter: brightness(1.15) drop-shadow(0 0 14px rgba(255,255,255,0.25));
}

.brain-region.quiz-correct {
  filter: brightness(1.4) drop-shadow(0 0 18px rgba(52,211,153,0.7));
  stroke: #34d399;
  stroke-width: 3;
}

.brain-region.quiz-wrong {
  filter: brightness(0.65) drop-shadow(0 0 14px rgba(248,81,73,0.6));
  stroke: #f85149;
  stroke-width: 3;
}

/* ── SVG Labels ── */

.brain-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  fill: rgba(255,255,255,0.88);
  text-anchor: middle;
  pointer-events: none;
}

.brain-explorer.quiz-mode .brain-labels {
  display: none;
}

/* ── Quiz UI ── */

.quiz-prompt {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  color: #c9d1d9;
  text-align: center;
}

.quiz-prompt p {
  margin: 0;
}

.quiz-prompt strong {
  color: #f0f6fc;
}

.quiz-feedback-message {
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.quiz-feedback-message.correct {
  background: rgba(52,211,153,0.12);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.25);
}

.quiz-feedback-message.wrong {
  background: rgba(248,81,73,0.12);
  color: #f85149;
  border: 1px solid rgba(248,81,73,0.25);
}

/* ── Info Panel ── */

.info-panel {
  border-left: 1px solid #21262d;
  background: #161b22;
  overflow-y: auto;
}

.info-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #8b949e;
  font-size: 0.875rem;
}

.info-placeholder p {
  margin: 0;
}

.region-info {
  height: 100%;
}

.region-color-bar {
  height: 4px;
}

.region-info-body {
  padding: 1.5rem;
}

.region-name {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #f0f6fc;
}

.region-pronunciation {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: #8b949e;
  font-style: italic;
}

.region-section {
  margin-bottom: 1.5rem;
}

.region-section:last-child {
  margin-bottom: 0;
}

.region-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b949e;
}

.region-section ul {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: #c9d1d9;
  font-size: 0.9rem;
  line-height: 1.75;
}

.region-section p {
  margin: 0;
  color: #c9d1d9;
  font-size: 0.9rem;
  line-height: 1.75;
}

/* ── Quiz Button ── */

.btn-quiz {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-quiz:hover {
  background: #30363d;
  border-color: #8b949e;
}

.btn-quiz.active {
  background: #1f6feb;
  border-color: #1f6feb;
  color: white;
}

/* ── Nav Button ── */

.btn-nav {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-nav:hover {
  background: #30363d;
  border-color: #8b949e;
  color: #f0f6fc;
}

/* ── Neurotransmitter List ── */

.neurotransmitter-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.neurotransmitter-list dt {
  font-size: 0.825rem;
  font-weight: 700;
  color: #e6edf3;
  margin: 0;
}

.neurotransmitter-list dd {
  margin: 0 0 0 0.75rem;
  font-size: 0.875rem;
  color: #8b949e;
  line-height: 1.55;
}

/* ── Neuron Explorer ── */

.neuron-explorer {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  color: #e6edf3;
  font-family: system-ui, -apple-system, sans-serif;
}

.neuron-svg {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  cursor: default;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.5));
}

.neuron-part {
  cursor: pointer;
  transition: filter 0.18s ease;
}

.neuron-part.hovered {
  filter: brightness(1.25) drop-shadow(0 0 8px rgba(255,255,255,0.15));
}

.neuron-part.active {
  filter: brightness(1.2) drop-shadow(0 0 14px rgba(255,255,255,0.28));
}

.neuron-part.quiz-correct {
  filter: brightness(1.4) drop-shadow(0 0 18px rgba(52,211,153,0.7));
}

.neuron-part.quiz-wrong {
  filter: brightness(0.65) drop-shadow(0 0 14px rgba(248,81,73,0.6));
}

.neuron-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  fill: rgba(255,255,255,0.88);
  text-anchor: middle;
  pointer-events: none;
}

.neuron-explorer.quiz-mode .neuron-labels {
  display: none;
}

/* ── Mobile ── */

@media (max-width: 768px) {
  .explorer-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .brain-canvas {
    padding: 1rem;
  }

  .info-panel {
    border-left: none;
    border-top: 1px solid #21262d;
    min-height: 320px;
  }

  .explorer-subtitle {
    display: none;
  }
}
