/* =============================================================================
   Vibe — Animations & Transitions
   ============================================================================= */

/* ---- Page transitions ---- */
@keyframes page-slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes page-slide-back {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter      { animation: page-slide-in   var(--duration-slow) var(--ease-spring) both; }
.page-enter-back { animation: page-slide-back  var(--duration-slow) var(--ease-spring) both; }
.page-enter-fade { animation: page-fade-in     var(--duration-slow) var(--ease-spring) both; }

/* ---- Content reveal ---- */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes reveal-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.reveal-up    { animation: reveal-up    var(--duration-slow) var(--ease-spring) both; }
.reveal-scale { animation: reveal-scale var(--duration-slow) var(--ease-spring) both; }
.reveal-left  { animation: reveal-left  var(--duration-slow) var(--ease-spring) both; }

/* Stagger helpers */
.delay-1 { animation-delay: 50ms; }
.delay-2 { animation-delay: 100ms; }
.delay-3 { animation-delay: 150ms; }
.delay-4 { animation-delay: 200ms; }
.delay-5 { animation-delay: 250ms; }
.delay-6 { animation-delay: 300ms; }

/* ---- Toast ---- */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.92); }
}

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

/* ---- Pulse (active progress step) ---- */
@keyframes pulse-step {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ---- Bounce in (match celebrate, success states) ---- */
@keyframes bounce-in {
  0%   { transform: scale(0);    opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.bounce-in { animation: bounce-in 0.6s var(--ease-spring) both; }

/* ---- Heartbeat (like button) ---- */
@keyframes heartbeat {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.35); }
  40%  { transform: scale(1.15); }
  60%  { transform: scale(1.30); }
  100% { transform: scale(1); }
}
.heartbeat { animation: heartbeat 0.55s var(--ease-spring); }

/* ---- Match confetti burst ---- */
@keyframes confetti-pop {
  0%   { transform: scale(0) rotate(0deg);           opacity: 1; }
  100% { transform: scale(1.8) rotate(var(--rot));   opacity: 0; }
}
.confetti-particle {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confetti-pop 0.8s var(--ease-smooth) forwards;
}

/* ---- Swipe card fly-off ---- */
@keyframes swipe-right {
  to { transform: translateX(150%) rotate(22deg); opacity: 0; }
}
@keyframes swipe-left {
  to { transform: translateX(-150%) rotate(-22deg); opacity: 0; }
}
@keyframes swipe-spring-back {
  to { transform: translateX(0) rotate(0deg); }
}
.swipe-fly-right { animation: swipe-right       0.4s var(--ease-smooth) forwards; }
.swipe-fly-left  { animation: swipe-left        0.4s var(--ease-smooth) forwards; }
.swipe-spring    { animation: swipe-spring-back 0.4s var(--ease-spring) forwards; }

/* ---- Match reveal (card flip) ---- */
@keyframes card-flip {
  0%   { transform: perspective(600px) rotateY(0deg); }
  50%  { transform: perspective(600px) rotateY(90deg); }
  100% { transform: perspective(600px) rotateY(0deg); }
}
.card-flip { animation: card-flip 0.6s var(--ease-smooth); }

/* ---- Notification dot pulse ---- */
@keyframes dot-pulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0   rgba(247, 37, 133, 0.5); }
  50%       { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(247, 37, 133, 0); }
}
.dot-pulse { animation: dot-pulse 2s ease-in-out infinite; }

/* ---- Floating action button ---- */
@keyframes fab-in {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}
.fab-in { animation: fab-in 0.4s var(--ease-spring) both; }

/* ---- Spin (loading) ---- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 0.8s linear infinite; }

/* ---- Scale pulse (logo, brand marks) ---- */
@keyframes scale-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}
.scale-pulse { animation: scale-pulse 3s ease-in-out infinite; }

