/* heatmap.css — Styles für das generische Heatmap-/Treemap-Control (heatmap.js).
 * Konsumenten: reports\CongressOverview, reports\MarketHeatmap. Farb-Swatches der
 * Legende kommen per --swatch-Custom-Property vom Server (datenagnostisch). */

.heatmap-canvas {
  width: 100%;
  height: 420px;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 6px;
}

.heatmap-tooltip {
  position: absolute;
  pointer-events: none;
  display: none;
  z-index: 100;
  max-width: 240px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 0.8em;
}

.heatmap-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.heatmap-legend__item::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--swatch, rgba(100, 116, 139, 0.55));
}

/* Zwei-Panel-Anordnung (z. B. Gewinner | Verlierer) — auf schmalen Viewports gestapelt. */
.heatmap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Bucket-gestapeltes Layout (reports\MarketHeatmap): je Segment-Bucket eine
 *    Zeile mit Gewinner|Verlierer-Paar. Kacheln gleich gross → Kürzel lesbar. */
.heatmap-bucket {
  margin: 0 0 18px;
}

.heatmap-bucket__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
}

.heatmap-bucket__name {
  font-weight: 700;
  font-size: 1.02em;
}

.heatmap-bucket__sub {
  font-size: 0.78em;
  color: var(--text-muted, #64748b);
}

.heatmap-pair-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 4px;
  font-size: 0.78em;
  font-weight: 700;
}

/* Gewinner/Verlierer-Label in der Tile-Palette (Heatmap::COLOR_POSITIVE/NEGATIVE = Emerald/Rose) —
 * semantisch theme-unabhängig grün/rot, lesbar auf hellem wie dunklem Card-Hintergrund. */
.heatmap-pair-head .l { color: #10b981; }
.heatmap-pair-head .r { color: #f43f5e; }

/* Bucket-Maps füllen die Höhe aus — bewusst gross, damit die proportionalen Kacheln Luft haben.
 * Verkleinert wird erst, wenn das Paar gestapelt ist (< 768px) UND der Schirm wirklich schmal wird (< 480px). */
.heatmap-canvas--bucket {
  height: 440px;
}

.heatmap-disclaimer {
  font-size: 0.78em;
  color: var(--text-muted, #64748b);
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

@media (max-width: 768px) {
  .heatmap-grid,
  .heatmap-pair-head {
    grid-template-columns: 1fr;
  }
}

/* Erst wenn das Paar längst gestapelt ist UND der Schirm wirklich schmal wird (Phone), Höhe reduzieren. */
@media (max-width: 480px) {
  .heatmap-canvas {
    height: 300px;
  }
  .heatmap-canvas--bucket {
    height: 320px;
  }
}
