/* Avolié Bewegung: gemeinsame Schicht für App, Admin und Comb.
   Wirkt nur mit html.motion (gesetzt von boot.js, nicht bei "Bewegung reduzieren"). Ohne sie bleibt alles ruhig und vollständig lesbar. */
:root {
  --mo-ease: cubic-bezier(.22, 1, .36, 1);
  --mo-spring: cubic-bezier(.34, 1.56, .64, 1);
  --mo-fast: .18s; --mo-med: .38s; --mo-slow: .6s;
  /* gemeinsame Maße */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --sh-1: 0 1px 2px rgba(23, 32, 43, .06), 0 2px 8px -4px rgba(23, 32, 43, .10);
  --sh-2: 0 10px 26px -14px rgba(23, 32, 43, .38);
  --sh-3: 0 24px 60px -24px rgba(23, 32, 43, .45);
  --mo-sk-a: color-mix(in srgb, var(--ink, #17202b) 7%, transparent);
  --mo-sk-b: color-mix(in srgb, var(--ink, #17202b) 15%, transparent);
}

/* 1. Einblenden: neue Karten, Zeilen und Kacheln steigen gestaffelt auf */
@keyframes mo-rise { from { opacity: 0; transform: translateY(12px) scale(.992); } to { opacity: 1; transform: none; } }
.motion .mo-in { animation: mo-rise var(--mo-med) var(--mo-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* 2. Ansichtswechsel: die neue Ansicht blendet sanft ein */
@keyframes mo-view { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.motion .mo-view > * { animation: mo-view .42s var(--mo-ease) both; }

/* 3. Ladezustand: statt "Lädt …" ruhige Platzhalter mit Schimmer */
@keyframes mo-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.motion .mo-skel {
  display: block; min-height: 5em; color: transparent !important; user-select: none; pointer-events: none;
  background: linear-gradient(100deg, var(--mo-sk-a) 30%, var(--mo-sk-b) 50%, var(--mo-sk-a) 70%) 100% 0 / 250% 100%;
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 .95em, transparent .95em 1.75em);
  mask-image: repeating-linear-gradient(to bottom, #000 0 .95em, transparent .95em 1.75em);
  border-radius: 8px; animation: mo-shimmer 1.3s linear infinite;
}

/* 4. Klick-Gefühl: Knöpfe federn, Karten heben sich leicht */
.motion .btn, .motion button.chip, .motion .themebtn, .motion .langsw button { transition: transform var(--mo-fast) var(--mo-spring), background-color .2s, color .2s, border-color .2s, box-shadow .2s; }
.motion .btn:hover:not(:disabled) { transform: translateY(-1px); }
.motion .btn:active:not(:disabled), .motion .themebtn:active { transform: scale(.96); }
.motion a.card, .motion .card--row, .motion .sc-row, .motion .inc-row, .motion .tm-row, .motion .sp-item { transition: transform var(--mo-med) var(--mo-ease), box-shadow var(--mo-med) var(--mo-ease), border-color .2s, background-color .2s; }
.motion a.card:hover, .motion .card--row:hover, .motion .sc-row:hover, .motion .inc-row:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

/* 5. Hinweise, Menüs und Fenster */
@keyframes mo-toast { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.motion .toast:not([hidden]) { animation: mo-toast .34s var(--mo-spring) both; }
@keyframes mo-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
.motion [role="dialog"]:not([hidden]), .motion .modal:not([hidden]), .motion .popover:not([hidden]), .motion [role="menu"]:not([hidden]) { animation: mo-pop .26s var(--mo-ease) both; }
@keyframes mo-fade { from { opacity: 0; } to { opacity: 1; } }
.motion .scrim:not([hidden]), .motion .overlay:not([hidden]), .motion .modal-bg:not([hidden]) { animation: mo-fade .24s ease both; }
.motion details > :not(summary) { animation: mo-view .3s var(--mo-ease) both; }

/* 6. Zahlen und Live-Werte: kurzes Aufleuchten bei Änderung */
@keyframes mo-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brass, #8a6420) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.motion .mo-flash { animation: mo-flash .9s ease-out; border-radius: 999px; }
.motion [data-count-up] { font-variant-numeric: tabular-nums; }

/* 7. Leere Zustände: ruhiger gestrichelter Ring über dem Text */
.empty, .ib-empty, .inc-empty, .sc-empty, .fx-empty { position: relative; text-align: center; }
.empty::before, .ib-empty::before, .inc-empty::before, .sc-empty::before, .fx-empty::before {
  content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--brass, #8a6420) 55%, transparent);
}
@keyframes mo-breathe { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
.motion .empty::before, .motion .ib-empty::before, .motion .inc-empty::before, .motion .sc-empty::before, .motion .fx-empty::before { animation: mo-breathe 3.2s ease-in-out infinite; }

/* Barrierefreiheit: bei "Bewegung reduzieren" ruht alles */
@media (prefers-reduced-motion: reduce) {
  .mo-in, .mo-view > *, .mo-skel, .mo-flash, .toast, [role="dialog"], .empty::before, .ib-empty::before, .inc-empty::before, .sc-empty::before, .fx-empty::before { animation: none !important; }
}

html[data-theme="dark"] {
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -4px rgba(0, 0, 0, .5);
  --sh-2: 0 12px 28px -14px rgba(0, 0, 0, .7);
  --sh-3: 0 24px 60px -24px rgba(0, 0, 0, .8);
}

/* Leere Zustände: eigenes Symbol je Bereich (Maske, Farbe folgt dem Akzent) */
.empty::before, .ib-empty::before, .inc-empty::before, .sc-empty::before, .fx-empty::before {
  width: 48px; height: 48px; border: 0; border-radius: 0;
  background: color-mix(in srgb, var(--brass, #8a6420) 70%, transparent);
  -webkit-mask: var(--mo-ico) center / contain no-repeat; mask: var(--mo-ico) center / contain no-repeat;
  --mo-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='24' cy='24' r='16'/%3E%3Cpath d='M16.5 24.5l5 5 10-11'/%3E%3C/svg%3E");
}
.ib-empty::before, .sc-empty::before { --mo-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 26l6-14h24l6 14v10a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2z'/%3E%3Cpath d='M6 26h10l2 4h12l2-4h10'/%3E%3C/svg%3E"); }
.fx-empty::before { --mo-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13a2 2 0 0 1 2-2h10l4 5h20a2 2 0 0 1 2 2v19a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
