/* --- Leer- und Ladezustand (DESIGN 5) ------------------------------------------------------ */

.empty-state {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  padding: var(--space-8) var(--space-6);
  color: var(--text-2);
  text-align: center;
}

.empty-state--compact {
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
}

/* Im Kartenfuß (Flex-Zeile) füllt der Leerzustand die Breite, damit er mittig steht statt links
   zu kleben (AP 1.6). */
.card__foot > .empty-state {
  flex: 1;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-1);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.05), transparent 70%);
  color: var(--text-3);
}

.empty-state--compact .empty-state__icon {
  width: 52px;
  height: 52px;
}

.empty-state__title {
  color: var(--text-1);
  font: var(--text-h3);
}

/* Überschriften der Fehlerseiten (403, 404) erben sonst --text-2 und wirken ausgeblichen. */
.empty-state h1 {
  color: var(--text-1);
}

.empty-state__text {
  max-width: 46ch;
}

.skeleton {
  display: grid;
  gap: var(--space-3);
}

.skeleton__bar {
  height: 12px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--surface-pill) 0%, var(--surface-pill-hover) 50%, var(--surface-pill) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton__bar--title { width: 40%; height: 16px; }
.skeleton__bar--long { width: 92%; }
.skeleton__bar--medium { width: 70%; }
.skeleton__bar--short { width: 48%; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.spinner {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(240, 174, 102, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Schwebende Ladeanzeige (DESIGN 5 „Ladezustand“, AP 3.5): schwebt unten in der Mitte des Fensters – sichtbar,
   wo immer man gerade steht, auch wenn „Scannen“ weit unten in der Einstellungs-Karte liegt. */
.loading-pill {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  z-index: var(--z-toast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100vw - 2 * var(--space-4));
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: var(--shadow-float);
  color: var(--text-1);
  font-size: 0.8125rem;
  pointer-events: none;
  transform: translateX(-50%);
}

/* HTMX-Ladeanzeige (includeIndicatorStyles ist aus, CSP ohne Inline-Stile). */
.htmx-indicator {
  opacity: 0;
  transition: opacity var(--ease);
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}
