/* === Grundlayout: Body und Tabellenstruktur === */
body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  text-align: center;
  margin: 0;
  padding: 0;
}

table {
  border-collapse: collapse;
  margin: 20px auto;
}

/* === Tabellenkopf-Zellen (Stundenzeile & Legendenüberschrift) === */
th {
  border: 1px solid #ccc;
  background: white;
  color: black;
  font-weight: bold;
  padding: 4px;
}

/* === Standard-Zellen für Temperaturwerte === */
td {
  width: 30px;
  height: 30px;
  text-align: center;
  font-size: 12px;
  color: #000;
  border: none;
  padding: 0;
}

/* === Tageszellen: Erste Spalte mit Datum / Wochentag === */
td.day-label {
  border: 1px solid #ccc;
  background: white;
  color: black;
  font-size: 16px;
  font-weight: bold;
  position: sticky;
  left: 0;
  z-index: 2;
}

/* === Leere und Durchschnittszellen === */
td.empty-cell {
  border: 1px dashed #ddd;
  background: #fff;
}

td.avg-cell {
  border-left: 2px solid #666;
}

/* === Hover-Effekt für Interaktion / Touch-Feedback === */
td:hover,
td:focus,
td.touched {
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15);
  outline: none;
}

/* === Legende: Farbskala für Temperaturbereiche === */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 0;
  max-width: 1920px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
}

.color-box {
  width: 30px;
  height: 20px;
  border: 1px solid #999;
}

/* === Archiv-Selector Wrapper === */
#archive-selector-wrapper {
  margin: 20px auto;
  text-align: center;
  font-family: 'Helvetica Neue', sans-serif;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* === Label: Monatsarchiv === */
#archive-selector-wrapper label {
  font-weight: normal; /* ❌ nicht fett */
  font-size: 15px;
  color: #333;
}

#archive-selector {
  position: relative;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: white;
  color: black;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-image:
  linear-gradient(to right, #ccc 1px, transparent 1px),
  url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 9 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 30px center, right 10px center;
  background-size: 1px 60%, 10px 6px;
  padding-right: 40px;
}

/* === Vollansicht-Button === */
.fullscreen-button {
  font-size: 14px;
  padding: 4px 14px; /* ✅ angepasst wie Temperatur-Variante */
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.fullscreen-button:hover {
  background-color: #ddd;
}

/* === Heatmap-Tabelle: Scrollbereich und Layoutfixierung === */
.heatmap-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
}

#heatmap {
  min-width: 768px;
  table-layout: fixed;
}

/* === Tabellenzellen: Mindestbreite für Layoutstabilität === */
#heatmap th,
#heatmap td {
  min-width: 32px;
  white-space: nowrap;
}

/* === Sticky Stundenzeile: Fixierung der Kopfzeile beim Scrollen === */
#heatmap thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 3;
}

/* === Responsive Anpassungen für Mobile-Ansicht === */
@media (max-width: 600px) {
  /* === Temperaturzellen auf Mobile === */
  td {
    width: 10px;
    height: 10px;
    font-size: 5px;
  }

  .day-label-text {
    display: inline-block;
    transform: scale(0.8);
    transform-origin: left center;
  }

  /* === Tageszellen auf Mobile === */
  td.day-label {
    font-size: 7px;
  }

  /* === Durchschnittszellen auf Mobile === */
  td.avg-cell {
    font-size: 5px;
  }

  /* === Tabellenkopf auf Mobile === */
  th {
    font-size: 7px;
    padding: 2px;
    min-width: 9px;
  }

  /* === Farbkästchen der Legende auf Mobile === */
  .color-box {
    width: 14px;
    height: 9px;
  }

  /* === Überschrift der Heatmap auf Mobile === */
  #heatmap-heading {
    font-size: 15px;
    padding: 0 10px;
    max-width: 100%;
  }

 /* === Vollbild-Button auf Mobile === */
.fullscreen-button {
    font-size: 12px;
    margin-top: 6px;
    align-self: center; /* ✅ zentriert */
  }

  /* === Archiv-Selector auf Mobile === */
  #archive-selector {
    font-size: 14px;
    padding: 6px 14px;
    background-image:
      linear-gradient(to right, #ccc 1px, transparent 1px),
      url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 9 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 26px center, right 8px center;
    background-size: 1px 60%, 10px 6px;
    padding-right: 36px;
  }

  /* === Legende auf Mobile === */
  .legend {
    justify-content: center;
    padding: 0;
  }

  .legend-item {
    flex: 0 0 auto;
    font-size: 6px;
    text-align: center;
  }

  /* === Heatmap-Tabelle auf Mobile === */
  #heatmap {
    min-width: auto;
    width: 100%;

  }
}
