/* style.css — LasVis premium dark theme */

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

:root {
  --bg:          #080e1a;
  --bg-panel:    #0d1526;
  --bg-section:  #111e33;
  --bg-input:    #0a1220;
  --border:      #1e3050;
  --border-hi:   #2a4570;
  --text:        #cbd5e1;
  --text-dim:    #4a6080;
  --text-bright: #e2e8f0;
  --accent:      #ef4444;
  --accent-glow: rgba(239,68,68,0.25);
  --blue:        #60a5fa;
  --orange:      #f97316;
  --purple:      #a855f7;
  --green:       #34d399;
  --font:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;
  --radius:      8px;
  --radius-sm:   5px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─── */
#app-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  height: 52px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.laser-dot-anim {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 20px var(--accent-glow);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent), 0 0 20px var(--accent-glow); }
  50%       { opacity: 0.6; box-shadow: 0 0 4px var(--accent); }
}
h1 {
  font-size: 18px; font-weight: 600; color: var(--text-bright);
  letter-spacing: -0.02em;
}
.header-sub {
  font-size: 11px; color: var(--text-dim); font-weight: 400;
  display: none;
}
@media (min-width: 1100px) { .header-sub { display: block; } }

.header-transport {
  display: flex;
  gap: 6px;
}
.header-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.presets-label { color: var(--text-dim); font-size: 11px; }

/* ─── BUTTONS ─── */
.btn {
  padding: 5px 12px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  background: var(--bg-section);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-hi); background: #192a44; color: var(--text-bright); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.45);
  color: #fca5a5;
}
.btn-primary:hover { background: rgba(239,68,68,0.25); }
.btn-active {
  background: rgba(239,68,68,0.25) !important;
  border-color: var(--accent) !important;
  color: #fca5a5 !important;
}
.btn-sm { padding: 4px 10px; font-size: 11px; }
.preset-btn.active {
  background: rgba(96,165,250,0.15);
  border-color: rgba(96,165,250,0.5);
  color: var(--blue);
}

/* ─── MAIN LAYOUT ─── */
#app-main {
  display: flex;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* ─── SIDEBARS ─── */
aside {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}
aside::-webkit-scrollbar { width: 4px; }
aside::-webkit-scrollbar-track { background: transparent; }
aside::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }

#left-panel  { width: 228px; }
#right-panel { width: 256px; }

.panel-section {
  background: var(--bg-panel);
  padding: 14px 13px 12px;
}
.log-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* ─── CANVAS CONTAINER ─── */
#canvas-container {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  position: relative;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
#sim-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* ─── SLIDERS ─── */
.slider-group { margin-bottom: 14px; }
.slider-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.slider-header label { color: var(--text); font-size: 12px; }
.slider-val { font-family: var(--mono); font-size: 11px; color: var(--blue); }
.slider-hint { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-input);
  outline: none;
  cursor: pointer;
  border: 1px solid var(--border);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 6px rgba(96,165,250,0.5);
  transition: transform 0.1s;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ─── OVERLAYS / TOGGLES ─── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
}
.toggle-label input[type=checkbox] { accent-color: var(--blue); width: 13px; height: 13px; }

/* ─── LEGEND ─── */
.legend-section { }
.legend-item { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-size: 11px; color: var(--text); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.photon-dot { background: #ef4444; border-radius: 2px; box-shadow: 0 0 5px #ef4444; }
.legend-divider { border-top: 1px solid var(--border); margin: 6px 0; }
.flash-swatch { width: 22px; height: 10px; border-radius: 2px; flex-shrink: 0; border: 1.5px solid; }
.flash-swatch.spont { border-color: #93c5fd; background: rgba(147,197,253,0.1); }
.flash-swatch.stim  { border-color: #fdba74; background: rgba(253,186,116,0.1); }

/* ─── ENERGY LEVEL DIAGRAM ─── */
#energy-diagram { display: flex; flex-direction: column; gap: 2px; }
.e-level {
  display: flex;
  align-items: center;
  gap: 6px;
}
.e-label { font-family: var(--mono); font-size: 11px; width: 22px; flex-shrink: 0; font-weight: 500; }
.e-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.e-bar { height: 100%; width: 0%; border-radius: 3px; transition: width 0.1s; }
.e-count { font-family: var(--mono); font-size: 10px; width: 28px; text-align: right; color: var(--text-dim); }
.e-arrow { font-size: 10px; color: var(--text-dim); padding-left: 28px; margin: 1px 0; }
.laser-arrow { color: #fca5a5; }
.pump-arrow  { color: #c4b5fd; }

#inversion-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.inversion-yes { color: #34d399; background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); }
.inversion-no  { color: var(--text-dim); background: var(--bg-input); border: 1px solid var(--border); }

/* ─── DIAGNOSTICS ─── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text);
}
.stat-val { font-family: var(--mono); font-size: 11px; color: var(--text-bright); }
.key-stat .stat-val { color: #fca5a5; }
.power-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0 10px;
}
.power-bar-fill { height: 100%; width: 0%; border-radius: 3px; transition: width 0.1s, background-image 0.3s; }

/* ─── ATOM INSPECTOR ─── */
#atom-inspector { font-size: 12px; }
.insp-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
  gap: 8px;
}
.insp-note {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  border-left: 2px solid var(--border-hi);
  padding-left: 7px;
  font-style: italic;
}
.dim-text { color: var(--text-dim); font-size: 12px; }

/* ─── EVENT LOG ─── */
#event-log {
  flex: 1;
  overflow-y: auto;
  font-size: 11px;
  color: var(--text-dim);
}
#event-log::-webkit-scrollbar { width: 3px; }
#event-log::-webkit-scrollbar-thumb { background: var(--border-hi); }

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; } }
.log-icon { font-size: 12px; flex-shrink: 0; width: 18px; text-align: center; }

/* ─── TOOLTIP ─── */
#tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: rgba(13,21,38,0.95);
  border: 1px solid var(--border-hi);
  color: var(--text-bright);
  font-size: 11px;
  font-family: var(--mono);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.12s;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
