/* FILE: css/control-room.css — Panel aesthetics, buttons, indicator lights, meters */

/* ── Physical Panel Aesthetic ─────────────────────────────────────────────── */
.instrument-panel {
  background: linear-gradient(160deg, #1c1f25 0%, #15181d 100%);
  border: 1px solid var(--c-trim);
  border-top: 2px solid var(--c-trim-bright);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
}

.panel-bezel {
  background: #1a1d22;
  border: 2px solid #0d0e10;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.04);
  padding: var(--sp-2);
}

.panel-stripe {
  height: 4px;
  border-radius: 2px;
  margin-bottom: var(--sp-2);
}
.panel-stripe.unit1 { background: linear-gradient(90deg, #00b0ff, #0077b3); }
.panel-stripe.unit2 { background: linear-gradient(90deg, #ff6d00, #b34c00); }
.panel-stripe.electrical { background: linear-gradient(90deg, #ff6d00, #ffab00); }
.panel-stripe.safety { background: linear-gradient(90deg, #ff1744, #b71c1c); }

/* ── Control Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.1s, transform 0.08s, box-shadow 0.1s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); filter: brightness(0.88); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* Sizes */
.btn-xs  { font-size: var(--fs-tiny); padding: 2px 6px; }
.btn-sm  { font-size: var(--fs-xs);   padding: 4px 10px; }
.btn-md  { font-size: var(--fs-sm);   padding: 6px 14px; }
.btn-lg  { font-size: var(--fs-base); padding: 8px 20px; }

/* Variants */
.btn-green  { background: #003d1a; color: var(--c-green); border: 1px solid var(--c-green-dim); box-shadow: 0 0 6px rgba(0,230,118,0.15); }
.btn-green:hover:not(:disabled)  { background: #004d22; box-shadow: 0 0 12px rgba(0,230,118,0.3); }
.btn-red    { background: #3d0011; color: var(--c-red);   border: 1px solid var(--c-red-dim);   box-shadow: 0 0 6px rgba(255,23,68,0.15); }
.btn-red:hover:not(:disabled)    { background: #4d0016; box-shadow: 0 0 12px rgba(255,23,68,0.3); }
.btn-amber  { background: #3d2900; color: var(--c-amber); border: 1px solid var(--c-amber-dim); box-shadow: 0 0 6px rgba(255,171,0,0.15); }
.btn-amber:hover:not(:disabled)  { background: #4d3300; box-shadow: 0 0 12px rgba(255,171,0,0.3); }
.btn-blue   { background: #003040; color: var(--c-blue);  border: 1px solid var(--c-blue-dim);  }
.btn-blue:hover:not(:disabled)   { background: #004055; }
.btn-gray   { background: var(--c-gray-dim); color: var(--c-white); border: 1px solid var(--c-gray); }
.btn-gray:hover:not(:disabled)   { background: var(--c-gray); }
.btn-panel  { background: var(--c-panel-raised); color: var(--c-text-dim); border: 1px solid var(--c-trim); }
.btn-panel:hover:not(:disabled)  { color: var(--c-white); border-color: var(--c-trim-bright); }

/* Guarded (flip-cover) button */
.btn-guarded {
  position: relative;
}
.btn-guarded::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--c-red-dim);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* ── LED Indicator Lights ────────────────────────────────────────────────── */
.led {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  border: 1px solid rgba(0,0,0,0.4);
  background: #1a1a1a;
}
.led-sm { width: 7px; height: 7px; }
.led-lg { width: 14px; height: 14px; }

.led.green  { background: var(--c-green); box-shadow: 0 0 6px var(--c-green), 0 0 2px var(--c-green) inset; }
.led.amber  { background: var(--c-amber); box-shadow: 0 0 6px var(--c-amber), 0 0 2px var(--c-amber) inset; }
.led.red    { background: var(--c-red);   box-shadow: 0 0 6px var(--c-red),   0 0 2px var(--c-red)   inset; }
.led.blue   { background: var(--c-blue);  box-shadow: 0 0 6px var(--c-blue),  0 0 2px var(--c-blue)  inset; }
.led.white  { background: var(--c-white); box-shadow: 0 0 6px rgba(255,255,255,0.5); }
.led.gray   { background: #333; box-shadow: none; }
.led.off    { background: #1a1a1a; box-shadow: none; }

/* IEC standard: red = closed, green = open */
.led.closed { background: var(--c-red);   box-shadow: 0 0 6px var(--c-red); }
.led.open   { background: var(--c-green); box-shadow: 0 0 6px var(--c-green); }

/* Position indicator with label */
.indicator-lamp {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-tiny);
  color: var(--c-text-dim);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Digital Readout Displays ────────────────────────────────────────────── */
.display-box {
  background: #0a0c0a;
  border: 1px solid #1a2a1a;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-mono);
  text-align: right;
  box-shadow: var(--shadow-inset);
  min-width: 70px;
}
.display-box.large  { font-size: var(--fs-2xl); min-width: 120px; padding: 4px 10px; }
.display-box.medium { font-size: var(--fs-lg);  min-width: 90px; }
.display-box.small  { font-size: var(--fs-sm);  min-width: 60px; padding: 2px 6px; }
.display-green  { color: var(--c-green);  border-color: #1a3a1a; text-shadow: 0 0 8px var(--c-green-glow); }
.display-amber  { color: var(--c-amber);  border-color: #3a2a00; }
.display-blue   { color: var(--c-blue);   border-color: #0a2a3a; }
.display-red    { color: var(--c-red);    border-color: #3a0a12; }
.display-white  { color: var(--c-white);  border-color: #2a2a2a; }

/* Labeled parameter row */
.param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.param-row:last-child { border-bottom: none; }
.param-label { font-size: var(--fs-xs); color: var(--c-text-dim); font-family: var(--font-label); white-space: nowrap; }
.param-value { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--c-white); min-width: 70px; text-align: right; }
.param-unit  { font-size: var(--fs-tiny); color: var(--c-text-muted); min-width: 28px; }

/* ── Selector Switches ───────────────────────────────────────────────────── */
.selector-switch {
  display: flex;
  border: 1px solid var(--c-trim);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.selector-switch .sel-opt {
  flex: 1;
  padding: 3px 8px;
  font-size: var(--fs-tiny);
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  background: var(--c-panel-light);
  color: var(--c-text-muted);
  border-right: 1px solid var(--c-trim);
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.selector-switch .sel-opt:last-child { border-right: none; }
.selector-switch .sel-opt.active.auto { background: #003d1a; color: var(--c-green); }
.selector-switch .sel-opt.active.manual { background: #3d2900; color: var(--c-amber); }
.selector-switch .sel-opt.active.hand { background: #003040; color: var(--c-blue); }
.selector-switch .sel-opt.active.off  { background: var(--c-gray-dim); color: var(--c-white); }
.selector-switch .sel-opt:hover:not(.active) { background: var(--c-panel-raised); color: var(--c-white); }

/* ── Annunciator Tile (base style — animations in animations.css) ────────── */
.ann-tile {
  border-radius: var(--radius-sm);
  padding: 3px 4px;
  font-size: 9px;
  font-family: var(--font-label);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  cursor: pointer;
  user-select: none;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.ann-tile.clear    { background: #0d0f12; border-color: #1a1d22; color: #333; }
.ann-tile.acked    { background: #2a1800; border-color: var(--c-amber-dim); color: var(--c-amber); }
.ann-tile.clearing { background: #002a0f; border-color: var(--c-green-dim); color: var(--c-green); }

/* ── Breaker symbol (used in one-line diagrams) ──────────────────────────── */
.breaker-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 2px;
  border: 2px solid;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.breaker-symbol.closed { background: rgba(0,230,118,0.15); border-color: var(--c-green); color: var(--c-green); }
.breaker-symbol.open   { background: rgba(85,93,107,0.2);  border-color: var(--c-gray);  color: var(--c-gray); }
.breaker-symbol.fault  { background: rgba(255,23,68,0.2);  border-color: var(--c-red);   color: var(--c-red); }

/* ── Summary readout dashboard box ──────────────────────────────────────── */
.dashboard-box {
  background: #0c0e11;
  border: 1px solid var(--c-trim);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
}
.dashboard-box .db-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  color: var(--c-aluminum);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--c-trim);
}
.db-big-value {
  font-size: var(--fs-4xl);
  color: var(--c-green);
  text-shadow: 0 0 20px var(--c-green-glow);
  line-height: 1;
}
.db-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.db-cell { flex: 1; min-width: 120px; }
.db-label { font-size: var(--fs-tiny); color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.db-value { font-size: var(--fs-lg); color: var(--c-white); }
.db-unit  { font-size: var(--fs-xs); color: var(--c-text-dim); }

/* ── Progress / bargraph ─────────────────────────────────────────────────── */
.bargraph-container {
  background: #0a0c0a;
  border: 1px solid #1a2a1a;
  border-radius: 2px;
  height: 8px;
  overflow: hidden;
  position: relative;
}
.bargraph-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
  background: var(--c-green);
}
.bargraph-fill.amber { background: var(--c-amber); }
.bargraph-fill.red   { background: var(--c-red); }