/* ==========================================================================
   canopy. — Dashboard-Tab
   ========================================================================== */

/* Dashboard soll auf iPhone 11/12/13 nicht scrollen (s. Absprache) -- der
   Freiraum vor der Tab-Leiste ist ohnehin schon durch #app's eigenes
   padding-bottom (Tab-Leisten-Höhe) reserviert, das zusätzliche
   .view-Padding hier ist daher redundant und wird gekürzt. Scrollen ist
   zusätzlich hart deaktiviert statt nur pixelgenau wegtariert, s. Absprache
   -- robuster als jedes Mal aufs Pixel genau zu passen, Kehrseite: Inhalt,
   der doch nicht reinpasst, wird abgeschnitten statt scrollbar. */
.view[data-view="dashboard"] {
  padding-bottom: var(--space-2);
  overflow: hidden;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.run-title h1 {
  font-size: 20px;
}

.run-title .run-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* -- Sonne/Mond-Indikator oben rechts -- */
.light-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.light-indicator .sun-moon-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  padding: 6px;
  gap: 4px;
}

.light-indicator .icon-slot {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.light-indicator .icon-slot.active {
  color: var(--accent-amber);
}
.light-indicator .icon-slot.active.is-moon {
  color: #a9b8d8;
}

.light-indicator .icon-slot.active svg {
  filter: drop-shadow(0 0 5px currentColor);
}

.light-indicator .divider {
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.light-indicator .countdown {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* -- Hero-Zeile: Fadenkreuz links (62% Breite, quadratisch, Pflanze
   mittig darin) + gedrehtes canopy.-Logo im Freiraum rechts daneben
   (s. Absprache -- Run/Licht/Strain sitzen NICHT hier, sondern als
   vierte Ecke im Fadenkreuz selbst, s. .hero-frame-stats). -- */
.hero-row {
  display: flex;
  align-items: stretch; /* .hero-hud muss auf volle Fadenkreuz-Höhe gestreckt
    sein, sonst hat die gedrehte Logo-Schrift nur eine Zeilenhöhe Platz und
    wird abgeschnitten -- transform dreht nur die Darstellung, nicht die
    Layout-Box, s. Absprache/Bugfix. */
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
}

/* -- Hero-Illustration: Scan-/Reticle-Rahmen -- */
.hero-frame {
  position: relative;
  flex: 0 0 75%;
  height: 190px; /* unabhängig von der Breite, s. Absprache -- muss nicht
    mehr quadratisch sein. Durfte wieder großzügiger werden, nachdem der
    eigentliche Platzfresser (Sonne/Mond blähte die ganze Kopfzeile auf,
    s. .topbar .light-indicator) behoben war. */
  border-radius: var(--radius-card);
  background: radial-gradient(circle at 50% 40%, rgba(95, 214, 138, 0.06), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* -- Matrix-Werte, vierte Fadenkreuz-Ecke (unten links, spiegelt den
   Tage-Zähler unten rechts) -- Run/Licht/Strain der aktuell gezeigten
   Pflanze, bewusst ohne Überschriften/Labels (s. Absprache). -- */
.hero-frame-stats {
  position: absolute;
  bottom: 22px;
  left: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-hud-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-green-glow);
  text-shadow: 0 0 6px rgba(143, 252, 180, 0.6);
  white-space: nowrap;
}

/* -- Freiraum rechts vom Fadenkreuz: nur das canopy.-Logo, um 90°
   gedreht (lesbar, wenn man das Gerät nach links dreht, s. Absprache). -- */
.hero-hud {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-hud-logo {
  transform: rotate(90deg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Scan-Raster im Hintergrund */
.hero-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(95, 214, 138, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 214, 138, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 50% 50%, black 60%, transparent 95%);
}

/* Fadenkreuz-Ecken (Reticle) */
.hero-frame .reticle-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(95, 214, 138, 0.4);
}
.reticle-corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.reticle-corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.reticle-corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.reticle-corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }

/* Wachstumsstand-Illustrationen sind Raster-PNGs (s. assets/hero/), aber
   trotzdem frei einfärbbar: über CSS-Masken statt <img> eingebunden, die
   Pflanzenform kommt aus der PNG-Alpha, die sichtbare Farbe aus
   background-color (hier: currentColor -> var(--accent-green)) — genau
   wie stroke="currentColor" bei den handgezeichneten SVG-Icons.
   Glow-Filter sitzt bewusst auf einem eigenen Wrapper (.hero-plant-glow),
   nicht direkt auf dem maskierten Element: filter + mask-image auf
   demselben Element lässt es in Safari/iOS komplett verschwinden (bekannte
   WebKit-Eigenart) — das ist das eigentliche Zielgerät dieser App. */
.hero-plant-glow {
  position: relative;
  z-index: 1;
  width: 55%;
  height: 55%;
  filter: drop-shadow(0 0 8px rgba(95, 214, 138, 0.5));
  transition: opacity 0.4s ease;
}

#hero-plant-svg {
  width: 100%;
  height: 100%;
  color: var(--accent-green);
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
}

.hero-stage-label {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-green);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(20, 22, 26, 0.7);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* -- Pfeil-Regler: manuelle Wahl des Hero-Stands, unabhängig vom
   Phasen-Regler (s. Absprache: alle 8 Stände sollen erreichbar sein,
   ohne die VPD-/Phasen-Logik zu koppeln). -- */
.hero-frame .hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 22, 26, 0.5);
  font-size: 20px;
  line-height: 1;
}
.hero-arrow-prev { left: 8px; }
.hero-arrow-next { right: 8px; }

/* -- Zustands-Balken pro Pflanze, oben rechts im Hero-Frame -- */
.hero-health-corner {
  position: absolute;
  top: 34px; /* bündig mit der Unterkante von .hero-stage-label, s. Absprache */
  right: 22px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.hero-health-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-health-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Zeigt zusätzlich an, welche Pflanze gerade per Pfeil-Regler im Hero-Bild
   zu sehen ist (s. Absprache) -- gleicher Punkt, doppelte Funktion. */
.hero-health-dot.active {
  background: var(--accent-green);
}

/* HUD-artiger Tage-Counter, unten rechts, angelehnt an Videospiel-Overlays */
.hero-day-counter {
  position: absolute;
  bottom: 22px;
  right: 22px;
  font-size: 13px;
  color: var(--accent-green-glow);
  text-shadow: 0 0 6px rgba(143, 252, 180, 0.6);
  letter-spacing: 0.02em;
}

/* -- Kartenreihen: oben kompakt, Mitte normal, unten volle Breite -- */
.mini-row,
.mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.mini-row {
  margin-bottom: var(--space-2);
}

.mid-row {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  border: none;
  border-left: 4px solid transparent;
  padding: var(--space-3);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-primary);
}

.card > *:not(.card-watermark) {
  position: relative;
  z-index: 1;
}

/* Übergroßes, sehr dezentes Icon im Hintergrund jeder Karte —
   nutzt dasselbe Icon wie card-icon, nur groß + kaum sichtbar */
.card-watermark {
  position: absolute;
  right: -14px;
  bottom: -14px;
  width: 76px;
  height: 76px;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  color: var(--text-primary);
}

.card-watermark svg {
  width: 100%;
  height: 100%;
}

.card.card-vpd { border-left-color: var(--accent-green); }
.card.card-water { border-left-color: var(--accent-blue); }
.card.card-light { border-left-color: var(--accent-amber); }
.card.card-exhaust { border-left-color: var(--accent-violet); }
.card.card-notes { border-left-color: var(--accent-slate); }

.card.card-vpd .card-watermark { color: var(--accent-green); }
.card.card-water .card-watermark { color: var(--accent-blue); }
.card.card-light .card-watermark { color: var(--accent-amber); }
.card.card-exhaust .card-watermark { color: var(--accent-violet); }
.card.card-notes .card-watermark { color: var(--accent-slate); }

.card.card-full {
  width: 100%;
}

/* Kompakte Tiles oben (Licht/Abluft): flacher, weniger Inhalt */
.card.card-compact {
  padding: var(--space-2) var(--space-3);
  gap: 4px;
}

.card.card-compact .card-icon {
  width: 26px;
  height: 26px;
}

.card.card-compact .card-icon svg {
  width: 14px;
  height: 14px;
}

.card.card-compact .card-value {
  font-size: 16px;
}

.card.card-compact .inline-control {
  margin-top: 0;
}

.card .card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-tile);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card .card-icon svg {
  width: 18px;
  height: 18px;
}

