/* ══════════════════════════════════════════════
   AP Physics 1 Explorer — Shared Styles
   main.css
══════════════════════════════════════════════ */

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

:root {
  --bg:         #0f1014;
  --surface:    #17181d;
  --surface2:   #1e2028;
  --border:     #2a2b33;
  --border2:    #3a3b45;
  --text:       #e8e9ef;
  --text-muted: #7a7d8e;
  --text-dim:   #4a4d5e;
  --blue:       #4a9eff;
  --blue-dim:   #1a3a6a;
  --teal:       #2dd4a0;
  --teal-dim:   #0a3a2a;
  --amber:      #f5a623;
  --amber-dim:  #3a2a0a;
  --red:        #ff5f6d;
  --font-body:  'DM Sans', sans-serif;
  --font-mono:  'DM Mono', monospace;
  --font-serif: 'DM Serif Display', serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.site-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.site-logo span { color: var(--blue); }
.site-tagline {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.header-back {
  margin-left: auto;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.header-back:hover { color: var(--text); }

/* ── Shared shell for simulators ── */
.sim-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Control panel ── */
.ctrl-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.ctrl-eq {
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  color: var(--text);
  margin-bottom: 16px;
  min-height: 28px;
}
.ctrl-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}
.ctrl-note {
  margin-top: auto;
  padding-top: 12px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
}

/* ── Mode toggle ── */
.mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.mode-btn {
  flex: 1;
  padding: 7px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.mode-btn:hover { border-color: var(--border2); color: var(--text); }
.mode-btn.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 500;
}

/* ── Sliders ── */
.slider-group { margin-bottom: 14px; }
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.slider-label {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
}
.slider-value {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 500;
}
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--border2);
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--border2);
  cursor: grab;
  transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--border2);
  cursor: grab;
}

/* ── Result rows ── */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.result-label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.result-val {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text);
}
.result-val.blue  { color: var(--blue); }
.result-val.teal  { color: var(--teal); }
.result-val.amber { color: var(--amber); }

/* ── Energy bars ── */
.ebar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ebar-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.ebar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.05s;
}
.ebar-fill.blue  { background: var(--blue); }
.ebar-fill.teal  { background: var(--teal); }
.ebar-fill.amber { background: var(--amber); }
.ebar-pct {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  min-width: 34px;
  text-align: right;
}

/* ── Canvas wrap ── */
.canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
