/* ---------------------------------------------------------------------------
 * OSiris map floating panel — ONE shared style for every on-map panel
 * (aircraft details, data probe, …). Glass dark-first, html.light variant.
 * Shared platform stylesheet: linked directly by pages; the air-traffic
 * vendor bundle no longer ships these classes.
 * ------------------------------------------------------------------------- */
.osiris-map-panel {
  position: fixed;
  width: 19.5rem;
  max-width: calc(100vw - 32px);
  z-index: 45;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(13, 20, 28, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
html.light .osiris-map-panel {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.osiris-map-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.65rem 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
  user-select: none;
}
.osiris-map-panel-header:active {
  cursor: grabbing;
}
html.light .osiris-map-panel-header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.osiris-map-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1392ec;
}
.osiris-map-panel-kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1392ec;
  box-shadow: 0 0 8px rgba(19, 146, 236, 0.9);
}

.osiris-map-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.osiris-map-panel-close:hover {
  border-color: rgba(19, 146, 236, 0.6);
  color: #fff;
  background: rgba(19, 146, 236, 0.15);
}
html.light .osiris-map-panel-close {
  border-color: rgba(15, 23, 42, 0.15);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.7);
}
html.light .osiris-map-panel-close:hover {
  color: #0f172a;
}

.osiris-map-panel-body {
  padding: 0.85rem 0.9rem 0.9rem;
}

.osiris-map-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.osiris-map-panel-subtitle {
  margin: 0.15rem 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}
html.light .osiris-map-panel-subtitle {
  color: rgba(15, 23, 42, 0.55);
}

.osiris-map-panel-grid {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.42rem;
}

.osiris-map-panel-row {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.28rem 0 0.28rem 0.55rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}
html.light .osiris-map-panel-row {
  border-left-color: rgba(15, 23, 42, 0.12);
}

.osiris-map-panel-row dt {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
html.light .osiris-map-panel-row dt {
  color: rgba(15, 23, 42, 0.5);
}

.osiris-map-panel-row dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.osiris-map-panel-row dd .unit,
.osiris-map-panel-row dd small {
  font-size: 0.66rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}
html.light .osiris-map-panel-row dd .unit,
html.light .osiris-map-panel-row dd small {
  color: rgba(15, 23, 42, 0.5);
}

/* Highlighted metric (e.g. altitude, temperature) */
.osiris-map-panel-row--hero {
  border-left-color: #1392ec;
  background: linear-gradient(90deg, rgba(19, 146, 236, 0.14), transparent 80%);
  border-radius: 0 6px 6px 0;
}
.osiris-map-panel-row--hero dd {
  color: #4db6f7;
  font-size: 0.86rem;
}
html.light .osiris-map-panel-row--hero dd {
  color: #0b6fb8;
}

.osiris-map-panel-note {
  margin-top: 0.75rem;
  padding: 0.35rem 0.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}
html.light .osiris-map-panel-note {
  border-color: rgba(15, 23, 42, 0.2);
  color: rgba(15, 23, 42, 0.5);
}

.osiris-map-panel-loading {
  display: inline-block;
  width: 0.85em;
  animation: osiris-panel-ellipsis 1.2s steps(4) infinite;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
}
@keyframes osiris-panel-ellipsis {
  0% { width: 0; }
  100% { width: 0.85em; }
}

/* Beta badge on the map-data tile (compiled Tailwind lacks violet dark variants) */
.map-data-coverage-tag--beta {
  background: rgba(139, 92, 246, 0.16);
  color: #7c3aed;
}
html.dark .map-data-coverage-tag--beta {
  background: rgba(139, 92, 246, 0.28);
  color: #c4b5fd;
}

/* --------------------------------------------------------------------------
 * Probe pin (unified data probe) — pulsing cerulean point on the map
 * ------------------------------------------------------------------------ */
.osiris-probe-pin {
  position: relative;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.osiris-probe-pin::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(19, 146, 236, 0.45);
  animation: osiris-probe-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.osiris-probe-pin::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1392ec;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 0 10px rgba(19, 146, 236, 0.8);
}
@keyframes osiris-probe-ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
 * Discover my world panel — desktop floating right column
 * (mobile bottom-sheet overrides live in mobile-bottom-sheet.css)
 * ------------------------------------------------------------------------ */
.bottom-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(16px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.bottom-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@media (min-width: 768px) {
  #bottom-panel {
    position: fixed;
    top: calc(var(--platform-topbar-height, 3rem) + 0.75rem);
    right: 1rem;
    bottom: 0.75rem;
    left: auto;
    width: min(400px, calc(100vw - 6rem));
    max-height: none;
    pointer-events: auto;
    z-index: 30;
  }

  /* Shift the map control buttons left while the panel is open */
  #map-controls-right {
    transition: transform 0.25s ease;
  }
  body.discover-panel-open #map-controls-right {
    transform: translate(calc(-1 * min(400px, calc(100vw - 6rem)) - 0.75rem), -50%);
  }
}

