/* ============================================================
   SYNAPSE NEURAL REASONING & CHAIN-OF-THOUGHT FLOW
   Low-Key Luxury Matte Design & Mobile Touch Adaptive
   ============================================================ */

.reasoning-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 980px) {
  .reasoning-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Thinking Budget Control Panel */
.budget-controller {
  background: rgba(14, 17, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
}

@media (max-width: 640px) {
  .budget-controller {
    padding: 16px 12px;
  }
}

.budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.budget-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-pure);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  transition: all 0.2s ease;
}

/* Slider Track & Touch Thumb */
.slider-wrap {
  position: relative;
  margin: 20px 0 12px;
}

.budget-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
}

.budget-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.budget-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
  border-color: #ffffff;
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--accent-muted);
  font-weight: 500;
  margin-top: 6px;
}

.slider-marks span.active {
  color: var(--text-pure);
}

/* Challenge Selector */
.challenge-selector {
  margin-top: 18px;
}

.section-subtitle {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.challenge-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 480px) {
  .challenge-pills {
    grid-template-columns: 1fr;
  }
}

.challenge-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.18s var(--ease-spring);
}

.challenge-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
  color: var(--text-pure);
}

.challenge-btn.active {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-pure);
}

.challenge-btn .btn-badge {
  font-size: 10px;
  color: var(--accent-muted);
  font-family: var(--font-mono);
}

/* Synapse Neural Canvas */
.neural-graph-card {
  background: rgba(10, 12, 18, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 16px;
}

.graph-canvas-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: #08090d;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

#thoughtCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.graph-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--accent-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot.root { background: #ffffff; }
.legend-dot.branch { background: #94a3b8; }
.legend-dot.verify { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.5); }
.legend-dot.prune { background: #64748b; opacity: 0.5; }

/* Stream Code Terminal */
.stream-chamber {
  background: #090a0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.chamber-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(16, 19, 28, 0.95);
  border-bottom: 1px solid var(--border-subtle);
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.live-metrics-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.live-metric {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-muted);
}

.live-metric .val {
  color: var(--text-pure);
  font-weight: 600;
}

/* Thought Process Log */
.thought-log-container {
  padding: 12px 16px;
  background: rgba(14, 17, 25, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  max-height: 140px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.thought-header {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.thought-step {
  padding: 5px 8px;
  margin-bottom: 4px;
  border-left: 2px solid var(--accent-ice);
  background: rgba(56, 189, 248, 0.04);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-primary);
  animation: stepIn 0.25s var(--ease-spring);
  line-height: 1.4;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Code Output Area */
.code-output-area {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #e2e8f0;
  min-height: 240px;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  background: #07080c;
  word-break: break-all;
}

@media (max-width: 640px) {
  .code-output-area {
    font-size: 11.5px;
    padding: 12px;
  }
}

.cursor-blink {
  display: inline-block;
  width: 6px;
  height: 15px;
  background: #ffffff;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s infinite;
}

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

.chamber-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16, 19, 28, 0.95);
  border-top: 1px solid var(--border-subtle);
}
