/* Dynamic Animated Frames & Purikura Motion Engine for Human ID Web App */

@keyframes prismSweep {
  0% {
    background-position: 0% 50%, 0% 0%;
    filter: hue-rotate(0deg);
  }
  50% {
    background-position: 100% 50%, 100% 100%;
    filter: hue-rotate(45deg);
  }
  100% {
    background-position: 0% 50%, 0% 0%;
    filter: hue-rotate(0deg);
  }
}

@keyframes goldShine {
  0% {
    background-position: -200% 0%;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2), inset 0 0 15px rgba(255, 215, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 25px rgba(255, 215, 0, 0.3);
  }
  100% {
    background-position: 200% 0%;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2), inset 0 0 15px rgba(255, 215, 0, 0.1);
  }
}

@keyframes kawaiiPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(255, 143, 207, 0.4));
  }
  50% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 16px rgba(255, 143, 207, 0.8));
  }
}

@keyframes natureBreath {
  0%, 100% {
    opacity: 0.7;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
}

@keyframes laserScan {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  20% { opacity: 0.8; }
  80% { opacity: 0.8; }
  100% {
    transform: translateY(200%);
    opacity: 0;
  }
}

@keyframes neonFlicker {
  0%, 100% {
    box-shadow: 0 0 15px #ff2ca8, inset 0 0 15px #2df7df, 0 0 35px rgba(45, 247, 223, 0.5);
  }
  30% {
    box-shadow: 0 0 25px #ff2ca8, inset 0 0 22px #2df7df, 0 0 50px rgba(255, 44, 168, 0.8);
  }
  32% {
    box-shadow: 0 0 5px #ff2ca8, inset 0 0 5px #2df7df;
  }
  34% {
    box-shadow: 0 0 30px #ff2ca8, inset 0 0 25px #2df7df, 0 0 60px rgba(45, 247, 223, 0.9);
  }
}

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

/* Active motion styles on card & dynamic frame engine */
.flash-card[data-motion="active"] {
  animation: cardBreathingAura 4.5s ease-in-out infinite;
}

@keyframes cardBreathingAura {
  0%, 100% {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 22px rgba(56, 189, 248, 0.25);
  }
  50% {
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.72), 0 0 38px rgba(56, 189, 248, 0.55);
  }
}

.flash-card[data-motion="active"] .card-holographic-rim {
  opacity: 0.95;
  animation: rimSweep 5s linear infinite;
}

.flash-card[data-motion="off"] .card-holographic-rim {
  opacity: 0.25;
  animation: none;
}

.flash-card[data-motion="off"] .burst-elem {
  animation-play-state: paused !important;
  opacity: 0.12 !important;
  transform: scale(0.92) !important;
  filter: grayscale(0.8) !important;
  transition: all 0.4s ease;
}

/* Style-specific motion animations */
.flash-card[data-motion="active"][data-style="aurora-prism"] .card-front::after {
  animation: prismSweep 6s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="golden-memory"] .card-front::after {
  animation: goldShine 5s linear infinite;
}
.flash-card[data-motion="active"][data-style="soft-pop"] .card-front::before {
  animation: kawaiiPulse 3s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="nature-aura"] .card-front::after {
  animation: natureBreath 4.5s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="neon-creator"] .card-front {
  animation: neonFlicker 3.5s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="obsidian-titanium"] .card-front::after {
  animation: titaniumScan 5s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="cyber-matrix"] .card-front::after {
  animation: matrixPulse 2.8s steps(4, jump-none) infinite;
}
.flash-card[data-motion="active"][data-style="deep-abyss"] .card-front::after {
  animation: abyssSonar 5.5s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}
.flash-card[data-motion="active"][data-style="carbon-stealth"] .card-front::after {
  animation: tacticalReticle 3.2s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="industrial-steel"] .card-front::after {
  animation: industrialStrobe 4s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="quantum-cosmos"] .card-front::after {
  animation: quantumOrbit 6.5s linear infinite;
}
.flash-card[data-motion="active"][data-style="nordic-monolith"] .card-front::after {
  animation: monolithBeam 6s ease-in-out infinite;
}
.flash-card[data-motion="active"][data-style="molten-core"] .card-front::after {
  animation: moltenFlare 4s ease-in-out infinite;
}

@keyframes titaniumScan {
  0%, 100% { box-shadow: 0 0 10px rgba(148, 163, 184, 0.2); border-color: rgba(148, 163, 184, 0.4); }
  50% { box-shadow: 0 0 24px rgba(226, 232, 240, 0.6); border-color: rgba(248, 250, 252, 0.85); }
}

@keyframes matrixPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 102, 0.3); }
  50% { box-shadow: 0 0 22px rgba(0, 255, 102, 0.75), inset 0 0 12px rgba(0, 255, 102, 0.3); }
}

@keyframes abyssSonar {
  0% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.2); }
  50% { box-shadow: 0 0 28px rgba(2, 132, 199, 0.6), inset 0 0 14px rgba(56, 189, 248, 0.3); }
  100% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.2); }
}

@keyframes tacticalReticle {
  0%, 100% { border-color: rgba(239, 68, 68, 0.35); box-shadow: 0 0 8px rgba(239, 68, 68, 0.2); }
  50% { border-color: rgba(239, 68, 68, 0.85); box-shadow: 0 0 22px rgba(239, 68, 68, 0.6); }
}

@keyframes industrialStrobe {
  0%, 100% { box-shadow: 0 0 8px rgba(234, 179, 8, 0.25); }
  50% { box-shadow: 0 0 20px rgba(234, 179, 8, 0.65), inset 0 0 10px rgba(234, 179, 8, 0.2); }
}

@keyframes quantumOrbit {
  0% { box-shadow: 0 0 12px rgba(139, 92, 246, 0.3); filter: hue-rotate(0deg); }
  50% { box-shadow: 0 0 28px rgba(192, 132, 252, 0.65); filter: hue-rotate(30deg); }
  100% { box-shadow: 0 0 12px rgba(139, 92, 246, 0.3); filter: hue-rotate(0deg); }
}

@keyframes monolithBeam {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; box-shadow: 0 0 16px rgba(243, 244, 246, 0.4); }
}

@keyframes moltenFlare {
  0%, 100% { box-shadow: 0 0 10px rgba(234, 88, 12, 0.3); }
  50% { box-shadow: 0 0 30px rgba(249, 115, 22, 0.75), inset 0 0 14px rgba(251, 191, 36, 0.35); }
}

/* Animated video overlay frame */
.card-video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 6;
  mix-blend-mode: screen;
  opacity: 0.78;
  border-radius: inherit;
  transition: opacity 0.35s ease;
}

.flash-card:not([data-video-frame="on"]) .card-video-frame {
  display: none !important;
}

.flash-card[data-video-frame="on"] .card-video-frame {
  display: block !important;
}

.flash-card[data-video-frame="on"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 8;
  box-shadow: inset 0 0 30px rgba(56, 189, 248, 0.35);
  animation: videoFrameAtmosphere 3s ease-in-out infinite;
}

@keyframes videoFrameAtmosphere {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

