/* ============================================================
   NexaPosting Mini App — Animations
   ============================================================ */

/* ─── Page Transitions ────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* ─── Page Enter Animation ────────────────────────────────── */
.page.active .page-content > *,
.page.active .page-header {
  animation: fadeInUp 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.page.active .page-content > *:nth-child(1) { animation-delay: 0ms; }
.page.active .page-content > *:nth-child(2) { animation-delay: 40ms; }
.page.active .page-content > *:nth-child(3) { animation-delay: 80ms; }
.page.active .page-content > *:nth-child(4) { animation-delay: 120ms; }
.page.active .page-content > *:nth-child(5) { animation-delay: 160ms; }
.page.active .page-content > *:nth-child(n+6) { animation-delay: 200ms; }

/* ─── Skeleton Loading ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #F0F0F3 25%,
    #E8E8EC 50%,
    #F0F0F3 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 8px;
}

.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

.skeleton-card {
  height: 80px;
  border-radius: 18px;
  margin-bottom: 10px;
}

.skeleton-stat {
  height: 90px;
  border-radius: 18px;
}

.skeleton-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

/* ─── Pulse dot ───────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

/* ─── Button ripple ───────────────────────────────────────── */
@keyframes ripple {
  to {
    opacity: 0;
    transform: scale(3);
  }
}

.btn::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  opacity: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

.btn:active::after {
  animation: ripple 0.4s ease;
}

/* ─── Onboarding ──────────────────────────────────────────── */
@keyframes onboardingFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes onboardingEmojiFloat {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.onboarding-emoji {
  animation: onboardingEmojiFloat 3s ease-in-out infinite;
}

/* ─── Card hover lift ─────────────────────────────────────── */
.card-hover {
  transition: transform var(--transition), box-shadow var(--transition);
}

.card-hover:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

/* ─── Spin animation ──────────────────────────────────────── */
.spin {
  animation: spin 0.8s linear infinite;
}

/* ─── Toast slide ─────────────────────────────────────────── */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
}

/* ─── Number count-up ─────────────────────────────────────── */
.count-up {
  display: inline-block;
  transition: all 0.4s ease;
}

/* ─── Stagger for list items ──────────────────────────────── */
.stagger-item {
  opacity: 0;
  animation: fadeInUp 0.24s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 50ms; }
.stagger-item:nth-child(3) { animation-delay: 100ms; }
.stagger-item:nth-child(4) { animation-delay: 150ms; }
.stagger-item:nth-child(5) { animation-delay: 200ms; }
.stagger-item:nth-child(n+6) { animation-delay: 250ms; }
