/* app.css — gemeinsame Styles fuer die promoAbteilung Beta-Feedback-Seite.
   Keine externen Schriften, keine CDN-Abhaengigkeiten. */

:root {
  --color-primary: #0066cc;
  --color-primary-hover: #004b99;
  --color-text: #1e293b;
  --color-bg: #f4f7f9;
  --color-card: #ffffff;
  --color-border: #dbe3ea;
  --color-muted: #64748b;

  --color-status-offen-bg: #e2e8f0;
  --color-status-offen-fg: #1e3a5f;
  --color-status-bearbeitung-bg: #ffedd5;
  --color-status-bearbeitung-fg: #9a4a00;
  --color-status-gefixt-bg: #dcfce7;
  --color-status-gefixt-fg: #166534;
  --color-status-abgelehnt-bg: #fee2e2;
  --color-status-abgelehnt-fg: #991b1b;

  --color-success: #166534;
  --color-error: #b91c1c;
  --color-info: #0066cc;

  --radius: 10px;
  --shadow-card: 0 1px 3px rgba(30, 41, 59, 0.08), 0 4px 12px rgba(30, 41, 59, 0.06);
  --footer-height: 56px;

  font-size: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  line-height: 1.6;
  background-color: var(--color-bg);
  background-image:
    repeating-linear-gradient(45deg, rgba(30, 41, 59, 0.025) 0, rgba(30, 41, 59, 0.025) 1px, transparent 1px, transparent 34px),
    repeating-linear-gradient(-45deg, rgba(30, 41, 59, 0.02) 0, rgba(30, 41, 59, 0.02) 1px, transparent 1px, transparent 34px);
  padding-bottom: calc(var(--footer-height) + 24px);
  min-height: 100vh;
}

a {
  color: var(--color-primary);
}
a:hover {
  color: var(--color-primary-hover);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Kopfbereich ---------- */

.site-header {
  background-color: var(--color-text);
  color: #fff;
  padding: 24px 0;
}

.site-header .logo {
  /* Drei Spalten: Logo | Titel | Ausgleich. Die aeusseren Spalten sind
     gleich breit (1fr), dadurch sitzt der Titel exakt in der Mitte des
     Kopfbereichs und nicht nur rechts neben dem Logo. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.site-header .logo__mark {
  display: flex;
  align-items: center;
  justify-self: start;
}

.site-header .logo__spacer {
  /* Leer, aber notwendig: haelt die rechte Spalte auf, damit die Mitte
     wirklich die Mitte ist. */
}

.site-header .logo > strong {
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.3;
}

@media (max-width: 640px) {
  /* Auf schmalen Geraeten untereinander - nebeneinander bliebe fuer den
     Titel zu wenig Platz und er wuerde umbrechen. */
  .site-header .logo {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .site-header .logo__mark {
    justify-self: center;
  }

  .site-header .logo__spacer {
    display: none;
  }
}

.site-header .logo-fallback {
  display: block;
}

.site-header .logo-fallback text {
  font-family: inherit;
}

.site-header #brandLogo {
  height: 32px;
}

.site-header__intro {
  margin: 16px 0 0;
  color: #cbd5e1;
  max-width: 60ch;
}

/* ---------- Karten / Sections ---------- */

.section {
  padding: 32px 0;
}

.card {
  background-color: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card + .card {
  margin-top: 20px;
}

h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

/* ---------- Formular ---------- */

.form-field {
  margin-bottom: 20px;
}

.form-field label,
.form-field .form-field__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="url"],
.form-field input[type="datetime-local"],
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: #fff;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-primary);
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field__hint {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.form-field__error {
  color: var(--color-error);
  font-size: 0.85rem;
  margin-top: 4px;
}

.required-marker {
  color: var(--color-error);
}

/* Info-Icon mit Tooltip */

.info-tooltip {
  position: relative;
  display: inline-flex;
}

.info-tooltip__icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.info-tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-text);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  width: max-content;
  max-width: 260px;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

.info-tooltip:hover .info-tooltip__bubble,
.info-tooltip:focus-within .info-tooltip__bubble,
.info-tooltip--active .info-tooltip__bubble {
  opacity: 1;
  visibility: visible;
}

/* ---------- Kategorie-Umschaltung (Fehler / Hinweis) ---------- */

.category-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.category-switch__btn {
  flex: 1 1 220px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  background-color: #fff;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
}

.category-switch__btn:hover {
  border-color: var(--color-primary);
}

.category-switch__btn--active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Restzeichen-Zaehler unter dem Hinweis-Textfeld. */
.form-field__counter {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 4px;
  text-align: right;
}

.form-field__counter--warning {
  color: var(--color-status-bearbeitung-fg);
  font-weight: 600;
}

.form-field__counter--critical {
  color: var(--color-error);
  font-weight: 700;
}

/* ---------- Kategorie-/Herkunfts-Kennzeichnung eines Beitrags ---------- */
/* Steht oben links an jedem Beitrag - Herkunft (Admin) schlaegt Kategorie,
   die Zuordnung liefert bereits das Backend (badge.tone). Gelb braucht
   dunkle Schrift fuer ausreichenden Kontrast, rot/gruen helle. */

.category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.category-badge--error {
  background-color: var(--color-error);
  color: #fff;
}

.category-badge--hint {
  background-color: var(--color-success);
  color: #fff;
}

.category-badge--admin {
  background-color: #fbbf24;
  color: var(--color-text);
}

/* ---------- Dropzone ---------- */

.dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--color-muted);
  background-color: #fafcfd;
}

