/* ═══════════════════════════════════════════════════════════
   SignUAE — Page & Element Animations
   Lightweight, performant entrance animations
   ═══════════════════════════════════════════════════════════ */

/* ── Keyframes ───────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Page entrance (opacity only — no transform conflict) ── */

.page-content {
  animation: fadeIn 0.7s ease-out both;
}

/* ── Element entrance classes ────────────────────────────── */

.anim-fade-in {
  animation: fadeIn 1s ease-out both;
}

.anim-slide-up {
  animation: fadeSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-slide-down {
  animation: fadeSlideDown 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-slide-right {
  animation: fadeSlideRight 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-scale-in {
  animation: scaleIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Stagger delays ──────────────────────────────────────── */

.anim-delay-1 { animation-delay: 0.12s; }
.anim-delay-2 { animation-delay: 0.24s; }
.anim-delay-3 { animation-delay: 0.36s; }
.anim-delay-4 { animation-delay: 0.48s; }
.anim-delay-5 { animation-delay: 0.60s; }
.anim-delay-6 { animation-delay: 0.72s; }
.anim-delay-7 { animation-delay: 0.84s; }
.anim-delay-8 { animation-delay: 0.96s; }

/* ── Auto-stagger children ───────────────────────────────── */

.anim-stagger > * {
  animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-stagger > *:nth-child(1)  { animation-delay: 0.08s; }
.anim-stagger > *:nth-child(2)  { animation-delay: 0.18s; }
.anim-stagger > *:nth-child(3)  { animation-delay: 0.28s; }
.anim-stagger > *:nth-child(4)  { animation-delay: 0.38s; }
.anim-stagger > *:nth-child(5)  { animation-delay: 0.48s; }
.anim-stagger > *:nth-child(6)  { animation-delay: 0.58s; }
.anim-stagger > *:nth-child(7)  { animation-delay: 0.68s; }
.anim-stagger > *:nth-child(8)  { animation-delay: 0.78s; }
.anim-stagger > *:nth-child(9)  { animation-delay: 0.88s; }
.anim-stagger > *:nth-child(10) { animation-delay: 0.98s; }

/* ── Card hover lift ─────────────────────────────────────── */

.anim-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.anim-card:hover {
  transform: translateY(-2px);
}

/* ── Login spinner ──────────────────────────────────────── */

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-spinner {
  animation: spin 0.7s linear infinite;
}

/* ── Safe area padding for iOS (notch / home indicator) ──── */

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Mobile table → card layout ─────────────────────────── */

@media (max-width: 767px) {
  .mobile-cards table,
  .mobile-cards thead { display: none; }

  .mobile-cards .mobile-card-list { display: block; }
}

@media (min-width: 768px) {
  .mobile-cards .mobile-card-list { display: none; }
}

/* ── Respect reduced motion preference ───────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
