/* alltag-view.css — Alltagsansicht (src/views/alltag.js)
   Tokens: design-tokens.css (OKLCH warm-dark). Mobile-first.
   2026-06-11: Komplett aufgewertet auf tag-view-Niveau.
   Prinzip: EINE Sache dominiert (Heute), der Rest tritt zurück.
*/

/* ─────────────────────────────────────────────────────────────────────────────
   HEUTE-HERO — dominierende Einheit, atmend, mit Aurora
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-heute {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-5) var(--space-5);
  margin-bottom: var(--space-3);
  border: 1px solid var(--border-strong);
  background: var(--card);
  /* Kein border-left mehr — wir nutzen Aurora statt rohe Farbleiste */
}

/* Aurora-Hintergrund: profil-abhängig warm */
.alltag-heute::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, var(--profil-aktiv-tint) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, oklch(0.67 0.16 340 / 0.07) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.alltag-heute > * {
  position: relative;
  z-index: 1;
}

/* Heute-Titel: groß, Serif, dominiert */
.alltag-heute__datum {
  font-family: var(--font-family-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  line-height: var(--line-height-tight);
  color: var(--foreground);
  margin: 0 0 var(--space-1);
  letter-spacing: -0.01em;
}

.alltag-heute__gruss {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-4);
}

/* Status-Badges unter dem Datum */
.alltag-heute__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.alltag-heute__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: badge-einblenden 360ms var(--ease-out) both;
}

.alltag-heute__badge--aufgabe {
  background: oklch(0.76 0.17 80 / 0.18);
  color: oklch(0.88 0.13 80);
  border: 1px solid oklch(0.76 0.17 80 / 0.30);
}

.alltag-heute__badge--termin {
  background: oklch(0.62 0.18 250 / 0.18);
  color: oklch(0.82 0.14 250);
  border: 1px solid oklch(0.62 0.18 250 / 0.30);
}

.alltag-heute__badge--frei {
  background: oklch(0.70 0.18 145 / 0.18);
  color: oklch(0.82 0.14 145);
  border: 1px solid oklch(0.70 0.18 145 / 0.30);
}

@keyframes badge-einblenden {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   WOCHEN-AGENDA — vertikale Tages-Zeilen, luftiger
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-woche {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Einzelne Tages-Zeile */
.alltag-tag-zeile {
  display: grid;
  grid-template-columns: 3.8rem 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  min-height: 3rem;
  cursor: pointer;
  animation: zeile-einblenden 240ms var(--ease-out) both;
}

.alltag-tag-zeile:nth-child(1) { animation-delay: 20ms; }
.alltag-tag-zeile:nth-child(2) { animation-delay: 40ms; }
.alltag-tag-zeile:nth-child(3) { animation-delay: 60ms; }
.alltag-tag-zeile:nth-child(4) { animation-delay: 80ms; }
.alltag-tag-zeile:nth-child(5) { animation-delay: 100ms; }
.alltag-tag-zeile:nth-child(6) { animation-delay: 120ms; }
.alltag-tag-zeile:nth-child(7) { animation-delay: 140ms; }

@keyframes zeile-einblenden {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.alltag-tag-zeile:hover {
  background: var(--bg-card-hover);
  transform: translateX(2px);
}

.alltag-tag-zeile:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Heute-Hervorhebung: volle Breite, warm, deutlich */
.alltag-tag-zeile--heute {
  background: var(--profil-aktiv-tint);
  border: 1px solid oklch(from var(--profil-aktiv) l c h / 0.25);
  border-left: 3px solid var(--profil-aktiv-strong);
  transform: none;
  padding-left: calc(var(--space-3) - 2px); /* Ausgleich border-left */
}

.alltag-tag-zeile--heute:hover {
  background: oklch(from var(--profil-aktiv) l c h / 0.22);
  transform: translateX(2px);
}

/* Datums-Spalte */
.alltag-tag-zeile__datum {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.alltag-tag-zeile__wt {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  line-height: 1.1;
}

.alltag-tag-zeile--heute .alltag-tag-zeile__wt {
  color: var(--profil-aktiv-strong);
}

.alltag-tag-zeile__tag {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1.2;
}

.alltag-tag-zeile--heute .alltag-tag-zeile__tag {
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--font-size-base);
}

/* Chips-Spalte */
.alltag-tag-zeile__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-width: 0;
  align-items: center;
}

/* Plus-Button am Tages-Stripe */
.alltag-tag-zeile__add {
  width: var(--touch-min);
  height: var(--touch-min);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-bounce);
}

.alltag-tag-zeile:hover .alltag-tag-zeile__add,
.alltag-tag-zeile--heute .alltag-tag-zeile__add {
  opacity: 1;
}

.alltag-tag-zeile__add:hover {
  background: var(--profil-aktiv-tint);
  color: var(--profil-aktiv-strong);
  transform: scale(1.15) rotate(90deg);
}

.alltag-tag-zeile__add:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CHIPS — klickbare Eintrags-Pillen, hochwertiger
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-bounce);
  /* Resets für <button> */
  background: none;
  font-family: inherit;
}

