/* LNG FGSS — Multi-Page Layout (extends shared/simulator-theme.css) */

/* ── Accent override ── */
:root {
  --ice:  #00e5ff;
  --ice2: #00b8d9;
}

/* ── Body must be flex column for multi-page layout ── */
body {
  display: flex !important;
  flex-direction: column !important;
}

/* ══════════════════ NAVIGATION BAR ══════════════════ */
#nav-bar {
  background: rgba(5,13,20,0.95);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 20;
}
#nav-groups {
  display: flex;
  gap: 1px;
  padding: 2px 4px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.nav-grp {
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 3px 3px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-grp:hover { color: var(--ice); background: rgba(0,229,255,0.06); }
.nav-grp.active {
  color: var(--ice);
  background: rgba(0,229,255,0.1);
  border-color: var(--border2);
}
#nav-pages {
  display: flex;
  gap: 1px;
  padding: 2px 4px;
  min-height: 24px;
  overflow: hidden;
}
.nav-pg {
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-pg:hover { color: var(--green); background: rgba(0,230,118,0.06); }
.nav-pg.active {
  color: var(--green);
  background: rgba(0,230,118,0.1);
  border-color: var(--border);
}

/* ══════════════════ DISPLAY AREA ══════════════════ */
#display-area {
  flex: 1 1 0;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.disp-page {
  display: none !important;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.disp-page.active {
  display: flex !important;
  flex-direction: column;
}

/* ══════════════════ STATUS PAGE (overview layout) ══════════════════ */
.status-grid {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  grid-template-rows: 1fr 220px;
  gap: 4px;
  padding: 4px;
  flex: 1 1 0;
  min-height: 0;
}
#schematic-panel { grid-column: 2; grid-row: 1 / 2; }
#schematic { width: 100%; height: 100%; }
#bottom { grid-column: 1 / 4; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }

/* ══════════════════ PAGE LAYOUTS ══════════════════ */
.page-split {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 4px;
  padding: 4px;
  flex: 1 1 0;
  min-height: 0;
}
.page-main { min-width: 0; overflow: hidden; }
.page-side { overflow: hidden; }
.page-full {
  padding: 4px;
  flex: 1 1 0;
  min-height: 0;
}
.page-split canvas,
.page-full canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ══════════════════ CONTROL PANELS (sidebar) ══════════════════ */
.ctrl-section { margin-bottom: 10px; }
.ctrl-section-hdr {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--ice);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.ctrl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 10px;
  color: var(--muted);
}
.ctrl-row .val {
  font-family: var(--font-mono);
  color: var(--green);
}
.ctrl-row .val.warn  { color: var(--amber); }
.ctrl-row .val.alarm { color: var(--red); }
.ctrl-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.ctrl-btn:hover  { background: rgba(0,229,255,0.1); color: var(--ice); }
.ctrl-btn.active { background: rgba(0,230,118,0.15); border-color: var(--green); color: var(--green); }
.ctrl-btn.danger { background: rgba(255,23,68,0.1); border-color: var(--red); color: var(--red); }
.ctrl-btn.danger:hover { background: rgba(255,23,68,0.2); }

/* Mode toggle buttons */
.mode-group { display: flex; gap: 2px; margin: 4px 0; }
.mode-btn {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 4px 6px;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn:hover { color: var(--ice); }
.mode-btn.active {
  background: rgba(0,230,118,0.12);
  border-color: var(--green);
  color: var(--green);
}

/* Slider control */
.ctrl-slider {
  width: 100%;
  margin: 4px 0;
  accent-color: var(--ice);
}
.ctrl-group { margin-bottom: 8px; }

/* Indicator lights */
.ind-light {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 4px;
  vertical-align: middle;
}
.ind-light.on    { background: var(--green); box-shadow: 0 0 4px var(--green); }
.ind-light.warn  { background: var(--amber); box-shadow: 0 0 4px var(--amber); }
.ind-light.alarm { background: var(--red);   box-shadow: 0 0 4px var(--red); animation: alarmblink 1s infinite; }

/* ══════════════════ FLOW ANIMATIONS ══════════════════ */
@keyframes cryoflow  { to { stroke-dashoffset: -16 } }
@keyframes flowup    { to { stroke-dashoffset:  16 } }
@keyframes flowdash  { to { stroke-dashoffset: -20 } }

.cryo-flow   { stroke-dasharray: 6 3; animation: cryoflow 0.8s linear infinite; }
.cryo-flow.stopped   { animation: none; opacity: 0.2; }
.glycol-flow { stroke-dasharray: 5 3; animation: flowup  0.8s linear infinite; }
.glycol-flow.stopped { animation: none; opacity: 0.15; }
.bog-flow    { stroke-dasharray: 6 4; animation: flowdash 0.9s linear infinite; }
.bog-flow.stopped    { animation: none; opacity: 0.15; }
.n2-flow     { stroke-dasharray: 4 6; animation: flowdash 1.2s linear infinite; }
.n2-flow.stopped     { animation: none; opacity: 0.15; }
.bunker-flow { stroke-dasharray: 8 3; animation: flowup  0.6s linear infinite; }
.bunker-flow.stopped { animation: none; opacity: 0.15; }

/* ══════════════════ MODE BADGE ══════════════════ */
.mode-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 4px 12px;
  border-radius: 3px;
  letter-spacing: 2px;
  display: inline-block;
  margin-bottom: 4px;
}
.mode-badge.gas   { background: rgba(0,230,118,0.2);   border: 1px solid var(--green); color: var(--green); }
.mode-badge.pilot { background: rgba(41,121,255,0.15);  border: 1px solid var(--blue);  color: var(--blue); }
.mode-badge.hfo   { background: rgba(255,171,0,0.15);   border: 1px solid var(--amber); color: var(--amber); }
.mode-badge.esd   { background: var(--red2); border: 1px solid var(--red); color: #fff; animation: alarmblink 0.5s infinite; }

/* ══════════════════ GAS DETECTION ══════════════════ */
.gas-det-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.gas-led {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.gas-led.clear { background: var(--green); box-shadow: 0 0 6px var(--green); }
.gas-led.warn  { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 0.8s infinite; }
.gas-led.alarm { background: var(--red);   box-shadow: 0 0 10px var(--red);  animation: blink 0.3s infinite; }
.gas-ppm { font-family: var(--font-mono); font-size: 11px; }

/* ══════════════════ GAS DETECTOR SAMPLE POINTS ══════════════════ */
.sample-pt {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 2px; cursor: pointer;
  transition: background 0.15s;
}
.sample-pt:hover { background: rgba(0,229,255,0.08); }
.sample-pt.active-sample { background: rgba(0,229,255,0.12); }
.sample-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.sample-dot.sampling { background: var(--amber); animation: blink 1s infinite; }
.sample-dot.sampled  { background: var(--green); }

/* ══════════════════ ENGINE CARDS ══════════════════ */
.eng-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 6px; margin-bottom: 3px;
  border: 1px solid var(--border); border-radius: 2px;
  font-size: 9px; font-family: var(--font-mono);
}
.eng-card .eng-name { color: var(--muted); }
.eng-card .eng-mode {
  padding: 1px 6px; border-radius: 2px;
  font-size: 8px; letter-spacing: 1px;
}
.eng-mode.gas   { background: rgba(0,230,118,0.2);  color: var(--green); }
.eng-mode.pilot { background: rgba(41,121,255,0.15); color: var(--blue); }
.eng-mode.off   { background: rgba(255,255,255,0.05); color: var(--muted); }
.eng-mode.bog   { background: rgba(255,171,0,0.15);  color: var(--amber); }

/* ══════════════════ VFD SLIDER ══════════════════ */
.vfd-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.vfd-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.vfd-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ice);
  cursor: pointer;
}
.vfd-val { font-family: var(--font-mono); font-size: 10px; color: var(--ice); min-width: 32px; text-align: right; }

