/* =========================================================
   TODOS – das Aussehen
   (benutzt auch Teile aus kalender.css: .plus-knopf, .feld, .chips, .farben ...)
   ========================================================= */

/* ---------- Gruppen zum Umschalten (lassen sich zur Seite wischen) ---------- */
.todo-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 14px 0 12px;
  padding: 2px;
}
.todo-filter::-webkit-scrollbar { display: none; }
.todo-filter button {
  flex-shrink: 0;
  background: var(--flaeche);
  border: 1.5px solid var(--linie);
  color: var(--text-leise);
  border-radius: 99px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
/* gewählte Gruppe: glänzender Goldrand wie bei den Knöpfen */
.todo-filter button.aktiv {
  background: linear-gradient(#1d1e22, #1d1e22) padding-box, var(--gold-verlauf) border-box;
  border-color: transparent;
  color: #f0d68a;
  font-weight: 600;
}

.todo-knoepfe {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.todo-gruppen-titel { margin-top: 18px; }
.todo-gruppen-titel:first-child { margin-top: 0; }
.anzahl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-leise);
  margin-left: 4px;
}

/* ---------- Ein einzelnes ToDo (Karte + Unteraufgaben darunter) ---------- */
.todo-block {
  background: var(--flaeche);
  border-radius: 12px;
  margin-bottom: 6px;
  transition: opacity 0.35s ease 0.25s, transform 0.35s ease 0.25s;
}
.todo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}
.todo .streifen { width: 6px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
.todo .text { flex: 1; min-width: 0; }
.todo .titel { font-weight: 600; overflow-wrap: anywhere; }
.todo .info { font-size: 0.8rem; color: var(--text-leise); margin-top: 2px; }
.ueberfaellig { color: #ff6b7d; font-weight: 600; }

/* Der runde Haken zum Abhaken */
.haken {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--silber);
  background: none;
  cursor: pointer;
  position: relative;
}
.haken.klein { width: 20px; height: 20px; border-width: 1.5px; }
.todo.erledigt .haken,
.wird-erledigt .todo .haken,
.unter.fertig .haken,
.unter-zeile.fertig .haken {
  border-color: transparent;
  background: var(--rot-kreis);
  box-shadow: 0 0 10px rgba(255, 31, 61, 0.5);
}
.todo.erledigt .haken::after,
.wird-erledigt .todo .haken::after,
.unter.fertig .haken::after,
.unter-zeile.fertig .haken::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
}

/* Abgehakt: durchgestrichen und leiser */
.haken.klein::after { font-size: 0.7rem; }
.todo.erledigt .titel,
.wird-erledigt .todo .titel { text-decoration: line-through; color: var(--text-leise); }
.todo.erledigt { opacity: 0.55; }
/* gerade abgehakt: rutscht nach unten weg */
.todo-block.wird-erledigt { opacity: 0; transform: translateY(14px); }

/* Die Unteraufgaben in der Liste: eingerückt unter dem ToDo */
.unter-liste {
  padding: 0 12px 10px 58px;
  margin-top: -4px;
}
.unter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.92rem;
  cursor: pointer;
}
.unter span { overflow-wrap: anywhere; }
.unter.fertig span { text-decoration: line-through; color: var(--text-leise); }

/* Die Unteraufgaben im Fenster */
#todo-unter-liste:not(:empty) { margin-bottom: 4px; }
.unter-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.unter-zeile input {
  flex: 1;
  min-width: 0;
  background: var(--hintergrund);
  border: 1px solid var(--linie);
  color: var(--text);
  border-radius: 10px;
  padding: 9px;
  font: inherit;
  font-size: 0.95rem;
}
.unter-zeile.fertig input { text-decoration: line-through; color: var(--text-leise); }

/* Wichtigkeit: Hoch = leuchtend rot, Mittel = Gold, Niedrig = Silber */
.wichtig {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
}
.wichtig.hoch {
  background: var(--rot-kreis);
  color: white;
  box-shadow: 0 0 8px rgba(255, 31, 61, 0.45);
}
.wichtig.mittel {
  background: linear-gradient(#1d1e22, #1d1e22) padding-box, var(--gold-verlauf) border-box;
  border: 1px solid transparent;
  color: #f0d68a;
}
.wichtig.niedrig {
  border: 1px solid #55585e;
  color: var(--silber);
}

/* ---------- Bereich "Erledigt" ---------- */
.erledigt-bereich { margin-top: 22px; }
.erledigt-bereich summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-leise);
  padding: 8px 0 10px;
  list-style: none;
  position: relative;
}
.erledigt-bereich summary::-webkit-details-marker { display: none; }
.erledigt-bereich summary::before { content: "▸ "; }
.erledigt-bereich[open] summary::before { content: "▾ "; }
/* feine Silberlinie über dem Bereich */
.erledigt-bereich summary::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: var(--silber-verlauf);
  opacity: 0.35;
}

/* ---------- Die Fenster (ToDo und Gruppen) ---------- */
.todo-fenster {
  margin: auto;
  border: none;
  border-radius: 20px;
  background: var(--flaeche);
  color: var(--text);
  width: min(94vw, 440px);
  max-height: 92vh;
  padding: 20px;
}
.todo-fenster::backdrop { background: rgba(0, 0, 0, 0.65); }

/* Wichtigkeit im Fenster: ausgewählte Stufe in ihrer Farbe */
#todo-wichtigkeit label { flex: 1; text-align: center; }
#todo-wichtigkeit .w-hoch:has(input:checked)    { background: var(--rot-kreis); border-color: transparent; color: white; box-shadow: 0 0 8px rgba(255, 31, 61, 0.45); }
#todo-wichtigkeit .w-mittel:has(input:checked)  { background: linear-gradient(#1d1e22, #1d1e22) padding-box, var(--gold-verlauf) border-box; border-color: transparent; color: #f0d68a; }
#todo-wichtigkeit .w-niedrig:has(input:checked) { border-color: var(--silber); color: var(--silber); }
#todo-farben .auto { background: #2a2b30; color: var(--text); }

/* Gruppen bearbeiten */
.gruppe-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.gruppe-zeile input,
.gruppe-neu input {
  flex: 1;
  min-width: 0;
  background: var(--hintergrund);
  border: 1px solid var(--linie);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 1rem;
}
.schul-marke {
  font-size: 0.7rem;
  color: var(--gold);
  border: 1px solid rgba(216, 180, 90, 0.5);
  border-radius: 99px;
  padding: 2px 8px;
}
.gruppe-neu { display: flex; gap: 8px; align-items: center; }