/* Kachel-Icon-Akzentfarben je Kennzahl — dezent, eigenständig, beißt sich nicht */
.card.card-vpd .card-icon { background: var(--accent-green-dim); color: var(--accent-green); }
.card.card-water .card-icon { background: var(--accent-blue-dim); color: var(--accent-blue); }
.card.card-light .card-icon { background: var(--accent-amber-dim); color: var(--accent-amber); }
.card.card-exhaust .card-icon { background: var(--accent-violet-dim); color: var(--accent-violet); }
.card.card-notes .card-icon { background: var(--accent-slate-dim); color: var(--accent-slate); }

.card .card-label {
  font-size: 12px;
  color: var(--text-muted);
}

.card .card-value {
  font-size: 20px;
  font-weight: 500;
}

.card .card-value .unit {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 3px;
}

/* Reine Shortcut-Kacheln ohne Messwert (z.B. VPD-Tool) — Fließtext statt
   großer Zahl, damit es nicht wie ein leerer/fehlender Wert aussieht. */
.card .card-value.card-value-action {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-green);
}

.card .card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Lichtleistungs- / Abluft-Eingabe direkt unter den Cards */
.inline-control {
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.inline-control input[type="range"] {
  flex: 1;
  accent-color: var(--accent-amber);
}

.lamp-wattage-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.lamp-wattage-row label {
  font-size: 11px;
  color: var(--text-muted);
}

.lamp-wattage-row input {
  width: 60px; /* etwas breiter, damit die größere Schrift unten reinpasst */
  background: var(--bg-elevated-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px; /* nicht darunter, s. forms.css -- iOS-Auto-Zoom-Fix */
}

.lamp-wattage-row .unit-suffix {
  font-size: 11px;
  color: var(--text-muted);
}