.dropzone:hover,
.dropzone--dragover {
  border-color: var(--color-primary);
  background-color: #eef5fd;
}

.dropzone__preview {
  margin-top: 16px;
  text-align: left;
}

.dropzone__preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  display: block;
  margin-bottom: 10px;
}

.dropzone__status {
  font-size: 0.9rem;
  margin-top: 8px;
  color: var(--color-muted);
}

.autocapture-details {
  margin-top: 8px;
  font-size: 0.9rem;
}

.autocapture-details summary {
  cursor: pointer;
  color: var(--color-primary);
}

.autocapture-details pre {
  background-color: #f4f7f9;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.8rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  background-color: var(--color-primary);
  color: #fff;
}

.btn:hover {
  background-color: var(--color-primary-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--secondary {
  background-color: #fff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background-color: #eef5fd;
}

.btn--ghost {
  background: none;
  color: var(--color-primary);
  border-color: transparent;
  padding: 6px 10px;
}

.btn--ghost:hover {
  background-color: #eef5fd;
}

.btn--block {
  width: 100%;
}

/* ---------- Forum-Filter ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-btn--active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ---------- Forum-Liste ---------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background-color: #fff;
}

.post-item__summary {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-badge--offen {
  background-color: var(--color-status-offen-bg);
  color: var(--color-status-offen-fg);
}
.status-badge--in_bearbeitung {
  background-color: var(--color-status-bearbeitung-bg);
  color: var(--color-status-bearbeitung-fg);
}
.status-badge--gefixt {
  background-color: var(--color-status-gefixt-bg);
  color: var(--color-status-gefixt-fg);
}
.status-badge--abgelehnt {
  background-color: var(--color-status-abgelehnt-bg);
  color: var(--color-status-abgelehnt-fg);
}

.post-item__title {
  font-weight: 600;
  margin: 0;
}

.post-item__thumb {
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.post-item__detail {
  margin-top: 16px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.post-detail__field {
  margin-bottom: 12px;
}

.post-detail__field dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.post-detail__field dd {
  margin: 2px 0 0;
}

.admin-note {
  background-color: #eef5fd;
  border-left: 4px solid var(--color-primary);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.admin-note__label {
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  margin-bottom: 4px;
}

.post-detail__screenshot img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  cursor: zoom-in;
}

/* ---------- Kommentare ---------- */

.comment-tree {
  margin-top: 16px;
}

.comment {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 10px;
  background-color: #fff;
}

.comment--admin {
  background-color: #eef5fd;
  border-color: var(--color-primary);
}

.comment__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.comment__admin-tag {
  background-color: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.comment__replies {
  margin-left: 24px;
}

.comment-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form input,
.comment-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

/* ---------- Zustandsanzeigen ---------- */

.state-box {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #eef2f6 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  border-radius: 8px;
  height: 80px;
  animation: skeleton-shine 1.4s ease infinite;
  margin-bottom: 12px;
}

@keyframes skeleton-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Lead-Bereich ---------- */

.lead-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.55);
  padding: 20px;
  z-index: 100;
}

.modal--open {
  display: flex;
}

.modal__dialog {
  background-color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  position: relative;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-muted);
  line-height: 1;
  padding: 6px;
}

