*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a0f; font-family: 'Courier New', monospace; color: #c8d0d8; }
#cesiumContainer { width: 100%; height: 100%; position: absolute; top: 0; left: 0; transition: filter 0.4s ease, border-radius 0.4s ease; }

/* Display mode filters */
#cesiumContainer.mode-nvg {
  filter: saturate(0) brightness(0.8) sepia(1) hue-rotate(70deg) saturate(2.5) brightness(0.7);
}
#cesiumContainer.mode-thermal {
  filter: saturate(0) brightness(0.9) sepia(1) hue-rotate(180deg) saturate(3) contrast(1.2);
}
#cesiumContainer.mode-crt {
  filter: brightness(0.95) contrast(1.1) saturate(0.8) sepia(0.15) hue-rotate(70deg) saturate(1.3);
  border-radius: 18px;
  overflow: hidden;
}

/* Hide ALL default Cesium UI */
.cesium-viewer-toolbar,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-bottom,
.cesium-viewer-fullscreenContainer,
.cesium-viewer-vrContainer,
.cesium-viewer-geocoderContainer,
.cesium-viewer-selectionIndicator,
.cesium-viewer-infoBoxContainer,
.cesium-credit-logoContainer,
.cesium-credit-expand-link,
.cesium-widget-credits,
.cesium-credit-textContainer { display: none !important; }

/* Scanlines overlay */
#scanlines {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 50; display: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}
#scanlines.crt-scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.25) 0px,
    rgba(0,0,0,0.25) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* Vignette overlay */
#vignette {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 50; display: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.7) 100%);
}
#vignette.crt-vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.85) 100%);
}

/* Mode indicator popup (flash on switch) */
#mode-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 8px;
  color: rgba(220, 235, 255, 0.9);
  text-shadow: 0 0 30px rgba(100, 160, 255, 0.6), 0 0 60px rgba(60, 100, 200, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  user-select: none;
}
#mode-indicator.show {
  opacity: 1;
}

/* Mode bar in top area */
#mode-bar {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(120, 140, 170, 0.4);
  user-select: none;
  display: flex;
  gap: 12px;
}
#mode-bar .mode-option {
  padding: 1px 6px;
  border-radius: 2px;
  transition: all 0.3s ease;
}
#mode-bar .mode-option.active {
  color: rgba(200, 220, 255, 0.9);
  background: rgba(60, 100, 180, 0.25);
  border: 1px solid rgba(100, 150, 220, 0.3);
  text-shadow: 0 0 8px rgba(100, 160, 255, 0.4);
}

/* Glassmorphism panel base */
.panel {
  position: absolute;
  background: rgba(10, 12, 20, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(100, 120, 160, 0.18);
  border-radius: 6px;
  padding: 14px 18px;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

/* Title */
#title {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-size: 13px;
  letter-spacing: 6px;
  font-variant: small-caps;
  color: rgba(180, 195, 220, 0.7);
  text-shadow: 0 0 20px rgba(100, 140, 220, 0.3);
  user-select: none;
}

/* UTC Clock */
#clock {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(140, 165, 200, 0.55);
  user-select: none;
}

/* Mouse coordinates */
#coords {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 100;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: rgba(140, 160, 190, 0.45);
  user-select: none;
  letter-spacing: 1px;
}

/* Stats panel — top left */
#stats {
  top: 14px;
  left: 14px;
  min-width: 210px;
}
#stats h3 {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(140, 160, 190, 0.6);
  margin-bottom: 10px;
  font-weight: 400;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(60, 70, 90, 0.25);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: rgba(160, 175, 200, 0.7); }
