* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", Arial, sans-serif;
}

:root {
  --bg: #050a15;
  --panel: rgba(11, 18, 36, 0.74);
  --panel-strong: rgba(10, 18, 35, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f7ff;
  --muted: #8ea8cb;
  --accent: #67b8ff;
  --accent-2: #00d8ff;
}

body {
  background:
    radial-gradient(circle at top, rgba(64, 122, 255, 0.22), transparent 28%),
    radial-gradient(
      circle at bottom right,
      rgba(0, 216, 255, 0.16),
      transparent 24%
    ),
    linear-gradient(135deg, #040914 0%, #090f20 48%, #07101d 100%);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(
      circle at 20% 18%,
      rgba(255, 255, 255, 0.68) 0 1.5px,
      transparent 1.6px
    ),
    radial-gradient(
      circle at 78% 12%,
      rgba(255, 255, 255, 0.65) 0 1px,
      transparent 1.3px
    ),
    radial-gradient(
      circle at 42% 32%,
      rgba(255, 255, 255, 0.45) 0 1.1px,
      transparent 1.2px
    ),
    radial-gradient(
      circle at 85% 62%,
      rgba(255, 255, 255, 0.42) 0 1px,
      transparent 1.2px
    ),
    radial-gradient(
      circle at 12% 78%,
      rgba(255, 255, 255, 0.4) 0 1px,
      transparent 1.2px
    ),
    radial-gradient(
      circle at 54% 78%,
      rgba(255, 255, 255, 0.52) 0 1.2px,
      transparent 1.3px
    );
  opacity: 0.55;
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #ff5b5b, #ff9a3d);
  color: #180a04;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  transform: translateY(0);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.offline-banner.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #180a04;
  animation: statusPulseDark 1.4s infinite;
}

@keyframes statusPulseDark {
  0% {
    box-shadow: 0 0 0 0 rgba(24, 10, 4, 0.55);
  }
  100% {
    box-shadow: 0 0 0 9px rgba(24, 10, 4, 0);
  }
}

.topbar {
  height: 78px;
  background: rgba(6, 12, 26, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 5;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  pointer-events: none;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7ec4ff;
  text-shadow: 0 0 18px rgba(92, 157, 255, 0.7);
}

.logo-wrap p {
  color: #94a8c8;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d5def2;
  font-weight: 700;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: statusPulse 1.8s infinite;
}

.timestamp {
  color: #9db2d3;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 700;
}

.container {
  display: flex;
  height: calc(100vh - 78px - 65px);
  gap: 18px;
  padding: 18px 18px 8px 18px;
}

.sidebar {
  width: 360px;
  padding: 20px;
  background: rgba(10, 16, 30, 0.68);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.section-label {
  font-size: 11px;
  margin: 0 0 10px;
  color: #8ea7c8;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 800;
}

.panel-section {
  margin-bottom: 16px;
}

.card {
  --rotateX: 2deg;
  --rotateY: -2deg;
  --spotlight-x: 50%;
  --spotlight-y: 50%;
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at var(--spotlight-x) var(--spotlight-y),
      rgba(102, 184, 255, 0.2),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(27, 38, 62, 0.95), rgba(12, 20, 38, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  transform: perspective(1200px) rotateX(var(--rotateX)) rotateY(var(--rotateY))
    translateY(0);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.09),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}

.card:hover::before {
  transform: translateX(100%);
}

.card.is-active {
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(103, 184, 255, 0.48);
}

.card:hover {
  --rotateX: 12deg;
  --rotateY: -12deg;
  transform: perspective(900px) rotateX(var(--rotateX)) rotateY(var(--rotateY))
    translateY(-12px) scale(1.03);
  border-color: rgba(103, 184, 255, 0.55);
}

.selected {
  border-color: rgba(98, 172, 255, 0.82);
  box-shadow:
    0 0 0 1px rgba(98, 172, 255, 0.24),
    0 18px 38px rgba(24, 58, 112, 0.42);
}

.card-heading {
  font-size: 16px;
  font-weight: 800;
  color: #f9fbff;
  margin-bottom: 12px;
}

.status-row,
.metric-row,
.pass-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.status-row:last-child,
.metric-row:last-child,
.pass-row:last-child {
  border-bottom: none;
}

.status-row span,
.metric-row span,
.pass-row span {
  color: #95a9ca;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.status-row strong,
.metric-row strong,
.pass-row strong {
  font-family: "JetBrains Mono", monospace;
  color: #f8fbff;
  font-size: 14px;
  text-align: right;
}

.telemetry-card strong {
  font-size: 16px;
}

.controls {
  display: grid;
  gap: 10px;
}

button {
  border: none;
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #08111d;
  background: linear-gradient(135deg, #6ab0ff, #32d6ff);
  box-shadow: 0 10px 26px rgba(30, 108, 191, 0.5);
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(45, 153, 255, 0.56);
}

button:active {
  transform: translateY(0);
}

button {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  animation: rippleExpand 0.6s ease-out forwards;
}

@keyframes rippleExpand {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

button:disabled,
button.is-disabled {
  cursor: not-allowed;
  filter: grayscale(0.5) brightness(0.7);
  box-shadow: none;
  transform: none !important;
}

.map-shell {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  background: #06101e;
}

.map-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-switcher {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: rgba(10, 17, 33, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.view-tab {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  background: transparent;
  color: #d8e4f8;
  box-shadow: none;
}

.view-tab.is-active {
  background: linear-gradient(
    135deg,
    rgba(92, 158, 255, 0.9),
    rgba(45, 214, 255, 0.95)
  );
  color: #07111d;
}

.status-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(5, 12, 24, 0.8);
  color: #95b7df;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-surface,
.globe-view {
  position: absolute;
  inset: 0;
}

.globe-view {
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at center,
      rgba(53, 138, 255, 0.35),
      rgba(3, 9, 20, 0.95) 60%
    ),
    #07101d;
}

.globe-view.hidden {
  display: none;
}

.globe-view canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  touch-action: none;
}

.globe-view canvas:active {
  cursor: grabbing;
}

.globe-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(10, 17, 33, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 5;
}

.globe-hint.is-hidden {
  opacity: 0;
}

.camera-mode-switcher {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 12px;
  background: rgba(10, 17, 33, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  z-index: 6;
}

.camera-mode-tab {
  width: auto;
  padding: 8px 13px;
  font-size: 12px;
  background: transparent;
  color: #c4d3ec;
  box-shadow: none;
}

.camera-mode-tab.is-active {
  background: linear-gradient(
    135deg,
    rgba(92, 158, 255, 0.9),
    rgba(45, 214, 255, 0.95)
  );
  color: #07111d;
}

.globe-fallback {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 40px;
  background: rgba(6, 12, 26, 0.92);
  color: #dbe6fa;
}

.globe-fallback.hidden {
  display: none;
}

.globe-fallback-sub {
  color: #8ea7c8;
  font-size: 13px;
}

.globe-zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.globe-zoom-controls button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 17, 33, 0.78);
  backdrop-filter: blur(10px);
  color: #eaf3ff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.globe-zoom-controls button:hover {
  background: rgba(20, 34, 62, 0.92);
}

.globe-zoom-controls button:active {
  transform: scale(0.94);
}

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

.leaflet-container {
  background: #051222;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.46) !important;
}

.leaflet-control-zoom a {
  background: rgba(13, 22, 40, 0.9) !important;
  color: #f8fbff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(15, 25, 46, 0.96);
  color: #f8fbff;
}

.leaflet-popup-content {
  font-family: "Inter", Arial, sans-serif;
}

.iss-marker {
  width: 54px !important;
  height: 54px !important;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
}

.iss-marker .satellite-core {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    #dff3ff,
    #78cbff 40%,
    #0d1e44 78%
  );
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 12px rgba(105, 210, 255, 0.9),
    0 0 24px rgba(15, 107, 255, 0.5);
  position: relative;
}

.iss-marker .satellite-core::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.iss-marker .satellite-core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(100, 205, 255, 0.58);
  box-shadow: 0 0 0 8px rgba(100, 205, 255, 0.12);
  animation: pulseRing 2.7s infinite;
}

.iss-marker .satellite-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 14px solid #f8fbff;
  transform: translateY(-20px);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.hud-bar {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(6, 12, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: #d8e6fb;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.hud-bar span:nth-child(5) {
  color: #63f0b7;
}

.debug-overlay {
  position: fixed;
  top: 92px;
  right: 18px;
  z-index: 40;
  width: 220px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(6, 12, 26, 0.88);
  border: 1px solid rgba(103, 184, 255, 0.35);
  backdrop-filter: blur(14px);
  font-family: "JetBrains Mono", monospace;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.debug-overlay.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.debug-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 11.5px;
}

.debug-row span {
  color: #7c93b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.debug-row strong {
  color: #7ec4ff;
}

.debug-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  color: #5f7396;
  text-align: center;
}

.loading {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes pulseRing {
  0% {
    transform: translate(-50%, -50%) scale(0.86);
    opacity: 0.65;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.25);
    opacity: 0.07;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.35);
    opacity: 0;
  }
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.82);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
  }
}

@media (max-width: 920px) {
  .container {
    gap: 12px;
    padding: 12px 12px 6px 12px;
  }

  .sidebar {
    width: 300px;
    padding: 16px;
  }
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .topbar {
    padding: 0 14px;
    gap: 10px;
    flex-wrap: wrap;
    height: auto;
    min-height: 78px;
  }

  .container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    max-height: none;
    border-radius: 18px;
  }

  .map-shell {
    min-height: 450px;
  }

  .hud-bar {
    position: static;
    margin: 0 14px 14px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .logo {
    font-size: 20px;
  }

  .camera-mode-switcher {
    bottom: auto;
    top: 14px;
    left: 50%;
  }

  .debug-overlay {
    top: auto;
    bottom: 90px;
    right: 12px;
    width: 190px;
  }
}