/* ---- Gradient shift (hero sections) ---- */
@keyframes gradient-shift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
.gradient-animated {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

/* ---- Bottom nav item tap ---- */
@keyframes nav-tap {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.nav-tap { animation: nav-tap 0.2s var(--ease-spring); }

/* ---- Message bubble pop in ---- */
@keyframes bubble-in {
  from { transform: scale(0.7) translateY(8px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);   opacity: 1; }
}
.bubble-in { animation: bubble-in 0.2s var(--ease-spring) both; }

/* ---- Number count up ---- */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.count-up { animation: count-up 0.4s var(--ease-spring) both; }

/* =============================================================================
   NEW — Neon / Glow / Party Animations
   ============================================================================= */

/* ---- Neon glow pulse — wrap any element ---- */
@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.40),
                0 0 24px rgba(139, 92, 246, 0.25),
                0 0 48px rgba(139, 92, 246, 0.10);
  }
  50% {
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.75),
                0 0 40px rgba(139, 92, 246, 0.45),
                0 0 80px rgba(139, 92, 246, 0.20);
  }
}
.neon-pulse { animation: neon-pulse 2.5s ease-in-out infinite; }

@keyframes neon-pulse-pink {
  0%, 100% {
    box-shadow: 0 0 10px rgba(247, 37, 133, 0.40),
                0 0 24px rgba(247, 37, 133, 0.25);
  }
  50% {
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.80),
                0 0 45px rgba(247, 37, 133, 0.45);
  }
}
.neon-pulse-pink { animation: neon-pulse-pink 2.5s ease-in-out infinite; }

/* ---- Gentle float (hero icons, match avatars) ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
.float { animation: float 4s ease-in-out infinite; }
.float-slow { animation: float 6s ease-in-out infinite; }

/* ---- Rotating gradient border (card-glow anim variant) ---- */
@keyframes border-spin {
  to { --border-angle: 360deg; }
}
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.border-spin {
  background:
    linear-gradient(var(--color-bg-3), var(--color-bg-3)) padding-box,
    conic-gradient(from var(--border-angle),
      #8B5CF6, #F72585, #00D4FF, #FF6B35, #8B5CF6
    ) border-box;
  border: 2px solid transparent;
  animation: border-spin 4s linear infinite;
}

/* ---- Glow text (hero headings) ---- */
@keyframes glow-text {
  0%, 100% { text-shadow: 0 0 12px rgba(139, 92, 246, 0.60), 0 0 30px rgba(139, 92, 246, 0.30); }
  50%       { text-shadow: 0 0 20px rgba(139, 92, 246, 0.90), 0 0 55px rgba(139, 92, 246, 0.50), 0 0 90px rgba(247, 37, 133, 0.20); }
}
.glow-text { animation: glow-text 3s ease-in-out infinite; }

/* ---- Rising particle (background decor) ---- */
@keyframes particle-rise {
  0%   { transform: translateY(0)   scale(1);    opacity: 0.7; }
  100% { transform: translateY(-80px) scale(0.4); opacity: 0; }
}
.particle-rise { animation: particle-rise 3s ease-out forwards; }

/* ---- Shimmer sweep (CTA buttons, hero sections) ---- */
@keyframes shimmer-sweep {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(250%)  skewX(-15deg); }
}
.shimmer-sweep {
  position: relative;
  overflow: hidden;
}
.shimmer-sweep::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  animation: shimmer-sweep 2.5s ease-in-out infinite;
  pointer-events: none;
}

/* ---- Pop in (notification badges, match bubbles) ---- */
@keyframes pop-in {
  0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
  70%  { transform: scale(1.18) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
.pop-in { animation: pop-in 0.45s var(--ease-spring) both; }

/* ---- Wobble (error shake) ---- */
@keyframes wobble {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-8px) rotate(-2deg); }
  40%  { transform: translateX(8px)  rotate(2deg); }
  60%  { transform: translateX(-5px) rotate(-1deg); }
  80%  { transform: translateX(5px)  rotate(1deg); }
  100% { transform: translateX(0); }
}
.wobble { animation: wobble 0.55s var(--ease-smooth); }

/* ---- Match reveal — full-screen zoom ---- */
@keyframes match-reveal {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.match-reveal { animation: match-reveal 0.7s var(--ease-spring) both; }

/* ---- Reduced motion support ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:       0.01ms !important;
  }
}