/* ══════════════════ PROGRESS BAR ══════════════════ */
.progress-bar  { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 4px 0; }
.progress-fill { height: 100%; background: var(--blue); transition: width 0.5s; border-radius: 4px; }

/* ══════════════════ LOG ══════════════════ */
.log-entry { font-family: var(--font-mono); font-size: 9px; color: var(--muted); padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.log-time  { color: var(--ice); margin-right: 6px; }
.log-ok    { color: var(--green); }
.log-warn  { color: var(--amber); }
.log-alarm { color: var(--red); }

/* ══════════════════ SCENARIO STATUS ══════════════════ */
.scenario-box {
  background: rgba(0,229,255,0.05); border: 1px solid var(--border2);
  border-radius: 3px; padding: 6px 8px; margin-bottom: 5px; font-size: 10px;
}
.scenario-title { color: var(--ice); font-weight: 600; margin-bottom: 2px; }
.scenario-desc  { color: var(--muted); line-height: 1.5; }

/* ══════════════════ PIPELINE LINEUP ══════════════════ */
.pl-status { padding: 4px 6px; border-radius: 3px; font-family: var(--font-mono); font-size: 9px; margin-bottom: 6px; }
.pl-status.ok    { background: rgba(0,230,118,0.1);  color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.pl-status.fault { background: rgba(255,23,68,0.1);  color: var(--red);   border: 1px solid rgba(255,23,68,0.3); animation: alarmblink 1.5s infinite; }
.pl-status.idle  { background: rgba(0,229,255,0.05); color: var(--muted); border: 1px solid var(--border); }
.pl-sec  { font-family: var(--font-mono); font-size: 8px; color: var(--ice); padding: 4px 0 2px; border-bottom: 1px solid var(--border); letter-spacing: 1px; }
.pl-row  { display: flex; align-items: center; gap: 4px; padding: 2px 0; font-size: 9px; }
.pl-id   { font-family: var(--font-mono); color: var(--muted); min-width: 55px; }
.pl-desc { flex: 1; color: rgba(255,255,255,0.4); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-vbtn { font-family: var(--font-mono); font-size: 8px; padding: 2px 6px; border-radius: 2px; cursor: pointer; min-width: 38px; text-align: center; transition: all 0.15s; }
.pl-vbtn.open   { background: rgba(0,230,118,0.15); border: 1px solid var(--green); color: var(--green); }
.pl-vbtn.closed { background: rgba(255,23,68,0.1);  border: 1px solid var(--red);   color: var(--red); }
.pl-vbtn.req    { box-shadow: 0 0 4px var(--amber); }

/* ══════════════════ HOTLINKS ══════════════════ */
.hotlink {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ice);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.hotlink:hover { color: var(--green); }

/* ══════════════════ BUNKERING BUTTONS ══════════════════ */
.big-btn.blue { background: rgba(41,121,255,0.1); border-color: var(--blue); color: var(--blue); }
.big-btn.bunk { background: rgba(0,229,255,0.08); border-color: var(--ice);  color: var(--ice); }
.big-btn.bunk:hover { background: rgba(0,229,255,0.2); }

/* ══════════════════ IDLH BANNER ══════════════════ */
.idlh-banner {
  display: none; position: absolute; top: 0; left: 0; right: 0;
  background: var(--red2, #b71c1c); color: #fff; text-align: center;
  padding: 8px; font-size: 14px; font-weight: 700; letter-spacing: 3px;
  z-index: 50; animation: blink 0.5s infinite;
}
#idlh-banner { flex-shrink: 0; }

/* ══════════════════ RESPONSIVE ══════════════════ */
@media (max-width: 1200px) {
  .status-grid { grid-template-columns: 180px 1fr 180px; }
  .page-split  { grid-template-columns: 1fr 220px; }
}
@media (max-width: 1000px) {
  .status-grid { grid-template-columns: 160px 1fr 160px; }
  .page-split  { grid-template-columns: 1fr 200px; }
}
@media (max-height: 800px) {
  .status-grid { grid-template-rows: 1fr 160px; }
}
@media (max-height: 700px) {
  .status-grid { grid-template-rows: 1fr 140px; }
}
