/* =====================================================================
   BILAL'S EYE — Mission Control Stylesheet
   ===================================================================== */

:root {
  --bg-0: #020603;
  --bg-1: #04120a;
  --bg-2: #072014;
  --panel: rgba(3, 16, 10, 0.9);
  --panel-strong: rgba(4, 20, 13, 0.95);
  --panel-border: rgba(78, 255, 154, 0.26);
  --line-soft: rgba(74, 208, 132, 0.18);
  --accent-green: #47ff98;
  --accent-green-strong: #27d874;
  --text-main: #d6ffe6;
  --text-dim: #7fb79a;
  --danger: #ff6d8d;
  --warn: #ffb347;
  --shadow-glow: 0 0 22px rgba(71, 255, 152, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  position: relative;
  color: var(--text-main);
  font-family: "Share Tech Mono", "Consolas", "Monaco", monospace;
  background:
    radial-gradient(1300px 780px at 85% -20%, rgba(21, 118, 65, 0.34), transparent 60%),
    radial-gradient(820px 780px at -18% 120%, rgba(8, 110, 54, 0.28), transparent 55%),
    linear-gradient(130deg, var(--bg-0), var(--bg-1) 55%, var(--bg-2));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  opacity: 0.15;
  background:
    repeating-linear-gradient(0deg, rgba(53, 168, 102, 0.2) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgba(53, 168, 102, 0.14) 0 1px, transparent 1px 36px);
}

body::after {
  opacity: 0.1;
  background: repeating-linear-gradient(180deg, rgba(210, 255, 224, 0.4) 0 1px, transparent 1px 4px);
  animation: scan-flicker 6s linear infinite;
}

@keyframes scan-flicker {
  0%   { opacity: 0.08; }
  50%  { opacity: 0.13; }
  100% { opacity: 0.08; }
}

/* =====================================================================
   APP SHELL
   ===================================================================== */

#appShell {
  display: grid;
  grid-template-rows: 74px 1fr;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* =====================================================================
   TOP BAR
   ===================================================================== */

#topBar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(2, 12, 8, 0.95), rgba(2, 11, 7, 0.84));
  backdrop-filter: blur(6px);
  box-shadow: inset 0 -1px 0 rgba(127, 223, 167, 0.12), var(--shadow-glow);
  z-index: 1000;
  position: relative;
}

#topBar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--accent-green) 40%, transparent 95%);
  animation: headerLine 5s ease infinite;
  pointer-events: none;
}

@keyframes headerLine {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.7; }
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brandMark {
  width: 12px;
  height: 42px;
  border-radius: 7px;
  background: linear-gradient(180deg, #7cffb5, var(--accent-green-strong));
  box-shadow: 0 0 18px rgba(71, 255, 152, 0.42);
  animation: brandPulse 4s ease infinite;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(71, 255, 152, 0.42); }
  50%       { box-shadow: 0 0 28px rgba(71, 255, 152, 0.65); }
}

.brandBlock h1 {
  margin: 0;
  font-family: "Orbitron", "Share Tech Mono", monospace;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d8ffe7;
}

.brandBlock p {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.8px;
}

/* =====================================================================
   SEARCH
   ===================================================================== */

.searchGroup {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.searchGroup label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.searchGroup input {
  width: 100%;
  min-width: 150px;
  height: 35px;
  border-radius: 8px;
  border: 1px solid rgba(92, 238, 150, 0.34);
  background: rgba(6, 24, 14, 0.9);
  color: var(--text-main);
  padding: 0 12px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(52, 130, 82, 0.2);
  font-family: "Share Tech Mono", monospace;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.searchGroup input::placeholder {
  color: rgba(134, 193, 157, 0.75);
}

.searchGroup input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(71, 255, 152, 0.2), inset 0 0 14px rgba(71, 255, 152, 0.1);
}

.searchSuggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1200;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(92, 238, 150, 0.32);
  background: rgba(5, 19, 11, 0.96);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
}

