/* ═══════════════════════════════════════════════════════════════
   canvas.css  —  EduNudge SciLab | Motion
   Canvas section — road scene + graph + control bar
═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   1.  CANVAS SECTION  (centre column)
─────────────────────────────────────────────────────────────── */
.canvas-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg-page);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* Top accent line */
.canvas-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--brand-blue) 30%,
      var(--brand-glow) 50%,
      var(--brand-blue) 70%,
      transparent 100%);
  z-index: 6;
  opacity: 0.6;
}

/* ───────────────────────────────────────────────────────────────
   2.  ROAD CANVAS  (top zone)
─────────────────────────────────────────────────────────────── */
#roadCanvas {
  flex: 0 0 52%;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #080c18;
}

#roadCanvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ───────────────────────────────────────────────────────────────
   3.  CANVAS DIVIDER  (between road and graph)
─────────────────────────────────────────────────────────────── */
.canvas-divider {
  flex-shrink: 0;
  height: 28px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.divider-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-accent);
}

/* ───────────────────────────────────────────────────────────────
   4.  GRAPH CANVAS  (bottom zone)
─────────────────────────────────────────────────────────────── */
#graphCanvas {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0d1225;
}

#graphCanvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ───────────────────────────────────────────────────────────────
   5.  CONTROL BAR  (bottom)
─────────────────────────────────────────────────────────────── */
.speed-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  height: 46px;
}

/* ── Reset button ── */
.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-panel-section);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.btn-reset:hover {
  background: var(--bg-panel-hover);
  border-color: var(--brand-glow);
  color: var(--brand-glow);
}

/* ── Pause button ── */
.btn-pause {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: var(--bg-panel-section);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-pause:hover {
  background: var(--bg-panel-hover);
  border-color: var(--brand-glow);
  color: var(--brand-glow);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.2);
}

.btn-pause.paused {
  background: rgba(255, 180, 0, 0.1);
  border-color: #ffb400;
  color: #ffb400;
  box-shadow: 0 0 10px rgba(255, 180, 0, 0.2);
}

/* ── Time display ── */
.time-display {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
}

.time-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.time-value {
  font-size: var(--font-size-sm);
  font-weight: 800;
  color: var(--brand-glow);
  font-family: var(--font-mono);
  min-width: 44px;
}

/* ── Sim speed wrap ── */
.sim-speed-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.speed-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Sim speed slider ── */
#simSpeed {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: var(--border-bright);
  outline: none;
  cursor: pointer;
}

#simSpeed::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand-glow);
  cursor: pointer;
  border: 2px solid var(--bg-page);
  box-shadow: 0 0 6px rgba(79, 195, 247, 0.6);
  transition: transform var(--transition-fast);
}

#simSpeed::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#simSpeed::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand-glow);
  cursor: pointer;
  border: 2px solid var(--bg-page);
}

.speed-value {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--brand-glow);
  min-width: 28px;
  font-family: var(--font-mono);
}

/* ───────────────────────────────────────────────────────────────
   6.  RESPONSIVE
─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .speed-label {
    display: none;
  }

  .speed-bar {
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
  }

  #roadCanvas {
    flex: 0 0 50%;
  }
}

@media (max-width: 480px) {
  .time-display {
    display: none;
  }

  #simSpeed {
    width: 60px;
  }
}