/* ────────────────────────────────────────────────────────────────
   NTHMAP — Globe view (Canvas 2D, no WebGL)
   The canvas sits in the same grid area as the Leaflet map and is
   shown/hidden via the body.view-globe class.
   ──────────────────────────────────────────────────────────────── */

#globe-stage {
  grid-area: map;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#globe-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
  background: radial-gradient(ellipse at center, #080e16 0%, #020508 100%);
  display: block;
}

/* Body class is the single source of truth — show one, hide the other. */
body:not(.view-globe) #globe-stage { display: none !important; }
body.view-globe #map { display: none !important; }

/* Satellite toggle is only meaningful in globe mode */
body:not(.view-globe) #sat-toggle { display: none !important; }
#sat-toggle.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

/* Price overlay — top-left of the globe stage */
#globe-price-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  min-width: 240px;
  max-width: 280px;
  background: rgba(15, 22, 30, 0.86);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  pointer-events: none;
}
#globe-price-overlay:empty { display: none; }
.globe-price-head {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.globe-price-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.globe-price-name {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.globe-price-val {
  color: var(--text-primary);
  font-weight: 600;
}
.globe-price-chg {
  font-size: 10px;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}
.globe-price-chg.up   { color: var(--accent-green); }
.globe-price-chg.down { color: var(--accent-danger); }
.globe-price-chg.flat { color: var(--text-muted); }

/* Zoom controls — bottom-right of the globe */
#globe-zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}
#globe-zoom-controls button {
  width: 36px;
  height: 36px;
  background: rgba(15, 22, 30, 0.85);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 120ms ease;
}
#globe-zoom-controls button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
#globe-zoom-controls button:active {
  transform: translateY(1px);
}

/* Topbar toggle button */
#view-toggle {
  font-size: 16px;
  line-height: 1;
}
body.view-globe #view-toggle::after { content: ""; }

/* Hide some map-only chrome when in globe mode */
body.view-globe .leaflet-control-container,
body.view-globe #right-panel,
body.view-globe .playback-bar {
  /* keep right-panel + playback usable but hide map-only controls */
}
body.view-globe .leaflet-control-container { display: none; }
