/*
 * v2 event-detail view (B8).
 *
 * Style hooks for the new EventDetailView + EigenvalueHeatmap
 * components. Stays out of the panel-box / panel-title selectors
 * so the existing v1 panels are unaffected.
 */

.hidden-v1 {
  display: none !important;
}

/* Event-detail panel is always visible — when no event is selected
 * the EventDetailView renders an empty placeholder + reserves the
 * heatmap / spectrum slots so the layout doesn't collapse. The
 * grid-column span gives the heatmap room next to the P2P pane
 * (parent #detail-panels is grid-template-columns: repeat(4, 1fr);
 * the v2 layout uses 2 of those slots for the event detail and
 * 1 for P2P status). */
/* v2 maps-row hosts the celestial / world / candidate triple.
 * Candidates panel sits to the right of the celestial map; the
 * legacy 2-column grid in layout.css gets overridden here. */
#maps-row {
  grid-template-columns: 1fr 1fr 1fr;
}

#candidate-panel.globe-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: rgba(10, 22, 40, 0.3);
  border: 1px solid rgba(111, 227, 163, 0.15);
  border-radius: 6px;
  overflow: hidden;
}
#candidate-panel .panel-header {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #6fe3a3;
  border-bottom: 1px solid rgba(111, 227, 163, 0.1);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
#candidate-panel .panel-header .candidate-count {
  color: #7f8b99;
  font-size: 10px;
}
#candidate-panel .candidate-registry-container {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* v2 detail-panel = 3 columns × 1 row: LIVE HEATMAP, LIVE
 * SPECTRUM, EVENT DETAIL. Layer 3 P2P moved to #bottom-row. */
#detail-panels {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
}

#live-eigenfunction-panel,
#live-spectrum-panel,
#live-eigen-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#live-eigenfunction-panel .live-eigenfunction-container,
#live-spectrum-panel .live-spectrum-container,
#live-eigen-panel .live-eigen-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* #bottom-row P2P pane (moved from #detail-panels). */
#bottom-p2p-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(10, 22, 40, 0.3);
  border: 1px solid rgba(111, 227, 163, 0.15);
  border-radius: 6px;
  overflow: hidden;
}
#bottom-p2p-panel .panel-title {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #6fe3a3;
  border-bottom: 1px solid rgba(111, 227, 163, 0.1);
}
#bottom-p2p-panel .p2p-status-container {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.event-detail-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: monospace;
  font-size: 12px;
  color: #d8e7d9;
  /* Stretch into the parent panel-box so .ev-plots gets a real
   * height to render the heatmap / spectrum into. */
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 6px 8px;
}

/* Empty state: hint shown when no candidate selected. */
.ev-empty {
  color: #6fe3a3;
  opacity: 0.55;
  font-style: italic;
  padding: 12px 4px;
  text-align: center;
}

/* When the view has data, hide the hint and show the meta + debug
 * blocks. When idle, do the opposite — the hint occupies the panel
 * by itself. */
.event-detail-view:not(.event-detail-view--ready) .ev-header,
.event-detail-view:not(.event-detail-view--ready) .ev-meta,
.event-detail-view:not(.event-detail-view--ready) .ev-debug {
  display: none;
}
.event-detail-view--ready .ev-empty {
  display: none;
}

.ev-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1a261a;
}

.ev-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  background: #1a261a;
  color: #8fa193;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.ev-badge--suspicious {
  background: #25341d;
  color: #d8e7d9;
}

.ev-badge--eti {
  background: #6b5a1c;
  color: #ffe069;
}

.ev-badge--rfi {
  background: #2d1515;
  color: #b33030;
}

.ev-candidate-link {
  background: none;
  border: 1px solid #1a261a;
  color: #6fe3a3;
  font-family: inherit;
  font-size: inherit;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.ev-candidate-link:hover {
  background: #1a261a;
}

.ev-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ev-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.ev-label {
  color: #7f8b99;
}

.ev-value {
  color: #d8e7d9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-plots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  /* Take all the remaining vertical space inside the panel-box
   * so the heatmap + spectrum canvases have a real size to draw
   * into. Without flex:1 the parent flex layout collapses this
   * block to its content height (which is 0 before the canvas
   * paints once) and the heatmap appears as a 0×0 sliver. */
  flex: 1;
  min-height: 0;
}

.ev-plot-block {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ev-plot-title {
  font-size: 10px;
  color: #7f8b99;
  padding-bottom: 4px;
  letter-spacing: 0.08em;
}

.ev-heatmap,
.ev-spectrum {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0a0a10;
  border-radius: 3px;
}

.ev-debug {
  padding-top: 4px;
  border-top: 1px solid #1a261a;
}

.ev-debug-toggle {
  background: none;
  border: none;
  color: #6fe3a3;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 2px 0;
}

.ev-debug-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  font-size: 11px;
}

.ev-debug-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.ev-debug-label {
  color: #7f8b99;
}

.ev-debug-value {
  color: #d8e7d9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
