/* /opt/skynet-portal/app/static/css/turbo.css */
/* v0.2.0 — премиум-появление страниц: каскад верхних блоков #main (подъём+фейд), прогресс-бар с бликом */
/* 04.07.2026: spa-enter = фейд main + стаггер детей; градиент/шайн бара; reduced-motion; скелетоны — skeleton.css */
#spaProgress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#spaProgress.is-active { opacity: 1; }
#spaProgressBar {
  position: relative;
  height: 100%;
  width: 0;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright, var(--accent)));
  box-shadow: 0 0 14px var(--accent-glow, var(--accent)), 0 0 4px var(--accent);
  border-radius: 0 3px 3px 0;
}
/* Бегущий белый блик по заполненной части бара */
#spaProgressBar::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: spa-bar-shine 1.1s ease-in-out infinite;
}
@keyframes spa-bar-shine { 100% { transform: translateX(100%); } }
.app-main { will-change: opacity; }
/* Появление страницы после SPA-свопа: сам #main мягко проявляется... */
.spa-enter { animation: spa-enter-anim 0.22s ease; }
@keyframes spa-enter-anim {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}
/* ...а его верхние блоки въезжают каскадом (подъём + фейд, премиум-стаггер).
   fill-mode backwards: до старта своей задержки блок невидим, после конца — обычный.
   transform живёт только 0.34s → не мешает fixed-модалкам внутри блоков. */
.spa-enter > * { animation: spa-child-in 0.34s var(--ease-out-soft, cubic-bezier(0.2, 0.7, 0.3, 1)) backwards; }
.spa-enter > *:nth-child(1) { animation-delay: 0.02s; }
.spa-enter > *:nth-child(2) { animation-delay: 0.06s; }
.spa-enter > *:nth-child(3) { animation-delay: 0.10s; }
.spa-enter > *:nth-child(4) { animation-delay: 0.14s; }
.spa-enter > *:nth-child(5) { animation-delay: 0.18s; }
.spa-enter > *:nth-child(6) { animation-delay: 0.22s; }
.spa-enter > *:nth-child(n+7) { animation-delay: 0.26s; }
@keyframes spa-child-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spa-enter,
  .spa-enter > * { animation: none !important; }
  #spaProgressBar::after { animation: none; }
}
