/* =========================================================
   Grundlayout wie Dashboard-Kachel
========================================================= */

.chart-kachel {
  background: var(--sppb-wetterkachel);
  color: #ffffff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
}

/* =========================================================
   Header
========================================================= */

.chart-header {
  font-size: 28px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 18px;
  margin-top: 6px;
}

/* =========================================================
   Steuerleiste
========================================================= */

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 15px;
}

/* Inputs & Button */

.chart-controls select,
.chart-controls input[type="date"],
.chart-controls button {
  background: transparent;
  color: #000000;
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;

  /* ⭐ entscheidend für korrektes Verhalten */
  flex: 1 1 220px;
  max-width: 100%;
}

/* Button */

.chart-controls button {
  cursor: pointer;
  opacity: 0.75;
}

.chart-controls button:hover {
  opacity: 1;
}

.chart-controls button.primary {
  border-color: #ffffff;
  font-weight: 600;
  opacity: 1;
}

/* =========================================================
   Statistik-Karten
========================================================= */

.weather-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 5px;
  margin-top: 30px;
  margin-bottom: 15px;
}

@media (max-width: 1023px) {
  .weather-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .weather-stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--sppb-farbe-5);
  color: var(--sppb-text);
  padding: 20px;
}

.stat-card h3 {
  font-size: 28px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 18px;
  margin-top: 6px;
}

.stat-card .header {
  font-size: 28px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 18px;
  margin-top: 6px;
}

/* einzelne Zeile */

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}

.stat-row span {
  opacity: 1;
}

.stat-row strong {
  font-size: 18px;
  font-weight: 400;
}

/* =========================================================
   Diagramm
========================================================= */

.chart-container {
  position: relative;
  height: 420px;
  padding-top: 10px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* =========================================================
   Kleine Helfer
========================================================= */

.hidden {
  display: none;
}

.stat-row.placeholder {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   Tooltip
========================================================= */

.has-tooltip {
  position: relative;
  cursor: help;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;

  white-space: nowrap;
  font-size: 0.75em;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.has-tooltip:hover::after {
  opacity: 1;
}

