/* =========================================================
   KALENDER UND SCHULE – das Aussehen
   ========================================================= */

.abschnitt-titel { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }

/* ---------- Umschalter (Kalender/Schule und Monat/Woche/Tag) ---------- */
.segment {
  display: flex;
  background: var(--flaeche);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.segment button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-leise);
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.segment button.aktiv {
  background: #26272c;
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(244, 245, 247, 0.12);   /* feiner silberner Glanz oben */
}
.segment.gross { margin: 14px 0 18px; }
.segment.gross button { padding: 10px; font-size: 1rem; }

.ansicht-zeile { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.ansicht-zeile .segment { flex: 1; }

/* ---------- Kopf mit ‹ Zeitraum › ---------- */
.monat-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.monat-kopf button {
  background: var(--flaeche);
  border: none;
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
}
.monat-name { font-size: 1.1rem; font-weight: 700; text-align: center; }

/* ---------- Monatsansicht ---------- */
.monat {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 22px;
}
.wt { text-align: center; font-size: 0.75rem; color: var(--text-leise); padding: 4px 0; }

.tag-knopf {
  aspect-ratio: 1;
  background: var(--flaeche);
  border: none;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;          /* damit die Punkte unten frei platziert werden können */
  cursor: pointer;
}
/* Die Zahl sitzt in einem unsichtbaren Kreis, genau in der Mitte */
.tag-knopf .zahl {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;   /* alle Ziffern gleich breit */
  line-height: 1;
}
.tag-knopf.we { color: var(--text-leise); }
/* Heute: weiße Zahl im blau-roten Kreis (passend zum Streifen) */
.tag-knopf.heute .zahl { background: var(--rot-kreis); color: white; font-weight: 700; box-shadow: 0 0 10px rgba(255, 31, 61, 0.5); }
/* Der angetippte Tag: etwas heller hinterlegt */
.tag-knopf.gewaehlt { background: #2a2a35; }

/* Schulfreie Tage (Ferien, Feiertage): feine silberne Linie oben im Feld */
.tag-knopf.ferien { background: linear-gradient(#1b1c20, #1b1c20) padding-box; box-shadow: inset 0 2px 0 rgba(201, 204, 210, 0.55); }
.tag-knopf.ferien.gewaehlt { background: #26272c; }
.ferien-hinweis {
  background: var(--flaeche);
  border-left: 3px solid var(--silber);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--silber);
}
.wg-chip.ferien { background: #3a3c42; color: var(--silber); cursor: default; }

/* Die Punkte liegen unten im Feld und schieben die Zahl nicht mehr nach oben */
.tag-knopf .punkte { position: absolute; bottom: 5px; left: 0; right: 0; justify-content: center; }
.punkte { display: flex; gap: 3px; height: 6px; }
.punkt { width: 6px; height: 6px; border-radius: 50%; }

@media (min-width: 700px) {
  .tag-knopf { aspect-ratio: auto; height: 64px; }
}

/* ---------- Wochenansicht ---------- */
/* Die Tage nebeneinander: links eine schmale Spalte für die Uhrzeiten, dann 7 Tage */
.wg { --px-pro-stunde: 44px; }
.wg-zeile {
  display: grid;
  /* minmax(0, 1fr): lange Titel dürfen die Tage nicht breiter machen (sie werden mit "…" gekürzt) */
  grid-template-columns: 34px repeat(7, minmax(0, 1fr));
  gap: 3px;
}

/* Kopf: Wochentag + Zahl */
.wg-kopf { margin-bottom: 3px; }
.wg-ganztags-zelle { cursor: pointer; }
.wg-tag {
  background: var(--flaeche);
  border-radius: 10px 10px 0 0;
  text-align: center;
  padding: 6px 0 4px;
  cursor: pointer;
}
.wg-wt { font-size: 0.62rem; color: var(--text-leise); letter-spacing: 0.03em; }
.wg-zahl {
  width: 28px;
  height: 28px;
  margin: 3px auto 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wg-tag.sonntag .wg-wt,
.wg-tag.sonntag .wg-zahl { color: #ff6b7d; }
.wg-tag.heute { box-shadow: inset 0 0 0 1px #3a3a46; }
.wg-tag.heute .wg-zahl { background: var(--rot-kreis); color: white; font-weight: 700; box-shadow: 0 0 10px rgba(255, 31, 61, 0.5); }

/* Ganztägige Einträge unter dem Datum */
.wg-ganztags { margin-bottom: 6px; }
.wg-ganztags-zelle {
  background: var(--flaeche);
  border-radius: 0 0 10px 10px;
  min-height: 26px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wg-chip {
  font-size: 0.62rem;
  color: white;
  border-radius: 4px;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* Das Zeitraster: Höhe = Anzahl Stunden × Pixel pro Stunde */
.wg-raster { height: calc(var(--stunden) * var(--px-pro-stunde)); }
.wg-uhrzeiten { position: relative; }
.wg-uhrzeiten span {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: var(--text-leise);
  font-variant-numeric: tabular-nums;
}
.wg-uhrzeiten .jetzt-zeit { color: var(--akzent-2); font-weight: 700; font-size: 0.6rem; background: var(--hintergrund); }

.wg-spalte {
  position: relative;
  /* feine Linie zu jeder vollen Stunde */
  background-image: linear-gradient(to bottom, var(--linie) 1px, transparent 1px);
  background-size: 100% var(--px-pro-stunde);
  cursor: pointer;
}
.wg-spalte.heute { background-color: rgba(255, 255, 255, 0.025); }

/* Deine Einträge als farbige Blöcke */
.wg-block {
  position: absolute;
  z-index: 1;
  background: color-mix(in srgb, var(--farbe) 75%, black);
  border-left: 3px solid var(--farbe);
  border-radius: 4px;
  padding: 2px 4px;
  overflow: hidden;
  color: white;
  font-size: 0.62rem;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--hintergrund);
}
.wg-block-zeit,
.wg-block-titel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* zu lang? dann "…" */
.wg-block-zeit { opacity: 0.8; font-variant-numeric: tabular-nums; }
.wg-block-titel { font-weight: 600; }

/* Die rote Jetzt-Linie */
.jetzt-linie {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--akzent-2);
  z-index: 2;
  pointer-events: none;
}
.jetzt-linie::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--akzent-2);
}

/* Der schwebende Knopf unten */
.schwebe-knopf {
  position: sticky;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px auto 0;
  min-width: 240px;
  background: #2a2a35;
  color: var(--text);
  border: 1px solid #3a3a46;
  border-radius: 99px;
  padding: 12px 20px;
  font: inherit;
  font-size: 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.schwebe-knopf span { font-size: 1.3rem; line-height: 1; }

/* Auf dem Tablet ist mehr Platz */
@media (min-width: 700px) {
  .wg { --px-pro-stunde: 56px; }
  .wg-zeile { grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 5px; }
  .wg-wt { font-size: 0.75rem; }
  .wg-zahl { width: 32px; height: 32px; font-size: 1.05rem; }
  .wg-chip, .wg-block { font-size: 0.75rem; }
}

/* ---------- Tagesansicht ---------- */
.tag-zeile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 4px;
}
.tag-zeile .uhr {
  width: 46px;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-leise);
  font-variant-numeric: tabular-nums;
}
.tag-zeile .eintrag { flex: 1; margin-bottom: 0; }
/* Schulstunden aus dem Stundenplan: leise im Hintergrund */
.schulstunde {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-leise);
  border-left: 3px solid;
  padding: 4px 10px;
  opacity: 0.75;
}
/* Ein/Aus-Schalter */
.schalter-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--flaeche);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  cursor: pointer;
}
.schalter-zeile input { display: none; }
.schalter {
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: #3a3a46;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.schalter::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.schalter-zeile input:checked + .schalter { background: var(--rot); box-shadow: 0 0 10px rgba(255, 31, 61, 0.45); }
.schalter-zeile input:checked + .schalter::after { transform: translateX(18px); }

.ganztags-titel { font-size: 0.8rem; color: var(--text-leise); margin: 4px 0 6px; }

/* ---------- Kopf über Listen mit + Knopf ---------- */
.tag-details-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tag-details-kopf .abschnitt-titel { margin: 0; }

/* Knöpfe in Davids Design: dunkel mit glänzendem Goldrand und goldener Schrift */
.plus-knopf {
  background: linear-gradient(#1d1e22, #1d1e22) padding-box, var(--gold-verlauf) border-box;
  color: #f0d68a;
  border: 1.5px solid transparent;
  border-radius: 99px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.plus-knopf.klein { padding: 5px 12px; font-size: 0.85rem; }

/* ---------- Ein einzelner Eintrag ---------- */
.eintrag {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--flaeche);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 6px;
  cursor: pointer;
}
.eintrag .streifen { width: 6px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
.eintrag .text { flex: 1; min-width: 0; }
.eintrag .titel { font-weight: 600; }
.eintrag .info { font-size: 0.8rem; color: var(--text-leise); margin-top: 2px; }
.loeschen {
  background: none;
  border: none;
  color: var(--text-leise);
  font-size: 1.05rem;
  padding: 6px 8px;
  cursor: pointer;
}
.nichts { color: var(--text-leise); padding: 6px 0 14px; }

/* ---------- Schul-Bereich ---------- */
.countdowns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}
.countdown {
  background: var(--flaeche);
  border-radius: 16px;
  padding: 14px;
  border-left: 5px solid var(--farbe);
  cursor: pointer;
}
.countdown .klein { font-size: 0.78rem; color: var(--text-leise); }
.countdown .zahl { font-size: 2.3rem; font-weight: 800; line-height: 1.05; color: var(--akzent-1); }
.countdown.bald-faellig .zahl { color: #ffb020; }     /* höchstens 7 Tage: orange */
.countdown.dringend .zahl { color: var(--akzent-2); }  /* höchstens 3 Tage: rot    */
.countdown .was { font-weight: 600; margin-top: 10px; }

.leer-hinweis {
  background: var(--flaeche);
  border-radius: 16px;
  padding: 16px;
  color: var(--text-leise);
  line-height: 1.5;
  margin-bottom: 26px;
}
.schul-gruppe { margin-bottom: 22px; }

/* ---------- Das Fenster zum Eintragen ---------- */
#eintrag-dialog {
  margin: auto;
  border: none;
  border-radius: 20px;
  background: var(--flaeche);
  color: var(--text);
  width: min(94vw, 440px);
  max-height: 92vh;
  padding: 20px;
}
#eintrag-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }

/* Auswahl der Art als runde "Chips" */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chips label {
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--hintergrund);
  border: 1px solid var(--linie);
  color: var(--text-leise);
  font-size: 0.88rem;
  cursor: pointer;
}
.chips input { display: none; }
.chips label:has(input:checked) { background: #2a2a35; border-color: var(--text-leise); color: var(--text); font-weight: 600; }

/* Art des Eintrags (Termin, Klausur …): ohne Emojis, dafür kräftige Schrift,
   die gewählte Art mit glänzendem Goldrand */
#art-wahl label { color: var(--text); font-weight: 600; font-size: 0.95rem; padding: 8px 14px; }
#art-wahl label:has(input:checked) {
  background: linear-gradient(#1d1e22, #1d1e22) padding-box, var(--gold-verlauf) border-box;
  border: 1.5px solid transparent;
  color: #f0d68a;
  font-weight: 700;
}

.feld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--text-leise);
}
.feld input, .feld select {
  background: var(--hintergrund);
  border: 1px solid var(--linie);
  color: var(--text);
  border-radius: 10px;
  padding: 11px;
  font: inherit;
  font-size: 1rem;
  color-scheme: dark;
  width: 100%;
}
.feld-reihe { display: flex; gap: 10px; }
.feld-reihe .feld { flex: 1; min-width: 0; }

/* Die 15 Farben + "Automatisch" */
.farben { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.farben label {
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: white;
}
.farben input { display: none; }
.farben label:has(input:checked) { box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 4px white; }
.farben .auto { background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); font-weight: 700; }

.knopf-reihe { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.knopf-reihe .platz { flex: 1; }
.knopf-leise {
  background: none;
  border: 1px solid var(--linie);
  color: var(--text);
  border-radius: 99px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}
.knopf-leise.klein { padding: 7px 12px; font-size: 0.85rem; }
.knopf-leise.rot { color: var(--akzent-2); border-color: rgba(255, 31, 61, 0.4); }
