/*
 * Design FP 12: Segment .fp-segment und Unterstrich-Tabs .fp-tabs.
 * Masse aus tokens.css (--fp-segment-h 36, --fp-tab-h 44, --fp-tab-underline 2, --fp-radius-sm 8).
 * Optik nur hier. Eine Bildschirm-Datei darf für eine Option nur die Aktiv-Farbe setzen:
 * --segment-active-bg, --segment-active-border, --segment-active-fg (z. B. Szenenfarben).
 */

.fp-segment {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: wrap; /* zu viele Optionen (z. B. fünf Szenen auf dem Handy): umbrechen statt überlaufen */
  gap: 2px;
  max-width: 100%;
  min-height: var(--fp-segment-h);
  padding: 2px;
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius-sm);
  background: var(--fp-surface-2);
}

.fp-segment__item {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
  border: 1px solid transparent;
  min-height: calc(var(--fp-segment-h) - 6px);
  border-radius: calc(var(--fp-radius-sm) - 2px);
  background: transparent;
  color: var(--fp-muted);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.fp-segment__item:hover:not(.is-active, :disabled) {
  background: var(--fp-surface-hover);
  color: var(--fp-text);
}

.fp-segment__item.is-active {
  border-color: var(--segment-active-border, var(--fp-signal));
  background: var(--segment-active-bg, var(--fp-signal-soft));
  color: var(--segment-active-fg, var(--fp-on-signal));
}

.fp-segment__item:focus-visible {
  outline: var(--fp-focus-w) solid var(--fp-focus);
  outline-offset: 2px;
}

.fp-segment__item:disabled {
  opacity: var(--btn-disabled-opacity);
  cursor: not-allowed;
}

/* Volle Breite unter 1100 px (Admin-Spalte einspaltig), Optionen teilen sich die Spur. */
@media (width <= 1100px) {
  .fp-segment--fill {
    display: flex;
    width: 100%;
  }

  .fp-segment--fill > .fp-segment__item {
    flex: 1 1 0;
    padding-inline: 8px;
  }
}

/* Unterstrich-Tabs: Höhe 44, aktiver Tab mit 2-px-Strich in der Signalfarbe. */
.fp-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid var(--fp-border);
  scrollbar-width: none;
}

.fp-tab {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: var(--fp-tab-h);
  margin: 0 0 -1px;
  padding: 0 12px;
  border: 0;
  border-bottom: var(--fp-tab-underline) solid transparent;
  background: transparent;
  color: var(--fp-muted);
  font: inherit;
  font-size: var(--fs-14);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.fp-tab:hover:not(.is-active, [aria-selected="true"], :disabled) {
  color: var(--fp-text);
}

.fp-tab.is-active,
.fp-tab[aria-selected="true"] {
  border-bottom-color: var(--fp-signal);
  color: var(--fp-text);
}

.fp-tab:focus-visible {
  outline: none;
  box-shadow: inset var(--fp-focus-ring);
}

.fp-tab:disabled {
  opacity: var(--btn-disabled-opacity);
  cursor: not-allowed;
}
