/* =====================================================
   ELI-NP – Lovește Ținta  |  style.css
   ===================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:    #0a0a0a;
  --bg-panel:   #121212;
  --bg-card:    #1a1a1a;
  --border:     #2b2b2b;
  --accent:     #00d9ff;
  --accent2:    #39ff14;
  --eli-gold:   #ffd700;
  --text-main:  #d6dbe2;
  --text-dim:   #87909c;
  --green:      #39ff14;
  --orange:     #ff8c00;
  --red:        #ff2020;
  --plasma:     #bf00ff;
  --font-mono:  'Courier New', Courier, monospace;
}

html, body {
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- Header ---------- */
header {
  background: linear-gradient(90deg, #0e0e0e 0%, #131313 60%, #181818 100%);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.logo-block {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-eli {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0,217,255,0.55);
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sim-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  border-left: 2px solid var(--border);
  padding-left: 20px;
}

.sim-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ---------- Main Layout ---------- */
main {
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 0;
  height: calc(100vh - 56px - 36px);
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------- Panels ---------- */
.controls-panel,
.readout-panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.readout-panel {
  border-right: none;
  border-left: 1px solid var(--border);
}

.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.panel-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Controls ---------- */
.control-group {
  margin-bottom: 14px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.unit {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(0,217,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0,217,255,0.22);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  cursor: pointer;
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 3px;
}

select {
  width: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

select:focus { border-color: var(--accent); }

/* ---------- ELI Section ---------- */
.eli-section { border-color: var(--eli-gold) !important; }

.eli-title { color: var(--eli-gold) !important; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.toggle-label { font-size: 0.8rem; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border); border-radius: 22px; transition: .3s;
}
.slider-toggle::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s;
}
.switch input:checked + .slider-toggle { background: var(--eli-gold); }
.switch input:checked + .slider-toggle::before { transform: translateX(22px); background: #1a0a00; }

.eli-params { margin-top: 8px; }
.hidden { display: none !important; }

/* ---------- Fire / Reset Buttons ---------- */
.fire-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.btn-fire {
  background: linear-gradient(135deg, #8b0000, #ff2020);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(255,32,32,0.4);
  transition: all 0.2s;
}

.btn-fire:hover {
  background: linear-gradient(135deg, #cc0000, #ff5050);
  box-shadow: 0 0 30px rgba(255,32,32,0.7);
  transform: translateY(-1px);
}

.btn-fire:active { transform: scale(0.97); }

.btn-fire.firing {
  animation: firePulse 0.4s ease-in-out infinite alternate;
}

@keyframes firePulse {
  from { box-shadow: 0 0 20px rgba(255,32,32,0.5); }
  to   { box-shadow: 0 0 50px rgba(255,80,0,1); }
}

.btn-reset {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset:hover { color: var(--text-main); border-color: var(--accent); }

/* ---------- Canvas Section ---------- */
.canvas-section {
  position: relative;
  background: #090909;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#simCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* ---------- Overlay message ---------- */
.overlay-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  border: 2px solid var(--plasma);
  border-radius: 12px;
  padding: 20px 32px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--plasma);
  text-align: center;
  text-shadow: 0 0 20px var(--plasma);
  pointer-events: none;
  animation: fadeInOut 3s ease forwards;
}

@keyframes fadeInOut {
  0%   { opacity: 0; transform: translate(-50%, -55%) scale(0.9); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Readout Panel ---------- */
.readout-block {
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.readout-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  word-break: break-all;
}

.readout-unit {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.state-val { font-size: 0.9rem; }

/* ---------- Regime Bar ---------- */
.regime-bar-wrap {
  margin-top: 4px;
}

.regime-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.regime-bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 4px;
}

.regime-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  transition: width 0.6s ease, background 0.6s ease;
  background: var(--green);
}

.regime-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* ---------- Info Box ---------- */
.info-box {
  background: rgba(0,217,255,0.04);
  border: 1px solid rgba(0,217,255,0.16);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 4px;
}

.info-box strong { color: var(--text-main); }

/* ---------- Footer ---------- */
footer {
  height: 36px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  main { grid-template-columns: 240px 1fr 220px; }
}

@media (max-width: 800px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 320px auto;
    height: auto;
  }
  .controls-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .readout-panel  { border-left: none;  border-top:  1px solid var(--border); }
  .canvas-section { height: 320px; }
}