/* --------------------------------------------------------------------------
 * Probe temperature chart (D3 multi-model comparison in the data probe)
 * ------------------------------------------------------------------------ */
.osiris-probe-chart-section {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html.light .osiris-probe-chart-section {
  border-top-color: rgba(15, 23, 42, 0.08);
}

.osiris-probe-chart-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
html.light .osiris-probe-chart-head {
  color: rgba(15, 23, 42, 0.5);
}

.osiris-probe-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.osiris-probe-chart-legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}
.osiris-probe-chart-legend-btn.is-off {
  opacity: 0.38;
}
html.light .osiris-probe-chart-legend-btn {
  border-color: rgba(15, 23, 42, 0.15);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.7);
}

.osiris-probe-chart-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.osiris-probe-chart {
  position: relative;
  width: 100%;
  margin-top: 0.35rem;
  min-height: 132px;
  /* Transparent background — the chart inherits the panel glass. */
}
.osiris-probe-chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.osiris-probe-chart-note {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
}
html.light .osiris-probe-chart-note {
  color: rgba(15, 23, 42, 0.5);
}

.osiris-probe-chart-axis text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  fill: rgba(255, 255, 255, 0.45);
}
html.light .osiris-probe-chart-axis text {
  fill: rgba(15, 23, 42, 0.5);
}

.osiris-probe-chart-cursor {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  pointer-events: none;
}
html.light .osiris-probe-chart-cursor {
  stroke: rgba(15, 23, 42, 0.35);
}

.osiris-probe-chart-dot {
  stroke: rgba(13, 20, 28, 0.9);
  stroke-width: 1.5;
  pointer-events: none;
}
html.light .osiris-probe-chart-dot {
  stroke: rgba(255, 255, 255, 0.95);
}

.osiris-probe-chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 7.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(13, 20, 28, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
}
html.light .osiris-probe-chart-tooltip {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.osiris-probe-chart-tooltip-time {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.3rem;
}
html.light .osiris-probe-chart-tooltip-time {
  color: rgba(15, 23, 42, 0.5);
}

.osiris-probe-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}
html.light .osiris-probe-chart-tooltip-row {
  color: rgba(15, 23, 42, 0.7);
}
.osiris-probe-chart-tooltip-row b {
  margin-left: auto;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
html.light .osiris-probe-chart-tooltip-row b {
  color: #0f172a;
}

/* --------------------------------------------------------------------------
 * Mobile: every .osiris-map-panel becomes a bottom sheet (inline drag
 * positions are overridden; panels keep their close buttons).
 * ------------------------------------------------------------------------ */
@media (max-width: 767px) {
  .osiris-map-panel {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    z-index: 45;
  }
  .osiris-map-panel-header {
    cursor: default;
  }
  /* Bigger touch target on mobile (shared close button, incl. user/rec/widget panels) */
  .osiris-map-panel-close {
    width: 2.25rem;
    height: 2.25rem;
  }
}
