/* Gemeinsame Bewegungsschicht aller Labs.
 *
 * Maßstab: Bewegung erzählt etwas, sie schmückt nicht. Erlaubt sind
 *   - Einlaufen von Ereignissen, die zeitlich nacheinander passieren (Logzeilen, Chronik),
 *   - Zustandswechsel, die man sonst übersieht (Dienst gestoppt, Regel greift),
 *   - Rückmeldung auf eine Eingabe, die real Zeit braucht (Scan, Reload).
 * Nicht erlaubt: Effekte, die einen Klick verzögern oder Aufmerksamkeit ohne Aussage ziehen.
 *
 * Alles hier respektiert prefers-reduced-motion: wer Bewegung abbestellt hat, sieht
 * denselben Endzustand sofort - nie weniger Information.
 */

/* ---------- Einlaufen ---------- */
@keyframes mo-row-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Zeile eines Protokolls/einer Chronik, die zu ihrem Zeitpunkt eintrifft */
.mo-row {
  animation: mo-row-in 0.28s ease-out both;
}

/* ---------- Zustandswechsel ---------- */
@keyframes mo-flash-ok   { 0%, 100% { background: transparent; } 30% { background: rgba(53, 179, 126, 0.22); } }
@keyframes mo-flash-warn { 0%, 100% { background: transparent; } 30% { background: rgba(224, 160, 32, 0.22); } }
@keyframes mo-flash-bad  { 0%, 100% { background: transparent; } 30% { background: rgba(229, 72, 77, 0.22); } }

.mo-flash-ok   { animation: mo-flash-ok 0.9s ease-out; }
.mo-flash-warn { animation: mo-flash-warn 0.9s ease-out; }
.mo-flash-bad  { animation: mo-flash-bad 0.9s ease-out; }

/* Wert hat sich gerade geändert (Badge, Zähler, Statuszeile) */
@keyframes mo-bump {
  0%   { transform: none; }
  35%  { transform: scale(1.14); }
  100% { transform: none; }
}
.mo-bump { animation: mo-bump 0.3s ease-out; }

/* ---------- Laufende Arbeit ---------- */
@keyframes mo-blink { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0.25; } 100% { opacity: 1; } }

/* Cursor/Marker, solange etwas läuft */
.mo-blink { animation: mo-blink 1.1s steps(1, end) infinite; }

@keyframes mo-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(400%); }
}

/* Schmaler Balken, der über eine Fläche wandert, solange ein Vorgang läuft */
.mo-progress {
  position: relative;
  overflow: hidden;
}
.mo-progress::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 25%;
  background: linear-gradient(90deg, transparent, rgba(120, 170, 220, 0.28), transparent);
  animation: mo-sweep 1.15s ease-in-out infinite;
  pointer-events: none;
}

/* ---------- Barrierefreiheit ---------- */
/* Endzustand sofort, keine Bewegung - der Inhalt bleibt vollständig. */
@media (prefers-reduced-motion: reduce) {
  .mo-row,
  .mo-flash-ok,
  .mo-flash-warn,
  .mo-flash-bad,
  .mo-bump,
  .mo-blink {
    animation: none !important;
  }
  .mo-progress::after {
    animation: none !important;
    display: none;
  }
}