.alltag-chip:hover {
  transform: scale(1.05);
}

.alltag-chip:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Termin-Chip */
.alltag-chip--termin {
  background: oklch(0.62 0.18 250 / 0.16);
  color: oklch(0.82 0.14 250);
  border-color: oklch(0.62 0.18 250 / 0.28);
}
.alltag-chip--termin:hover {
  background: oklch(0.62 0.18 250 / 0.30);
  border-color: oklch(0.62 0.18 250 / 0.50);
}

/* Aufgaben-Chip — warmes Amber */
.alltag-chip--aufgabe {
  background: oklch(0.76 0.17 80 / 0.14);
  color: oklch(0.86 0.14 80);
  border-color: oklch(0.76 0.17 80 / 0.28);
}
.alltag-chip--aufgabe:hover {
  background: oklch(0.76 0.17 80 / 0.28);
  border-color: oklch(0.76 0.17 80 / 0.50);
}

/* Reise-Chip — warm grün */
.alltag-chip--reise {
  background: oklch(0.70 0.18 145 / 0.14);
  color: oklch(0.82 0.15 145);
  border-color: oklch(0.70 0.18 145 / 0.28);
}
.alltag-chip--reise:hover {
  background: oklch(0.70 0.18 145 / 0.28);
  border-color: oklch(0.70 0.18 145 / 0.50);
}

/* Geburtstag-Chip — rosa */
.alltag-chip--geburtstag {
  background: oklch(0.67 0.16 340 / 0.14);
  color: oklch(0.82 0.13 340);
  border-color: oklch(0.67 0.16 340 / 0.28);
}
.alltag-chip--geburtstag:hover {
  background: oklch(0.67 0.16 340 / 0.28);
  border-color: oklch(0.67 0.16 340 / 0.50);
}

/* Leer-Chip — gedämpft */
.alltag-chip--leer {
  color: var(--text-muted);
  background: none;
  border-color: transparent;
  cursor: default;
  font-weight: 400;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MONATS-AKKORDEON — erweitert, mit Hover-Glow
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-monat {
  border-top: 1px solid var(--border);
  margin-top: var(--space-4);
  padding-top: var(--space-2);
}

.alltag-monat__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  min-height: var(--touch-min);
}

.alltag-monat__toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.alltag-monat__toggle:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.alltag-monat__toggle[aria-expanded="true"] {
  color: var(--text-primary);
}

.alltag-monat__name {
  flex: 1;
  text-align: left;
}

.alltag-monat__zaehler {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card-hover);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.alltag-monat__toggle[aria-expanded="true"] .alltag-monat__zaehler {
  background: var(--profil-aktiv-tint);
  color: var(--profil-aktiv-strong);
}

.alltag-monat__chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-bounce);
  display: inline-block;
  margin-left: var(--space-1);
}

.alltag-monat__toggle[aria-expanded="true"] .alltag-monat__chevron {
  transform: rotate(180deg);
  color: var(--profil-aktiv-strong);
}

/* Akkordeon-Body: smooth */
.alltag-monat__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.alltag-monat__body[aria-hidden="false"] {
  max-height: 4000px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SYSTEM-LOG — "Was das Board getan hat" — eleganter Kanal
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-systemlog {
  position: relative;
  padding-left: var(--space-4);
  border-radius: var(--radius-lg);
}

/* Vertikale Linie */
.alltag-systemlog::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--space-2);
  bottom: var(--space-2);
  width: 2px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    to bottom,
    oklch(0.62 0.18 250 / 0.50),
    oklch(0.62 0.18 250 / 0.10)
  );
}

