/* ==========================================================================
   Iteas Hub · motion.css
   All keyframes live here, globally. Isolated .razor.css files only
   reference them by name (Blazor would rename keyframes defined inside an
   isolated file, so shared ones must stay global).
   ========================================================================== */

@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes pulse     { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut   { to { opacity: 0; } }
@keyframes slideup   { from { opacity: 0; transform: translateY(0.714rem) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dropOut   { to { opacity: 0; transform: translateY(0.571rem) scale(.98); } }
@keyframes slideright{ from { opacity: .4; transform: translateX(2.143rem); } to { opacity: 1; transform: none; } }
@keyframes slideOutR { to { opacity: 0; transform: translateX(2.857rem); } }
@keyframes toastOut  { to { opacity: 0; transform: translateX(1.143rem); } }
@keyframes rise      { from { opacity: 0; transform: translateY(0.571rem); } to { opacity: 1; transform: none; } }
@keyframes swapR     { from { opacity: 0; transform: translateX(1.286rem); } to { opacity: 1; transform: none; } }
@keyframes swapL     { from { opacity: 0; transform: translateX(-1.286rem); } to { opacity: 1; transform: none; } }
@keyframes dotfade   { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes breathe   { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1); } }
@keyframes loaderOut { to { opacity: 0; visibility: hidden; } }

/* ---------- content swaps (tabs, filters) ---------- */
/* Put one of these on the container whose content changes and give it a
   new @key so Blazor re-creates the element and the animation replays. */
.swap   { animation: fade .22s ease both; }
.swap-r { animation: swapR .26s var(--ease) both; }   /* moved to a tab on the right */
.swap-l { animation: swapL .26s var(--ease) both; }   /* moved to a tab on the left */
/* repo fix: no fill after the end, or the kept transform traps fixed menus and scrims inside the panel */
.swap, .swap-r, .swap-l { animation-fill-mode: backwards; }

/* ---------- first load cascade ---------- */
/* MainLayout sets .boot on the shell for ~1.4 s after the first render. */
.boot .page > * { animation: rise .38s var(--ease) both; }
.boot .page > *:nth-child(1) { animation-delay: .46s; }
.boot .page > *:nth-child(2) { animation-delay: .5s; }
.boot .page > *:nth-child(3) { animation-delay: .54s; }
.boot .page > *:nth-child(4) { animation-delay: .58s; }
.boot .page > *:nth-child(n+5) { animation-delay: .62s; }
.boot .page tbody tr { animation: fade .3s ease both; animation-delay: .6s; }
.boot .page tbody tr:nth-child(2) { animation-delay: .62s; }
.boot .page tbody tr:nth-child(3) { animation-delay: .64s; }
.boot .page tbody tr:nth-child(4) { animation-delay: .66s; }
.boot .page tbody tr:nth-child(5) { animation-delay: .68s; }
.boot .page tbody tr:nth-child(6) { animation-delay: .7s; }
.boot .page tbody tr:nth-child(7) { animation-delay: .72s; }
.boot .page tbody tr:nth-child(8) { animation-delay: .74s; }
.boot .page tbody tr:nth-child(n+9) { animation-delay: .76s; }

/* ---------- page switch ---------- */
/* js/shell.js sets .nav on the shell for 1.2 s after each page switch. Content
   inserted in that window rises in, and table rows fade in, also when the data arrives after the switch.
   Shorter than .boot: page switches are frequent. Fill backwards, so no transform
   stays after the end and traps fixed menus. */
.nav .page > * { animation: rise .22s var(--ease) backwards; }
.nav .page > *:nth-child(2) { animation-delay: .03s; }
.nav .page > *:nth-child(3) { animation-delay: .06s; }
.nav .page > *:nth-child(4) { animation-delay: .09s; }
.nav .page > *:nth-child(n+5) { animation-delay: .12s; }
.nav .page tbody tr { animation: fade .2s ease backwards; animation-delay: .08s; }
.nav .page tbody tr:nth-child(2) { animation-delay: .095s; }
.nav .page tbody tr:nth-child(3) { animation-delay: .11s; }
.nav .page tbody tr:nth-child(4) { animation-delay: .125s; }
.nav .page tbody tr:nth-child(5) { animation-delay: .14s; }
.nav .page tbody tr:nth-child(6) { animation-delay: .155s; }
.nav .page tbody tr:nth-child(n+7) { animation-delay: .17s; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
