/* ==========================================================================
   CLEANCRED — SURREAL SILICONE & KINETIC GAMIFICATION ANIMATIONS
   Soft Matte Silicone // CleanCred UI Design System
   ========================================================================== */

/* Fade & Slide Transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bouncy Modal Pop In — silicone squish */
@keyframes popInBounce {
  0% {
    opacity: 0;
    transform: scale(0.75) translateY(30px);
  }
  70% {
    opacity: 1;
    transform: scale(1.04) translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-pop-in {
  animation: popInBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Legacy alias */
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Pulse for status indicators */
@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.15);
  }
}

.animate-pulse {
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================================================
   FLOATING SURREAL BLOBS — abstract silicone shapes behind the canvas
   ========================================================================== */
@keyframes surrealBlobFloat1 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  33%      { transform: translate3d(40px, -60px, 0) rotate(25deg) scale(1.08); }
  66%      { transform: translate3d(-35px, -30px, 0) rotate(-20deg) scale(0.94); }
}

@keyframes surrealBlobFloat2 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  40%      { transform: translate3d(-50px, 45px, 0) rotate(-35deg) scale(1.12); }
  75%      { transform: translate3d(35px, 25px, 0) rotate(20deg) scale(0.96); }
}

@keyframes surrealBlobFloat3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(45px, 40px, 0) scale(1.15); }
}

.surreal-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
}

.surreal-blob-green {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #10B981 0%, rgba(16, 185, 129, 0.18) 70%, transparent 100%);
  top: 4%;
  left: -9%;
  animation: surrealBlobFloat1 24s ease-in-out infinite;
}

.surreal-blob-cyan {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, #06B6D4 0%, rgba(6, 182, 212, 0.18) 70%, transparent 100%);
  top: 42%;
  right: -11%;
  animation: surrealBlobFloat2 28s ease-in-out infinite;
}

.surreal-blob-orange {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #F97316 0%, rgba(249, 115, 22, 0.16) 70%, transparent 100%);
  bottom: 4%;
  left: 18%;
  animation: surrealBlobFloat3 22s ease-in-out infinite;
}

/* ==========================================================================
   SCANNER LASER SWEEP (AI verification wells)
   ========================================================================== */
@keyframes scanLaserSweep {
  0%   { top: 5%; opacity: 0.8; }
  50%  { top: 92%; opacity: 1; }
  100% { top: 5%; opacity: 0.8; }
}

.scan-laser-beam {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10B981 30%, #34D399 50%, #10B981 70%, transparent);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.9);
  border-radius: var(--radius-full);
  pointer-events: none;
  animation: scanLaserSweep 2.2s ease-in-out infinite;
}

/* Bouncing loader dots */
@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

.bounce-dot-1 { animation: bounceDot 1.4s infinite ease-in-out both; animation-delay: -0.32s; }
.bounce-dot-2 { animation: bounceDot 1.4s infinite ease-in-out both; animation-delay: -0.16s; }
.bounce-dot-3 { animation: bounceDot 1.4s infinite ease-in-out both; }

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================================================
   RESPECTING USER MOTION PREFERENCES (Vestibular Safety)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .surreal-blob,
  .animate-pulse,
  .scan-laser-beam,
  .bounce-dot-1,
  .bounce-dot-2,
  .bounce-dot-3 {
    animation: none !important;
  }

  .scan-laser-beam {
    opacity: 0.6;
  }
}