.systemlog-liste {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.systemlog-eintrag {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
  animation: log-einblenden 300ms var(--ease-out) both;
}

.systemlog-eintrag:nth-child(1) { animation-delay: 40ms; }
.systemlog-eintrag:nth-child(2) { animation-delay: 80ms; }
.systemlog-eintrag:nth-child(3) { animation-delay: 120ms; }
.systemlog-eintrag:nth-child(4) { animation-delay: 160ms; }

@keyframes log-einblenden {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.systemlog-eintrag:hover {
  background: var(--bg-card-hover);
}

.systemlog-eintrag__icon {
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.systemlog-eintrag__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.systemlog-eintrag__text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.45;
}

.systemlog-eintrag__zeit {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* ─────────────────────────────────────────────────────────────────────────────
   POST-SEKTION — klappbare Mail-Zeilen
   ───────────────────────────────────────────────────────────────────────────── */

.post-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.post-zeile {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--shadow-xs, 0 1px 2px oklch(0 0 0 / 0.06));
}

.post-zeile__kopf {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem 1fr auto 1.2rem;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: background 0.15s;
}

.post-zeile__kopf:hover {
  background: oklch(1 0 0 / 0.04);
}

.post-zeile__icon {
  font-size: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.post-zeile__haupt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.post-zeile__titel {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-zeile__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.post-zeile__aktion-kurz {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.post-zeile__chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.18s;
  flex-shrink: 0;
}

.post-zeile__kopf[aria-expanded="true"] .post-zeile__chevron {
  transform: rotate(90deg);
}

.post-zeile__detail {
  padding: var(--space-2) var(--space-3) var(--space-3) 3.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.post-zeile__detail p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.45;
}

.post-zeile__aktion {
  color: var(--text-secondary);
  font-style: italic;
}

.section__head-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TRENNLINIE zwischen Heute und Rest
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-trennlinie {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) 0;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alltag-trennlinie::before,
.alltag-trennlinie::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─────────────────────────────────────────────────────────────────────────────
   prefers-reduced-motion
   ───────────────────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────────────────
   BRAIN-DUMP-SEKTION — Gedankenstrom-Eingabe
   ───────────────────────────────────────────────────────────────────────────── */

.alltag-brain-dump {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  margin-top: var(--space-2);
}

.dump-textfeld {
  display: block;
  line-height: 1.55;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.dump-textfeld:focus {
  box-shadow: 0 0 0 3px oklch(0.62 0.18 250 / 0.22);
  border-color: oklch(0.62 0.18 250) !important;
}

/* Chip-Typen für Ergebnis-Punkte */
.dump-chip--heute {
  background: oklch(0.65 0.22 25 / 0.18);
  color: oklch(0.82 0.16 25);
  border: 1px solid oklch(0.65 0.22 25 / 0.30);
}

.dump-chip--woche {
  background: oklch(0.76 0.17 80 / 0.18);
  color: oklch(0.88 0.13 80);
  border: 1px solid oklch(0.76 0.17 80 / 0.30);
}

.dump-chip--spaeter {
  background: var(--bg-tertiary, oklch(0.26 0.015 60));
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Spin-Animation für Lade-Indikator */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Ergebnis-Karte Einblendung */
.dump-ergebnis-karte {
  animation: ergebnis-einblenden 280ms var(--ease-out) both;
}

@keyframes ergebnis-einblenden {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dump-punkt {
  animation: punkt-einblenden 180ms var(--ease-out) both;
}

.dump-punkt:nth-child(1) { animation-delay: 30ms; }
.dump-punkt:nth-child(2) { animation-delay: 60ms; }
.dump-punkt:nth-child(3) { animation-delay: 90ms; }
.dump-punkt:nth-child(4) { animation-delay: 120ms; }
.dump-punkt:nth-child(5) { animation-delay: 150ms; }

@keyframes punkt-einblenden {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   prefers-reduced-motion
   ───────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .alltag-monat__body,
  .alltag-monat__chevron,
  .alltag-tag-zeile,
  .alltag-chip,
  .systemlog-eintrag,
  .alltag-heute__badge,
  .post-zeile__chevron,
  .dump-ergebnis-karte,
  .dump-punkt {
    animation: none;
    transition: none;
  }
  .alltag-tag-zeile__add:hover {
    transform: none;
  }
  .alltag-chip:hover {
    transform: none;
  }
}
