/* ============================================================
   FeedForward – Frontend Styles
   ============================================================ */

/* ---------- Grundlayout ---------- */

.ff-wrap {
  max-width: 960px;
  margin: 1.5rem auto;
  padding: 1.5rem 1.75rem;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, sans-serif;
}

.ff-wrap.ff-results-only .ff-form {
  display: none;
}

.ff-q {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
}

/* Info / Hinweise */

.ff-info {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.95rem;
}

.ff-hint {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Buttons */

.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease,
              box-shadow 0.15s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.ff-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.ff-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.ff-btn:disabled,
.ff-btn[disabled] {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

/* Delete-Button (Ranking + Optionen) */

.ff-btn.ff-btn-del {
  padding: 0.35rem 0.75rem;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.ff-btn.ff-btn-del:hover {
  background: #dc2626;
}

/* Formulare allgemein */

.ff-form {
  margin: 0;
}

.ff-wrap input[type="text"],
.ff-wrap input[type="number"] {
  width: 100%;
  max-width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
  font-size: 0.95rem;
}

.ff-wrap input[type="text"]:focus,
.ff-wrap input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Utility */

.ff-hidden {
  display: none !important;
}

/* ============================================================
   ABSTIMMUNG (Poll)
   ============================================================ */

.ff-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ff-list li {
  margin-bottom: 0.5rem;
}

/* Karte für Poll-Optionen (Eingabe-Seite) */

.ff-list li label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.8rem;
  background: #f9fafb;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.ff-list input[type="radio"],
.ff-list input[type="checkbox"] {
  margin: 0;
}

/* Ergebnis-Balken */

.ff-results {
  margin-top: 1.1rem;
}

/* Container für Balken */

.ff-bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Eine Zeile (Option) */

.ff-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2.6fr) minmax(60px, auto);
  align-items: center;
  column-gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: #f9fafb;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.94rem;
}

/* Label links */

.ff-bar-label {
  white-space: normal;
  word-break: break-word;
}

/* Track + Füllung */

.ff-bar-track {
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ff-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.2s ease-out;
}

/* Wert rechts */

.ff-bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
}

/* ============================================================
   SLIDER – Eingabe & Auswertung
   ============================================================ */

.ff-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2.6fr) minmax(60px, auto);
  align-items: center;
  column-gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.45rem;
  background: #f9fafb;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.94rem;
}

.ff-slider-label {
  white-space: normal;
  word-break: break-word;
}

/* Bereich, in dem Min/Max + Track sitzen */

.ff-slider-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 0.4rem;
}

/* Min/Max-Beschriftung */

.ff-slider-end {
  font-size: 0.8rem;
  color: #6b7280;
  white-space: nowrap;
}

/* Track-Wrapper */

.ff-slider-trackwrap {
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: transparent;
  overflow: visible;
}

/* Graue Basislinie */

.ff-slider-trackbase {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #e5e7eb;
}

/* Blauer Ergebnis-Balken (von 50% zur Durchschnittsposition) */

.ff-slider-resultbar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.2s ease-out, left 0.2s ease-out;
}

/* Mittelpunkt-Markierung bei vorhandenen Ergebnissen */

.ff-wrap.ff-has-results .ff-slider-trackwrap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.25rem;
  margin-left: -0.25rem;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 2px #ffffff;
  z-index: 2;
}

/* Slider-Wert rechts */

.ff-slider-avg-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
}

/* ---------- Native Range-Inputs im Slider ---------- */

.ff-slider-trackwrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 3;           /* über der Basislinie */
  width: 100%;
  height: 0.55rem;
  margin: 0;
  background: transparent;
}

/* Track (WebKit) – unsichtbar, wir verwenden unsere Basislinie */

.ff-slider-trackwrap input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  height: 0.55rem;
  background: transparent;
}

/* Daumen (WebKit) */

.ff-slider-trackwrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  margin-top: -0.2rem; /* vertikal zentrieren */
}

/* Track (Firefox) */

.ff-slider-trackwrap input[type="range"]::-moz-range-track {
  height: 0.55rem;
  background: transparent;
}

/* Daumen (Firefox) */

.ff-slider-trackwrap input[type="range"]::-moz-range-thumb {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

/* ============================================================
   WORTWOLKE
   ============================================================ */

.ff-form-wordcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ff-form-wordcloud input[type="text"] {
  flex: 1 1 220px;
}

.ff-cloud {
  margin-top: 1rem;
  padding: 0.75rem 0.5rem 0.25rem;
  border-radius: 16px;
  background: #f9fafb;
  min-height: 3rem;
}

.ff-cloud-word {
  display: inline-block;
  margin: 0.2rem 0.35rem;
  color: #1f2933;
  white-space: nowrap;
}

.ff-cloud-center {
  display: block;
  text-align: center;
  margin-bottom: 0.4rem;
}

/* Farbklassen für Wolke – dezent */

.ff-cloud-c0 { color: #2563eb; }
.ff-cloud-c1 { color: #16a34a; }
.ff-cloud-c2 { color: #ea580c; }
.ff-cloud-c3 { color: #7c3aed; }
.ff-cloud-c4 { color: #0f766e; }

/* ============================================================
   LIVE-RANKING
   ============================================================ */

.ff-ranking-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ff-ranking-add input[type="text"] {
  flex: 1 1 240px;
}

.ff-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.ff-ranking-item {
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #f3f4ff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ff-ranking-text {
  font-size: 0.95rem;
  color: #111827;
  word-break: break-word;
}

.ff-ranking-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.ff-ranking-left {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.ff-ranking-votes-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-size: 0.7rem;
}

.ff-ranking-votes-count {
  font-weight: 600;
  color: #111827;
}

.ff-ranking-actions {
  display: flex;
  gap: 0.4rem;
}

/* +1-Button */

.ff-ranking-actions .ff-btn {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 999px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .ff-wrap {
    margin: 1rem auto;
    padding: 1.2rem 1.1rem;
    border-radius: 14px;
  }

  .ff-bar-row,
  .ff-slider-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2.3fr) minmax(52px, auto);
    padding: 0.5rem 0.75rem;
  }

  .ff-ranking-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .ff-form-wordcloud {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .ff-bar-row,
  .ff-slider-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.35rem;
  }

  .ff-bar-track,
  .ff-slider-control,
  .ff-slider-avg-num {
    grid-column: 1 / -1;
  }

  .ff-slider-control {
    grid-template-columns: auto 1fr auto;
  }

  .ff-slider-avg-num {
    text-align: left;
  }
}
