/* ============================================================
   Wiwo Neo — Motion pack (cheap, compositor-friendly).
   Only transform/opacity + short color transitions. Everything
   is gated by prefers-reduced-motion. No infinite always-on
   animations (that was the Mac lag pattern).
   ============================================================ */

/* ---- 1. Panel/card entrance (JS adds .wiwo-will-animate, then .is-in) ----
   Initial hidden state is applied ONLY by JS, so if JS fails the content
   stays fully visible. */
@media (prefers-reduced-motion: no-preference) {
  .wiwo-will-animate {
    opacity: 0;
    transform: translateY(12px) scale(.995);
  }
  .wiwo-will-animate.is-in {
    opacity: 1;
    transform: none;
    transition: opacity .5s var(--ease-expressive, cubic-bezier(.2, 0, 0, 1)),
                transform .5s var(--ease-expressive, cubic-bezier(.2, 0, 0, 1));
  }
}

/* ---- 2. Button micro-interaction (universal, tiny) ---- */
.btn {
  transition: transform var(--motion-fast, 160ms) var(--ease-expressive, cubic-bezier(.2, 0, 0, 1)),
              box-shadow var(--motion-fast, 160ms) var(--ease-expressive, cubic-bezier(.2, 0, 0, 1)),
              background-color var(--motion-fast, 160ms) ease,
              border-color var(--motion-fast, 160ms) ease,
              color var(--motion-fast, 160ms) ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary:hover, .btn-success:hover, .btn-info:hover { box-shadow: var(--shadow-1); }

/* ---- 3. Theme crossfade (class toggled briefly by wiwoToggleTheme) ---- */
@media (prefers-reduced-motion: no-preference) {
  html.wiwo-theme-anim,
  html.wiwo-theme-anim body,
  html.wiwo-theme-anim #wrapper,
  html.wiwo-theme-anim .content,
  html.wiwo-theme-anim .panel_s,
  html.wiwo-theme-anim .panel,
  html.wiwo-theme-anim #header,
  html.wiwo-theme-anim #menu.sidebar,
  html.wiwo-theme-anim .table,
  html.wiwo-theme-anim .table td,
  html.wiwo-theme-anim .table th,
  html.wiwo-theme-anim .top_stats_wrapper,
  html.wiwo-theme-anim .btn,
  html.wiwo-theme-anim .form-control,
  html.wiwo-theme-anim .dropdown-menu {
    transition: background-color .38s ease, color .38s ease, border-color .38s ease !important;
  }
}

/* ---- 4. Skeleton shimmer (loading placeholders). Add .wiwo-skeleton to a
   block to show a shimmering placeholder while its data loads. ---- */
.wiwo-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2) !important;
  border-radius: var(--shape-xs, 6px);
  color: transparent !important;
  border-color: transparent !important;
}
.wiwo-skeleton * { visibility: hidden !important; }
.wiwo-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 12%, transparent), transparent);
  animation: wiwo-skeleton-sweep 1.3s var(--ease-expressive, cubic-bezier(.2, 0, 0, 1)) infinite;
}
@keyframes wiwo-skeleton-sweep { to { transform: translateX(100%); } }

/* ---- 5. Reduced motion: hard off ---- */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none !important; }
  .btn:hover, .btn:active { transform: none !important; }
  .wiwo-will-animate { opacity: 1 !important; transform: none !important; }
  .wiwo-skeleton::after { animation: none !important; }
}
