/**
 * ====================================================================
 * SCRAPBOOK & INTERACTIVE ANIMATIONS
 * ====================================================================
 */

/* Gentle floating / breathing for scrapbook badges */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(1deg);
  }
}

/* Subtle sunflower sway in breeze */
@keyframes sunflowerSway {
  0%, 100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes sunflowerBob {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(3deg);
  }
}

/* Countdown tick pulse */
@keyframes digitPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* Boyfriend excitement shaking panic */
@keyframes panicShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-4px) rotate(-1.5deg); }
  40% { transform: translateX(4px) rotate(1.5deg); }
  60% { transform: translateX(-3px) rotate(-1deg); }
  80% { transform: translateX(3px) rotate(1deg); }
}

/* Envelope unfolding animations */
@keyframes waxPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25) rotate(15deg);
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes letterSlideOut {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Candle flame flicker */
@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1) rotate(-1deg);
    opacity: 0.95;
  }
  25% {
    transform: scale(1.08, 0.92) rotate(2deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.95, 1.05) rotate(-2deg);
    opacity: 0.9;
  }
  75% {
    transform: scale(1.04, 0.96) rotate(1deg);
    opacity: 1;
  }
}

/* Candle smoke rising when blown out */
@keyframes smokeRise {
  0% {
    transform: translateY(0) scale(0.8);
  }
  100% {
    transform: translateY(-40px) scale(2.2);
    opacity: 0;
  }
}

/* Toast popup notification */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ====================================================================
   CUTE ROAMING CATS ANIMATIONS
==================================================================== */

/* Wandering Cat Patrol */
@keyframes catPatrol {
  0% {
    left: -40px;
    transform: scaleX(1);
  }
  45% {
    left: calc(100% - 40px);
    transform: scaleX(1);
  }
  50% {
    left: calc(100% - 40px);
    transform: scaleX(-1);
  }
  95% {
    left: -40px;
    transform: scaleX(-1);
  }
  100% {
    left: -40px;
    transform: scaleX(1);
  }
}

/* Kitty trotting to and fro inside the Why So Excited card */
@keyframes heroCatToAndFro {
  0% {
    left: 4px;
    transform: scaleX(1);
  }
  48% {
    left: calc(100% - 38px);
    transform: scaleX(1);
  }
  50% {
    left: calc(100% - 38px);
    transform: scaleX(-1);
  }
  98% {
    left: 4px;
    transform: scaleX(-1);
  }
  100% {
    left: 4px;
    transform: scaleX(1);
  }
}

/* Kitty paws bobbing up & down while trotting */
@keyframes catTrotBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

/* Boku the hero cat gentle tail wag */
@keyframes bokuTailWag {
  0%, 100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(14deg);
  }
  70% {
    transform: rotate(-8deg);
  }
}

/* Cat sleeping breathing */
@keyframes catBreathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05, 0.95);
  }
}

/* Cat joyful bounce */
@keyframes catJoyHop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-16px) scale(1.18) rotate(-4deg); }
  70% { transform: translateY(2px) scale(0.95); }
  100% { transform: translateY(0) scale(1); }
}

/* Boku angel glow pulse */
@keyframes bokuGlow {
  0%, 100% {
    filter: drop-shadow(0 2px 6px rgba(245, 146, 62, 0.4));
  }
  50% {
    filter: drop-shadow(0 4px 12px rgba(247, 179, 43, 0.7));
  }
}

/* Ambient soft golden glow on wax seal */
@keyframes waxAmbientGlow {
  0% {
    filter: drop-shadow(0 0 8px rgba(247, 179, 43, 0.4)) drop-shadow(0 4px 10px rgba(186, 119, 16, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(247, 179, 43, 0.75)) drop-shadow(0 6px 14px rgba(217, 130, 43, 0.45));
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(247, 179, 43, 0.4)) drop-shadow(0 4px 10px rgba(186, 119, 16, 0.35));
  }
}

/* Envelope Flap 3D Opening */
@keyframes flapOpen3D {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(180deg);
  }
}

/* Envelope Flap 3D Closing */
@keyframes flapClose3D {
  0% {
    transform: rotateX(180deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

/* Wax Seal Pop Out (when unsealing) */
@keyframes waxPopOut {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  35% {
    transform: scale(1.22) rotate(-6deg);
    filter: drop-shadow(0 0 16px rgba(247, 179, 43, 0.9));
  }
  100% {
    transform: scale(0.3) translateY(-25px);
    opacity: 0;
  }
}

/* Wax Seal Reseal */
@keyframes waxReseal {
  0% {
    transform: scale(0.4) translateY(-20px);
    opacity: 0;
  }
  65% {
    transform: scale(1.15) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Pinterest Paper Note 3D Unfolding */
@keyframes paperUnfold3D {
  0% {
    opacity: 0;
    transform: perspective(1200px) translateY(35px) rotateX(-50deg) scale(0.92);
    filter: blur(1px);
    box-shadow: 0 4px 10px rgba(60, 40, 20, 0.05);
  }
  55% {
    opacity: 0.95;
    transform: perspective(1200px) translateY(-8px) rotateX(-10deg) scale(0.99);
  }
  80% {
    transform: perspective(1200px) translateY(3px) rotateX(3deg) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: perspective(1200px) translateY(0) rotateX(0deg) scale(1);
    filter: blur(0);
    box-shadow: 0 1px 3px rgba(60, 40, 20, 0.08), 0 16px 36px -8px rgba(90, 60, 30, 0.15), inset 0 0 50px rgba(247, 235, 215, 0.35);
  }
}

/* Pinterest Paper Note 3D Folding Up */
@keyframes paperFold3D {
  0% {
    opacity: 1;
    transform: perspective(1200px) translateY(0) rotateX(0deg) scale(1);
  }
  40% {
    opacity: 0.85;
    transform: perspective(1200px) translateY(-10px) rotateX(-20deg) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: perspective(1200px) translateY(30px) rotateX(-55deg) scale(0.88);
    filter: blur(1px);
  }
}

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