.modal__close:hover {
  color: var(--color-text);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}

.checkbox-field input {
  margin-top: 4px;
}

/* Lightbox fuer Screenshots */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.85);
  z-index: 200;
  padding: 20px;
  cursor: zoom-out;
}

.lightbox--open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

/* ---------- Toasts ---------- */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
  max-width: 340px;
}

.toast {
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  color: #fff;
  font-size: 0.95rem;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast--leaving {
  opacity: 0;
  transform: translateX(20px);
}

.toast--success {
  background-color: var(--color-success);
}
.toast--error {
  background-color: var(--color-error);
}
.toast--info {
  background-color: var(--color-info);
}

/* ---------- Footer ---------- */

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-text);
  color: #cbd5e1;
  padding: 12px 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 50;
}

.site-footer a {
  color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  :root {
    font-size: 17px;
  }

  .container {
    padding: 0 14px;
  }

  .lead-buttons {
    flex-direction: column;
  }

  .comment__replies {
    margin-left: 12px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 10px;
  }

  body {
    padding-bottom: calc(var(--footer-height) + 60px);
  }

  /* Tooltips auf dem Handy per Tap statt Hover: Hover-Regel greift nicht
     auf Touch-Geraeten, .info-tooltip--active wird per JS gesetzt. */
  .info-tooltip__bubble {
    left: auto;
    right: 0;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Kopf-Banner: die vom Admin gepflegte Hauptnachricht (headerText).
   Deutlich abgesetzt, damit Hinweise auf Wartung oder Testschwerpunkte
   nicht in der uebrigen Einleitung untergehen.
--------------------------------------------------------------------------- */
.site-header__banner {
  margin: 0 0 var(--space-3, 1rem);
  padding: 0.9rem 1.15rem;
  border-left: 4px solid var(--primary, #0066cc);
  border-radius: 6px;
  background: rgba(0, 102, 204, 0.08);
  font-weight: 600;
  line-height: 1.5;
}

.site-header__banner[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------------
   Das hidden-Attribut muss immer gewinnen.

   Browser setzen [hidden] nur ueber ihr eigenes Standard-Stylesheet auf
   display:none. Jede Autoren-Regel mit einem display-Wert - etwa
   ".gate { display: flex }" - ueberschreibt das. Das Element bleibt dann
   sichtbar, obwohl JavaScript es korrekt auf hidden gesetzt hat.

   Genau dieser Fehler liess nach dem Admin-Login das Anmeldeformular
   zusaetzlich zum freigeschalteten Panel stehen. Die Regel hier schliesst
   die Fehlerklasse ein fuer alle Mal.
--------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Grauer Hilfstext in leeren Feldern.

   Muss klar schwaecher wirken als echter Inhalt, sonst haelt man ihn fuer
   eine bereits getaetigte Eingabe. Gleichzeitig noch lesbar - reine
   Standardbrowser-Platzhalter sind haeufig zu blass fuer den
   Mindestkontrast.
--------------------------------------------------------------------------- */
input::placeholder,
textarea::placeholder {
  color: #6b7a89;
  opacity: 1;        /* Firefox senkt die Deckkraft sonst zusaetzlich ab */
  font-style: italic;
  font-size: 0.9em;  /* eine Stufe kleiner als echte Eingaben */
}
