/* css/globe.css — GLOBE ("Spatial") takeover. Fullscreen Cesium + minimal HUD:
   exactly two sections (SATELITY bottom-left, SAMOLOTY bottom-right) that auto-show
   only when the whole Earth is in view and smooth-hide when zoomed in. B&W chrome. */

#globe-layer {
  position: fixed; inset: 0; z-index: 60; background: #000;
  font-family: var(--font-mono); color: var(--fg);
}
#globe-canvas { position: absolute; inset: 0; }
#globe-canvas .cesium-viewer,
#globe-canvas .cesium-widget,
#globe-canvas .cesium-widget canvas { width: 100%; height: 100%; }

/* Hide the rest of the app while the globe owns the screen — EXCEPT the chat
   bubble (Jurek can keep chatting on the globe). */
body[data-globe="on"] #widget-layer,
body[data-globe="on"] #avatar-canvas,
body[data-globe="on"] #islands,
body[data-globe="on"] #theme-scene,
body[data-globe="on"] #grid-bg { display: none !important; }

/* Chat bubble sits above the globe when active. */
#chat-bubble.over-globe { z-index: 70; }

/* ---- HUD sections: auto show/hide with the camera --------------------------
   Hidden by default; #globe-layer.gl-far (whole Earth in view) reveals them. */
.gl-hud {
  position: absolute; z-index: 3; bottom: 16px;
  min-width: 190px; max-width: 40vw;
  padding: 12px 14px; border-radius: var(--glass-radius-sm);
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  color: #eee; font-size: 12px;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.4s var(--ease-out, ease), transform 0.4s var(--ease-out, ease);
}
#globe-layer.gl-far .gl-hud { opacity: 1; transform: none; pointer-events: auto; }
#globe-sats { left: 16px; }
#globe-planes { right: 16px; }

.gl-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11px; letter-spacing: var(--tracking-wide); color: #cfcfcf;
}
.gl-switch {
  appearance: none; cursor: pointer; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--tracking-wide); padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35); background: transparent; color: #fff;
}
.gl-switch.on { background: #fff; color: #000; border-color: #fff; }

.gl-filters, .gl-pl-body { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.gl-flt { display: flex; align-items: center; gap: 8px; cursor: pointer; color: #ddd; font-size: 12px; }
.gl-flt input { accent-color: #fff; width: 13px; height: 13px; cursor: pointer; }
.gl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.gl-approx { color: #888; font-size: 10px; }
.gl-count { margin-top: 6px; font-size: 12px; color: #9fd3ff; letter-spacing: var(--tracking); }

/* Satellite detail panel (right, above the planes section) */
#globe-panel {
  position: absolute; top: 16px; right: 16px; z-index: 4;
  width: min(340px, 86vw); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 16px; border-radius: var(--glass-radius);
  background: rgba(10, 12, 16, 0.72); border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: #f2f2f2;
}
.gl-panel-close {
  position: absolute; top: 10px; right: 10px; appearance: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
  background: transparent; color: #fff; font-size: 14px; line-height: 1;
}
.gl-panel-close:hover { background: rgba(255,255,255,0.9); color: #000; }
.gl-panel-name { font-size: 18px; font-weight: 600; padding-right: 28px; }
.gl-panel-cat { font-size: 11px; color: #9aa0a6; letter-spacing: var(--tracking); margin: 2px 0 10px; text-transform: uppercase; }
.gl-panel-model {
  width: 100%; height: 200px; border-radius: var(--glass-radius-sm);
  background: radial-gradient(circle at 50% 40%, #10151f, #05070b);
  border: 1px solid rgba(255,255,255,0.12); overflow: hidden; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #888;
}
.gl-panel-model canvas { display: block; touch-action: none; }
.gl-panel-desc { font-size: 13px; line-height: 1.55; color: #d8d8d8; margin-bottom: 12px; }
.gl-panel-data { font-size: 12px; color: #cfcfcf; display: flex; flex-direction: column; gap: 3px; }
.gl-panel-data b { color: #8fb8ff; font-weight: 600; }

/* Live video (ISS) */
#globe-video {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 5;
  width: min(420px, 80vw); border-radius: var(--glass-radius-sm); overflow: hidden;
  background: #000; border: 1px solid rgba(255,255,255,0.25);
}
#globe-video iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.gl-video-title { font-size: 10px; letter-spacing: var(--tracking-wide); color: #ccc; padding: 6px 10px; background: rgba(0,0,0,0.6); }
.gl-video-close { position: absolute; top: 6px; right: 6px; z-index: 2; appearance: none; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.6); color: #fff; }

@media (max-width: 640px) {
  .gl-hud { max-width: 46vw; font-size: 11px; }
  #globe-panel { top: auto; bottom: 96px; right: 12px; left: 12px; width: auto; max-height: 50vh; }
}