.stat-value { font-weight: bold; color: #e0e8f0; font-size: 13px; }
.stat-time { font-size: 9px; color: rgba(120, 135, 160, 0.5); margin-top: 2px; }
.stat-detail { font-size: 9px; color: rgba(180, 150, 100, 0.6); margin-top: 1px; margin-bottom: 4px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; }
.dot-eq { background: #e84040; animation: eq-glow 2s ease-in-out infinite; }
.dot-ac { background: #00e5ff; }
.dot-sat { background: #7fff7f; }
.dot-vol { background: #ff8c00; }
.dot-wx { background: #a060ff; }

/* Earthquake dot glow pulse */
@keyframes eq-glow {
  0%, 100% { box-shadow: 0 0 3px rgba(232, 64, 64, 0.6); }
  50% { box-shadow: 0 0 8px rgba(232, 64, 64, 0.9), 0 0 14px rgba(232, 64, 64, 0.4); }
}

/* ISS dot - pulsing cyan-green */
.dot-iss { background: #00ffaa; animation: iss-glow 1.5s ease-in-out infinite; }
@keyframes iss-glow {
  0%, 100% { box-shadow: 0 0 3px rgba(0, 255, 170, 0.6); }
  50% { box-shadow: 0 0 10px rgba(0, 255, 170, 0.9), 0 0 18px rgba(0, 255, 170, 0.4); }
}

/* Layer control — top right */
#layers {
  top: 14px;
  right: 14px;
  min-width: 200px;
}
#layers h3 {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(140, 160, 190, 0.6);
  margin-bottom: 10px;
  font-weight: 400;
}
.layer-row {
  display: flex;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.layer-row kbd {
  margin-left: auto;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: rgba(120, 140, 170, 0.4);
  border: 1px solid rgba(100, 120, 160, 0.2);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 16px;
}
.layer-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(120, 140, 180, 0.4);
  border-radius: 3px;
  background: rgba(20, 25, 40, 0.6);
  margin-right: 8px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.layer-row input[type="checkbox"]:checked {
  background: rgba(60, 100, 180, 0.4);
  border-color: rgba(100, 150, 220, 0.6);
}
.layer-row input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 11px;
  color: #a0c0ff;
}

/* Layer divider */
.layer-divider {
  height: 1px;
  background: rgba(100, 120, 160, 0.15);
  margin: 4px 0;
}

/* Info popup */
#info-popup {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  max-width: 400px;
  display: none;
  text-align: center;
}
#info-popup .info-content {
  font-size: 12px;
  line-height: 1.6;
}
#info-popup .info-title {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 4px;
}
#info-popup .info-close {
  position: absolute;
  top: 6px;
  right: 10px;
  cursor: pointer;
  color: rgba(160,170,190,0.6);
  font-size: 14px;
}
#info-popup .info-close:hover { color: #fff; }

/* Warning banner */
#warnings {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 100;
  font-size: 10px;
  color: rgba(220, 180, 80, 0.8);
  max-width: 260px;
  text-align: right;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}
.dot-nuc { background: #00ff96; }
.dot-eon { background: #ffd700; }
.dot-ship { background: #4fc3f7; }

/* ─── Search Bar ──────────────────────────────────────── */
#search-container {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  width: 280px;
}
#search-input {
  width: 100%;
  background: rgba(10, 12, 20, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(100, 120, 160, 0.18);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(200, 210, 230, 0.85);
  outline: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#search-input::placeholder {
  color: rgba(120, 140, 170, 0.35);
  letter-spacing: 2px;
}
#search-input:focus {
  border-color: rgba(100, 150, 220, 0.4);
  box-shadow: 0 2px 20px rgba(60, 100, 200, 0.15), 0 2px 16px rgba(0,0,0,0.4);
}
#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(10, 12, 20, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(100, 120, 160, 0.18);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 180px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
#search-results .search-result-item {
  padding: 7px 12px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: rgba(170, 185, 210, 0.75);
  cursor: pointer;
  border-bottom: 1px solid rgba(60, 70, 90, 0.2);
  letter-spacing: 0.5px;
  transition: background 0.15s ease;
}
#search-results .search-result-item:last-child {
  border-bottom: none;
}
#search-results .search-result-item:hover {
  background: rgba(60, 100, 180, 0.15);
  color: rgba(200, 215, 240, 0.9);
}
#search-results::-webkit-scrollbar { width: 4px; }
#search-results::-webkit-scrollbar-track { background: transparent; }
#search-results::-webkit-scrollbar-thumb { background: rgba(100, 120, 160, 0.25); border-radius: 2px; }
