/* =============================================================
   MeinePlantage — Rechner/Kalkulator Styles
   Geladen auf: alle Rechner-Detailseiten (VPD, pH, EC, DLI, PPFD, ...)
   Abhängigkeit: mp-main.css (muss vorher geladen sein)
   ============================================================= */

/* ─── Hero (alle Rechner-Detailseiten — gleiches Bild wie Rechner-Hub) ─── */
.mp-hero--rechner-detail {
  background-image: url('https://meineplantage.de/wp-content/uploads/2026/06/cannabis-anbau-rechner-hero.webp');
  background-position: 100% 60%;
  background-size: 75%;
}

/* ─── Form-Basisklassen (gleiche Konvention wie mp-diagnose-wizard-styles.css) ─── */
.mp-form { display: flex; flex-direction: column; gap: var(--mp-spacing-md); }
.mp-form__field { display: flex; flex-direction: column; gap: 0.4rem; }

.mp-form__label {
  font-family: var(--mp-font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--mp-color-dark);
}

/* Reserviert immer exakt Platz für 2 Zeilen (0.9rem * 1.3 line-height * 2),
   damit Inputs in derselben Grid-Zeile unabhängig von der Label-Länge
   auf exakt gleicher Höhe beginnen — egal ob Label ein- oder zweizeilig ist */
.mp-rechner-card__grid .mp-form__label {
  display: flex;
  align-items: flex-start;
  height: 2.6rem;
}

.mp-form__input,
.mp-form__select {
  box-sizing: border-box;
  font-family: var(--mp-font-body);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--mp-color-black);
  background: var(--mp-color-white);
  border: 1.5px solid #d0d7ce;
  border-radius: var(--mp-radius-button);
  padding: 0 1em;
  height: 3rem;
  width: 100%;
}

.mp-form__input:focus,
.mp-form__select:focus {
  outline: none;
  border-color: var(--mp-color-primary);
  box-shadow: 0 0 0 3px rgba(46,94,46,0.12);
}

.mp-form__error {
  font-size: 0.8rem;
  color: #c0392b;
  min-height: 1em;
}

/* ─── Rechner-Card (Eingabe + Ergebnis) ──────────────────────── */
.mp-rechner-section {
  background: var(--mp-color-white);
  padding: var(--mp-spacing-xxl) 0;
}

.mp-rechner-section__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--mp-edge-padding);
}

.mp-rechner-card {
  background: var(--mp-color-surface);
  border-radius: var(--mp-radius-card);
  padding: var(--mp-spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--mp-spacing-md);
}

.mp-rechner-card__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.mp-rechner-card__submit {
  align-self: flex-start;
}

/* ─── Ergebnis-Box (farbcodiert) ──────────────────────────────── */
.mp-rechner-result {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--mp-color-white);
  border-left: 5px solid var(--mp-color-primary);
  border-radius: var(--mp-radius-button);
  padding: 1.25em 1.5em;
}

.mp-rechner-result.mp-visible { display: flex; }

.mp-rechner-result--ok       { border-left-color: var(--mp-color-primary); }
.mp-rechner-result--warning  { border-left-color: #d99a1b; }
.mp-rechner-result--critical { border-left-color: #c0392b; }

.mp-rechner-result__value {
  font-family: var(--mp-font-heading);
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.9rem);
  font-weight: 700;
  color: var(--mp-color-dark);
}

.mp-rechner-result__label {
  font-size: 0.85rem;
  color: var(--mp-color-gray-mid);
}

.mp-rechner-result__hint {
  font-size: 0.95rem;
  color: var(--mp-color-gray-dark);
  margin: 0;
}

/* ─── Warum-Wieso-Weshalb Erklärung ───────────────────────────── */
.mp-rechner-explainer {
  background: var(--mp-color-bg);
  padding: 4rem var(--mp-edge-padding);
}

.mp-rechner-explainer__inner {
  max-width: var(--mp-content-width);
  margin: 0 auto;
}

.mp-rechner-explainer__header {
  max-width: 620px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.mp-rechner-explainer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.mp-rechner-explainer__card {
  background: var(--mp-color-white);
  border-radius: var(--mp-radius-card);
  padding: var(--mp-spacing-lg);
}

.mp-rechner-explainer__card h3 {
  font-family: var(--mp-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mp-color-dark);
  margin: 0 0 0.5rem;
}

.mp-rechner-explainer__card p {
  font-size: 0.95rem;
  color: var(--mp-color-gray-dark);
  margin: 0;
}

/* ─── Breadcrumb (Rechner-Detail-Seiten) ──────────────────────── */
.mp-rechner-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 1rem;
}
.mp-rechner-breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }
.mp-rechner-breadcrumb a:hover { color: var(--mp-color-white); }
.mp-rechner-breadcrumb span { opacity: 0.6; }

/* ─── Ergebnis-Branding ───────────────────────────────────────── */
.mp-rechner-result__branding {
  font-size: 0.78rem;
  color: var(--mp-color-gray-mid);
  margin: 0.25rem 0 0;
  border-top: 1px solid #eee;
  padding-top: 0.5rem;
}
.mp-rechner-result__branding a {
  color: var(--mp-color-primary);
  text-decoration: none;
}