.searchSuggestions[hidden] {
  display: none;
}

.searchSuggestionItem {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(74, 208, 132, 0.16);
  background: transparent;
  color: var(--text-main);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.searchSuggestionItem:last-child {
  border-bottom: 0;
}

.searchSuggestionItem:hover,
.searchSuggestionItem.active {
  background: rgba(71, 255, 152, 0.14);
}

/* =====================================================================
   WORKSPACE GRID
   ===================================================================== */

#workspace {
  display: grid;
  grid-template-columns: 285px 1fr 310px;
  width: 100%;
  height: calc(100vh - 74px);
  gap: 10px;
  padding: 10px;
  transition: grid-template-columns 0.3s ease;
}

#workspace.left-collapsed {
  grid-template-columns: 42px 1fr 310px;
}

#workspace.right-collapsed {
  grid-template-columns: 285px 1fr 42px;
}

/* =====================================================================
   PANEL BASE
   ===================================================================== */

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(32, 104, 64, 0.24), var(--shadow-glow);
  display: flex;
  flex-direction: column;
}

.panelHeader {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(3, 14, 9, 0.55);
  min-height: 42px;
}

.panelHeaderTitle {
  font-family: "Orbitron", "Share Tech Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #b9ffd6;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.25s ease;
  flex: 1;
}

.panelInner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
  transition: opacity 0.25s ease;
}

/* Collapsed state hides inner content but leaves header */
#workspace.left-collapsed #leftPanel .panelInner,
#workspace.left-collapsed #leftPanel .panelHeaderTitle {
  opacity: 0;
  pointer-events: none;
}

#workspace.right-collapsed #rightPanel .panelInner,
#workspace.right-collapsed #rightPanel .panelHeaderTitle,
#workspace.right-collapsed #rightPanel .tabBar {
  opacity: 0;
  pointer-events: none;
}

/* Flip the collapse button arrow when panel is collapsed */
#workspace.left-collapsed #leftPanelToggle {
  transform: scaleX(-1);
}

#workspace.right-collapsed #rightPanelToggle {
  transform: scaleX(-1);
}

/* =====================================================================
   COLLAPSE BUTTON
   ===================================================================== */

.panelCollapseBtn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: rgba(4, 20, 12, 0.8);
  color: var(--accent-green);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s, transform 0.3s ease;
  padding: 0;
}

.panelCollapseBtn:hover {
  background: rgba(71, 255, 152, 0.14);
  box-shadow: 0 0 8px rgba(71, 255, 152, 0.22);
}

/* Right panel: collapse button sits at left of header */
.panelCollapseBtnAlt {
  order: -1;
}

/* =====================================================================
   PANEL H2 (section headings inside tabs)
   ===================================================================== */

.panel h2 {
  margin: 0 0 10px;
  font-family: "Orbitron", "Share Tech Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #b9ffd6;
}

/* =====================================================================
   TABS
   ===================================================================== */

.tabBar {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  transition: opacity 0.25s ease;
}

.tabBtn {
  flex: 1;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: rgba(4, 16, 10, 0.6);
  color: var(--text-dim);
  font-family: "Orbitron", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  padding: 0 6px;
}

.tabBtn:hover {
  background: rgba(71, 255, 152, 0.08);
  color: var(--text-main);
}

.tabBtn.active {
  background: rgba(71, 255, 152, 0.14);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 8px rgba(71, 255, 152, 0.14);
}

.tabBadge {
  padding: 1px 4px;
  border-radius: 8px;
  background: rgba(255, 109, 141, 0.22);
  border: 1px solid rgba(255, 109, 141, 0.5);
  color: #ff9bb5;
  font-size: 9px;
  font-family: "Share Tech Mono", monospace;
  transition: opacity 0.2s;
}

.tabBadge[data-count="0"] {
  opacity: 0;
}

.tabPanel {
  display: none;
}

.tabPanel.tabPanelActive {
  display: block;
}

/* =====================================================================
   LAYER SECTIONS
   ===================================================================== */