/* ─── Forum-Copy Block ────────────────────────────────────────── */
.mp-rechner-forum-copy {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--mp-color-white);
  border: 1.5px solid #d0d7ce;
  border-radius: var(--mp-radius-button);
  padding: 1rem 1.25rem;
}
.mp-rechner-forum-copy.mp-visible { display: flex; }

.mp-rechner-forum-copy__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.mp-rechner-forum-copy__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mp-color-gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mp-rechner-forum-copy__tabs {
  display: flex;
  gap: 0.25rem;
}
.mp-rechner-forum-copy__tab {
  background: none;
  border: 1.5px solid #d0d7ce;
  border-radius: var(--mp-radius-button);
  padding: 0.2em 0.65em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mp-color-gray-dark);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.mp-rechner-forum-copy__tab--active,
.mp-rechner-forum-copy__tab:hover {
  border-color: var(--mp-color-primary);
  color: var(--mp-color-primary);
}
.mp-rechner-forum-copy__textarea {
  font-family: var(--mp-font-body);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--mp-color-gray-dark);
  background: var(--mp-color-bg);
  border: 1.5px solid #d0d7ce;
  border-radius: var(--mp-radius-button);
  padding: 0.6em 0.9em;
  resize: none;
  width: 100%;
  box-sizing: border-box;
  height: 9rem;
}
.mp-rechner-forum-copy__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mp-rechner-forum-copy__copy-btn {
  background: var(--mp-color-primary);
  color: var(--mp-color-white);
  border: none;
  border-radius: var(--mp-radius-button);
  padding: 0.45em 1.1em;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--mp-font-body);
}
.mp-rechner-forum-copy__copy-btn:hover { background: var(--mp-color-primary-dark, #1e5c1e); }
.mp-rechner-forum-copy__copied {
  display: none;
  font-size: 0.82rem;
  color: var(--mp-color-primary);
  font-weight: 700;
}
.mp-rechner-forum-copy__copied.mp-visible { display: inline; }

/* ─── Context-sensitive Link-Buckets ─────────────────────────── */
.mp-rechner-link-buckets > [data-bucket] { display: none; }
.mp-rechner-link-buckets > [data-bucket].mp-visible {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── Typische Fehler ─────────────────────────────────────────── */
.mp-rechner-fehler {
  background: var(--mp-color-white);
  padding: 4rem var(--mp-edge-padding);
}
.mp-rechner-fehler__inner {
  max-width: var(--mp-content-width);
  margin: 0 auto;
}
.mp-rechner-fehler__list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mp-rechner-fehler__item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--mp-color-gray-dark);
  line-height: 1.5;
}
.mp-rechner-fehler__item::before {
  content: '✗';
  color: #c0392b;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ─── FAQ ─────────────────────────────────────────────────────── */
.mp-rechner-faq {
  background: var(--mp-color-bg);
  padding: 4rem var(--mp-edge-padding);
}
.mp-rechner-faq__inner {
  max-width: 760px;
  margin: 0 auto;
}
.mp-rechner-faq__list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0 0;
}
.mp-rechner-faq__item h3 {
  font-family: var(--mp-font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mp-color-dark);
  margin: 0 0 0.4rem;
}
.mp-rechner-faq__item p {
  font-size: 0.95rem;
  color: var(--mp-color-gray-dark);
  margin: 0;
  line-height: 1.6;
}

/* ─── Erntezeitpunkt: Detailtabelle (früh/optimal/spät) ──────── */
.mp-rechner-ernte-detail {
  display: none;
  flex-direction: column;
  gap: 0;
  margin-top: var(--mp-spacing-md);
  border: 1px solid var(--mp-color-border);
  border-radius: var(--mp-radius);
  overflow: hidden;
}
.mp-rechner-ernte-detail.mp-visible { display: flex; }

.mp-rechner-ernte-detail__row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--mp-color-border);
  align-items: start;
}
.mp-rechner-ernte-detail__row:last-child { border-bottom: none; }

.mp-rechner-ernte-detail__row--frueh   { background: #f8fdf8; }
.mp-rechner-ernte-detail__row--optimal { background: #f0faf2; }
.mp-rechner-ernte-detail__row--spaet   { background: #fdf8f0; }

.mp-rechner-ernte-detail__label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--mp-color-dark);
  padding-top: 0.1rem;
}
.mp-rechner-ernte-detail__datum {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mp-color-dark);
}
.mp-rechner-ernte-detail__trichom {
  font-size: 0.82rem;
  color: var(--mp-color-gray-dark);
}
.mp-rechner-ernte-detail__wirkung {
  font-size: 0.82rem;
  color: var(--mp-color-gray-dark);
  grid-column: 2 / -1;
  padding-top: 0.2rem;
}

/* ─── Custom-Wochen-Feld (Erntezeitpunkt) ────────────────────── */
#mp-ernte-custom-field {
  display: none;
}
#mp-ernte-custom-field.mp-visible {
  display: flex;
  flex-direction: column;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .mp-rechner-card__grid,
  .mp-rechner-explainer__grid {
    grid-template-columns: 1fr;
  }
  .mp-rechner-card { padding: var(--mp-spacing-md); }

  .mp-rechner-ernte-detail__row {
    grid-template-columns: 1fr 1fr;
  }
  .mp-rechner-ernte-detail__label {
    grid-column: 1 / -1;
    font-size: 0.9rem;
  }
  .mp-rechner-ernte-detail__wirkung {
    grid-column: 1 / -1;
  }
}