.layerSection {
  margin-bottom: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.layerSectionTitle {
  margin: 0;
  padding: 5px 10px;
  font-family: "Orbitron", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  background: rgba(5, 18, 11, 0.7);
  border-bottom: 1px solid var(--line-soft);
}

.layerSectionBody {
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Layer row with toggle on the right */
.layerToggleRow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(6, 20, 12, 0.4);
  transition: background 0.15s;
}

.layerToggleRow:hover {
  background: rgba(71, 255, 152, 0.06);
}

.layerToggleName {
  flex: 1;
  min-width: 0;
}

/* Layer count badge */
.layerBadge {
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(255, 109, 141, 0.14);
  border: 1px solid rgba(255, 109, 141, 0.34);
  color: #ff9bb5;
  font-size: 9px;
  font-family: "Share Tech Mono", monospace;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.layerBadge[data-count="0"] {
  opacity: 0;
}

/* =====================================================================
   MINI TOGGLE SWITCH
   ===================================================================== */

.miniToggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.miniToggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.miniToggleTrack {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  border: 1px solid rgba(91, 239, 149, 0.34);
  background: rgba(7, 24, 14, 0.95);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.miniToggleKnob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4a6a54, #2a4a36);
  box-shadow: 0 0 4px rgba(71, 255, 152, 0.2);
  transition: transform 0.2s ease, background 0.2s, box-shadow 0.2s;
}

.miniToggle input:checked + .miniToggleTrack {
  background: rgba(71, 255, 152, 0.12);
  border-color: rgba(71, 255, 152, 0.5);
}

.miniToggle input:checked + .miniToggleTrack .miniToggleKnob {
  transform: translateX(16px);
  background: linear-gradient(180deg, #7cffb5, #2adf7f);
  box-shadow: 0 0 8px rgba(71, 255, 152, 0.5);
}

/* =====================================================================
   SATELLITE GROUP FILTERS (kept as native checkboxes for sub-items)
   ===================================================================== */

.satGroupFilters {
  display: grid;
  gap: 5px;
  margin-top: 2px;
  padding-left: 10px;
  border-left: 1px solid var(--line-soft);
}

.layerItem {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 24, 15, 0.6);
}

.layerItem input {
  accent-color: var(--accent-green);
}

.layerSubItem {
  margin: 0;
  padding: 3px 6px;
  font-size: 12px;
}

.layerSubItem.disabled {
  opacity: 0.44;
}

.satGroupDot {
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  flex: 0 0 auto;
}

.satGroupDotGeo   { background: #ffd700; }
.satGroupDotHeo   { background: #c060ff; }
.satGroupDotSso   { background: #ff9b42; }
.satGroupDotPolar { background: #4ca8ff; }
.satGroupDotLeo   { background: #47e4ff; }
.satGroupDotMeo   { background: #69ff47; }

/* =====================================================================
   SOURCE TOGGLE (aircraft source OpenSky / FR24)
   ===================================================================== */

.sourceToggleCard {
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(7, 22, 14, 0.72);
}

.sourceToggleTitle {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.sourceToggleWrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.sourceToggleWrap input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sourceToggleLabel {
  font-size: 12px;
  color: var(--text-main);
}

.sourceToggleTrack {
  position: relative;
  width: 52px;
  height: 26px;
  border-radius: 13px;
  border: 1px solid rgba(91, 239, 149, 0.36);
  background: rgba(7, 24, 14, 0.95);
  box-shadow: inset 0 0 10px rgba(71, 255, 152, 0.1);
  flex: 0 0 auto;
}

.sourceToggleKnob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7cffb5, #2adf7f);
  box-shadow: 0 0 10px rgba(71, 255, 152, 0.45);
  transition: transform 0.2s ease;
}

#aircraftBackupToggle:checked + .sourceToggleTrack .sourceToggleKnob {
  transform: translateX(26px);
}

.sourceToggleMode {
  margin: 7px 0 0;
  font-size: 11px;
  color: var(--text-dim);
}

/* =====================================================================
   PANEL STATS
   ===================================================================== */

.panelStats {
  margin-top: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.panelStats p {
  margin: 7px 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}

.panelStats strong {
  color: var(--accent-green);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   SENSOR BLOCK
   ===================================================================== */

.panelSensorBlock {
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.sensorGroup {
  display: flex;
  gap: 8px;
}

.panelSensorGroup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.sensorBtn {
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(91, 239, 149, 0.32);
  background: linear-gradient(180deg, rgba(5, 20, 12, 0.95), rgba(5, 18, 12, 0.84));
  color: var(--text-main);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.4px;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
}

.sensorBtn:hover {
  border-color: var(--accent-green);
  box-shadow: inset 0 0 14px rgba(71, 255, 152, 0.12), 0 0 10px rgba(71, 255, 152, 0.16);
  transform: translateY(-1px);
}

.sensorBtn.active {
  border-color: var(--accent-green);
  color: #ebfff2;
  box-shadow: inset 0 0 18px rgba(71, 255, 152, 0.18), 0 0 16px rgba(71, 255, 152, 0.28);
}

/* Keyboard shortcut hint */
.shortcutHint {
  margin: 10px 0 0;
  font-size: 9px;
  color: rgba(127, 183, 154, 0.55);
  line-height: 1.6;
}

.shortcutHint kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid rgba(127, 183, 154, 0.3);
  border-radius: 3px;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  background: rgba(5, 18, 11, 0.6);
  color: rgba(127, 183, 154, 0.7);
}

/* =====================================================================
   GLOBE PANEL
   ===================================================================== */

#globePanel {
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  position: relative;
  background: #010603;
  box-shadow: inset 0 0 0 1px rgba(34, 101, 63, 0.3), var(--shadow-glow);
}

/* Inner border overlay */
#globePanel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(95, 233, 149, 0.12);
  mix-blend-mode: screen;
  z-index: 2;
}

/* Center reticle */
#globePanel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 1px solid rgba(71, 255, 152, 0.22);
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 0 4px rgba(71, 255, 152, 0.04);
}

#cesiumContainer {
  width: 100%;
  height: 100%;
}

/* =====================================================================
   MISSION GRID (right panel telemetry)
   ===================================================================== */

.missionGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 16px;
}

.missionGrid p {
  display: flex;
  justify-content: space-between;
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 5px;
  font-size: 12px;
}

.missionGrid span {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.missionGrid strong {
  color: var(--text-main);
  text-align: right;
  max-width: 58%;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   TELEMETRY BLOCK
   ===================================================================== */

.telemetryBlock {
  background: rgba(5, 18, 11, 0.86);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px;
}

.telemetryBlock p {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.telemetryBlock p:not(#statusLine) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line-soft);
}

.telemetryBlock p:not(#statusLine) span {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.telemetryBlock p:not(#statusLine) strong {
  color: var(--text-main);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Sync value group (freshness dot + timestamp) */
.syncValueGroup {
  display: flex;
  align-items: center;
  gap: 5px;
}

#statusLine {
  margin-top: 9px;
  padding-top: 6px;
}

/* =====================================================================
   FRESHNESS DOT
   ===================================================================== */

.freshnessDot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.6s, box-shadow 0.6s;
}

.freshnessDot-fresh   { background: #47ff98; box-shadow: 0 0 6px rgba(71, 255, 152, 0.55); }
.freshnessDot-stale   { background: #ffb347; box-shadow: 0 0 6px rgba(255, 179, 71, 0.45); }
.freshnessDot-old     { background: #ff6d8d; box-shadow: 0 0 6px rgba(255, 109, 141, 0.45); }
.freshnessDot-unknown { background: rgba(127, 183, 154, 0.35); box-shadow: none; }

/* =====================================================================
   ALERTS TAB
   ===================================================================== */

.alertsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alertsEmpty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 8px 16px;
  margin: 0;
  line-height: 1.7;
}

.alertsEmptySub {
  font-size: 10px;
  opacity: 0.65;
}

.alertZoneItem {
  border: 1px solid rgba(255, 109, 141, 0.28);
  border-left: 3px solid #ff6d8d;
  border-radius: 8px;
  background: rgba(10, 3, 6, 0.8);
  padding: 10px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.3s;
}

.alertZoneItem:hover {
  border-color: rgba(255, 109, 141, 0.55);
  border-left-color: #ff6d8d;
}

.alertZoneTitle {
  color: #ff9bb5;
  font-size: 11px;
  font-family: "Orbitron", monospace;
  letter-spacing: 0.5px;
  margin: 0 0 7px;
}

.alertZoneRow {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  margin: 3px 0;
  font-size: 11px;
}

.alertZoneRow strong {
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.alertZoneCallsigns {
  margin-top: 7px;
  font-size: 10px;
  color: rgba(134, 193, 157, 0.6);
  word-break: break-all;
  line-height: 1.5;
}

.intensityBar {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 109, 141, 0.15);
  margin-top: 7px;
  overflow: hidden;
}

.intensityBarFill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffb347, #ff6d8d);
  transition: width 0.5s ease;
}

/* =====================================================================
   TOAST NOTIFICATIONS
   ===================================================================== */

#toastContainer {
  position: fixed;
  top: 82px;
  right: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: 340px;
}

.toast {
  pointer-events: auto;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid;
  background: rgba(4, 18, 11, 0.96);
  backdrop-filter: blur(10px);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-main);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  animation: toastSlideIn 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-dismissing {
  opacity: 0;
  transform: translateX(24px);
}

.toast-info  { border-color: var(--accent-green); }
.toast-warn  { border-color: var(--warn); color: #ffe0a0; }
.toast-error { border-color: var(--danger); color: #ffb0c0; }
.toast-alert {
  border-color: #ff4444;
  color: #ffb0b0;
  animation: toastSlideIn 0.3s ease, toastPulse 2s ease infinite;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastPulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }
  50%       { box-shadow: 0 4px 22px rgba(255, 68, 68, 0.28); }
}

/* =====================================================================
   CESIUM OVERRIDES
   ===================================================================== */

.cesium-credit-container,
.cesium-credit-textContainer,
.cesium-widget-credits {
  display: none !important;
}

.cesium-viewer-timelineContainer {
  display: none !important;
}

.cesium-viewer-animationContainer {
  display: none;
}

/* =====================================================================
   SCROLLBAR
   ===================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(4, 17, 11, 0.9);
}

::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(64, 191, 120, 0.55);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 241, 145, 0.72);
}

/* =====================================================================
   OBJECT INFO PANEL
   ===================================================================== */

.objNameLink {
  color: #47e4ff;
  text-decoration: underline;
  cursor: pointer;
}

.objNameLink:hover {
  color: #a8f4ff;
}

.objInfoEmpty {
  color: #7a9ba8;
  font-size: 12px;
  padding: 12px 0;
  text-align: center;
  margin: 0;
}

/* Telemetry sub-section headers (Satellite / Aircraft / Maritime) */
.telemetrySubHeader {
  margin-top: 8px !important;
  padding: 4px 0 3px !important;
  border-bottom: 1px solid rgba(71, 255, 152, 0.22) !important;
  border-top: none !important;
}

.telemetrySubHeader span {
  font-family: "Orbitron", monospace;
  font-size: 9px;
  letter-spacing: 1.1px;
  color: var(--accent-green);
  text-transform: uppercase;
}

/* Left-panel inline stat rows (tracks / satellite counts) */
.layerStatRow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 6px 4px;
}

.layerStatRow strong {
  color: var(--accent-green);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

/* =====================================================================
   GLOBAL CLOCK
   ===================================================================== */

.clockBlock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.clockTime {
  font-family: "Orbitron", "Share Tech Mono", monospace;
  font-size: 15px;
  color: var(--accent-green);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.clockDate {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.8px;
}

.clockTzSelect {
  font-size: 9px;
  font-family: "Share Tech Mono", monospace;
  background: rgba(4, 16, 10, 0.85);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 1px 4px;
  cursor: pointer;
  outline: none;
  margin-bottom: 1px;
}

.clockTzSelect:focus {
  border-color: var(--accent-green);
}

/* =====================================================================
   TOP BAR BUTTON (AI toggle)
   ===================================================================== */

.topBarBtn {
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--panel-border);
  background: rgba(4, 16, 10, 0.75);
  color: var(--text-dim);
  font-family: "Orbitron", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.topBarBtn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(71, 255, 152, 0.1);
}

/* =====================================================================
   AI INTELLIGENCE QUERY PANEL
   ===================================================================== */

.aiPanel {
  position: fixed;
  bottom: 16px;
  right: 336px;
  width: 430px;
  background: rgba(3, 14, 9, 0.97);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  z-index: 8000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  backdrop-filter: blur(12px);
}

.aiPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  user-select: none;
}

.aiPanelHeader:hover {
  background: rgba(71, 255, 152, 0.04);
}

.aiPanelTitle {
  font-family: "Orbitron", "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--accent-green);
  text-transform: uppercase;
}

.aiPanelToggleBtn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.aiPanelBody {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.aiResults {
  min-height: 56px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-main);
  padding: 2px 0;
}

.aiResultText {
  color: var(--text-main);
  white-space: pre-wrap;
}

.aiResultError {
  color: var(--danger);
}

.aiResultEmpty {
  color: var(--text-dim);
  font-size: 11px;
  margin: 0;
  padding: 4px 0;
}

.aiInputRow {
  display: flex;
  gap: 7px;
}

.aiQueryInput {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(92, 238, 150, 0.34);
  background: rgba(6, 22, 13, 0.9);
  color: var(--text-main);
  padding: 0 10px;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.aiQueryInput::placeholder {
  color: rgba(134, 193, 157, 0.6);
}

.aiQueryInput:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(71, 255, 152, 0.15);
}

.aiSubmitBtn {
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--accent-green);
  background: rgba(71, 255, 152, 0.12);
  color: var(--accent-green);
  font-family: "Orbitron", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.aiSubmitBtn:hover {
  background: rgba(71, 255, 152, 0.2);
  box-shadow: 0 0 10px rgba(71, 255, 152, 0.2);
}

.aiSubmitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================================
   RESPONSIVE BREAKPOINTS
   ===================================================================== */

@media (max-width: 1280px) {
  #topBar {
    grid-template-columns: 220px 1fr 1fr auto auto;
  }

  #workspace {
    grid-template-columns: 245px 1fr 275px;
  }

  #workspace.left-collapsed {
    grid-template-columns: 42px 1fr 275px;
  }

  #workspace.right-collapsed {
    grid-template-columns: 245px 1fr 42px;
  }
}

@media (max-width: 960px) {
  html,
  body {
    overflow-y: auto;
    height: auto;
  }

  #appShell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
  }

  #workspace {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    transition: none;
    overflow-y: visible;
  }

  #globePanel {
    height: 60vh;
    min-height: 300px;
    flex-shrink: 0;
    order: 1;
  }

  #leftPanel {
    order: 0;
    max-height: none;
    height: auto;
  }

  #rightPanel {
    order: 2;
    max-height: none;
    height: auto;
  }

  #topBar {
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 8px;
    height: auto;
    padding: 10px;
  }

  .brandBlock {
    grid-column: 1;
    grid-row: 1;
  }

  .clockBlock {
    grid-column: 2;
    grid-row: 1;
  }

  #aiPanelOpenBtn {
    grid-column: 3;
    grid-row: 1;
  }

  .searchGroup {
    grid-column: 1 / -1;
  }

  .searchGroup:last-of-type {
    display: none;
  }

  .panelCollapseBtn {
    display: none;
  }

  .aiPanel {
    position: fixed;
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 10px;
  }
}
