/* ==========================================================================
   Inflatable Rentals - Animations & Fun Party Effects
   jump.undervision.com
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframe Definitions
   -------------------------------------------------------------------------- */

/* Bounce - subtle bouncy hover effect */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
  50% {
    transform: translateY(-4px);
  }
  70% {
    transform: translateY(-6px);
  }
  85% {
    transform: translateY(-2px);
  }
}

/* Float - gentle up/down floating motion */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Float with slight rotation */
@keyframes floatRotate {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(2deg);
  }
  50% {
    transform: translateY(-14px) rotate(0deg);
  }
  75% {
    transform: translateY(-6px) rotate(-2deg);
  }
}

/* Confetti fall - individual piece falling */
@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translateY(25vh) rotate(180deg) translateX(25px);
    opacity: 1;
  }
  50% {
    transform: translateY(50vh) rotate(360deg) translateX(-15px);
    opacity: 0.9;
  }
  75% {
    transform: translateY(75vh) rotate(540deg) translateX(20px);
    opacity: 0.7;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) translateX(-10px);
    opacity: 0;
  }
}

/* Confetti sway - side-to-side falling */
@keyframes confettiSway {
  0% {
    transform: translateY(-100vh) rotate(0deg) translateX(0);
    opacity: 1;
  }
  20% {
    transform: translateY(20vh) rotate(120deg) translateX(30px);
  }
  40% {
    transform: translateY(40vh) rotate(240deg) translateX(-20px);
  }
  60% {
    transform: translateY(60vh) rotate(360deg) translateX(25px);
  }
  80% {
    transform: translateY(80vh) rotate(480deg) translateX(-15px);
    opacity: 0.6;
  }
  100% {
    transform: translateY(100vh) rotate(600deg) translateX(10px);
    opacity: 0;
  }
}

/* Pulse - pulsing glow effect */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 20px 8px rgba(255, 107, 53, 0.15);
  }
}

/* Pulse ring - expanding ring */
@keyframes pulseRing {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Slide in from bottom */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from top */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade in with upward motion */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in with downward motion */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in with scale */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Wiggle - playful rotation wiggle */
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(6deg);
  }
  30% {
    transform: rotate(-5deg);
  }
  45% {
    transform: rotate(4deg);
  }
  60% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(2deg);
  }
  90% {
    transform: rotate(-1deg);
  }
}

/* Gradient shift - animated background gradient */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Rubber band - squash and stretch */
@keyframes rubberBand {
  0% {
    transform: scale(1, 1);
  }
  30% {
    transform: scale(1.25, 0.75);
  }
  40% {
    transform: scale(0.75, 1.25);
  }
  50% {
    transform: scale(1.15, 0.85);
  }
  65% {
    transform: scale(0.95, 1.05);
  }
  75% {
    transform: scale(1.05, 0.95);
  }
  100% {
    transform: scale(1, 1);
  }
}

/* Jello - wiggly jello */
@keyframes jello {
  0%, 100% {
    transform: skewX(0deg) skewY(0deg);
  }
  11.1% {
    transform: skewX(-4deg) skewY(-4deg);
  }
  22.2% {
    transform: skewX(3deg) skewY(3deg);
  }
  33.3% {
    transform: skewX(-2deg) skewY(-2deg);
  }
  44.4% {
    transform: skewX(1.5deg) skewY(1.5deg);
  }
  55.5% {
    transform: skewX(-1deg) skewY(-1deg);
  }
  66.6% {
    transform: skewX(0.5deg) skewY(0.5deg);
  }
  77.7% {
    transform: skewX(-0.25deg) skewY(-0.25deg);
  }
}

/* Pop in - scale from 0 */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tada - attention-grabbing */
@keyframes tada {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  10%, 20% {
    transform: scale(0.9) rotate(-3deg);
  }
  30%, 50%, 70%, 90% {
    transform: scale(1.1) rotate(3deg);
  }
  40%, 60%, 80% {
    transform: scale(1.1) rotate(-3deg);
  }
}

/* Swing - pendulum */
@keyframes swing {
  20% {
    transform: rotate(8deg);
  }
  40% {
    transform: rotate(-6deg);
  }
  60% {
    transform: rotate(4deg);
  }
  80% {
    transform: rotate(-2deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Heartbeat */
@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  70% {
    transform: scale(1);
  }
}

/* Balloon rise */
@keyframes balloonRise {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  30% {
    transform: translateY(60vh) rotate(5deg) translateX(15px);
  }
  50% {
    transform: translateY(35vh) rotate(-3deg) translateX(-10px);
  }
  70% {
    transform: translateY(15vh) rotate(4deg) translateX(8px);
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-20vh) rotate(-2deg) translateX(-5px);
    opacity: 0;
  }
}

/* Sparkle twinkle */
@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}


/* --------------------------------------------------------------------------
   Utility Animation Classes
   -------------------------------------------------------------------------- */
.animate-bounce {
  animation: bounce 1s ease;
}

.animate-bounce-loop {
  animation: bounce 2s ease infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-slow {
  animation: float 5s ease-in-out infinite;
}

.animate-float-rotate {
  animation: floatRotate 4s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-wiggle {
  animation: wiggle 0.8s ease;
}

.animate-wiggle-loop {
  animation: wiggle 2s ease infinite;
}

.animate-rubberBand {
  animation: rubberBand 0.8s ease;
}

.animate-jello {
  animation: jello 1s ease;
}

.animate-pop-in {
  animation: popIn 0.5s cubic-bezier(0.26, 0.53, 0.74, 1.48);
}

.animate-tada {
  animation: tada 1s ease;
}

.animate-swing {
  animation: swing 1s ease;
  transform-origin: top center;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease;
}

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease;
}

.animate-fadeInDown {
  animation: fadeInDown 0.5s ease;
}

.animate-fadeInScale {
  animation: fadeInScale 0.5s ease;
}

.animate-slideInUp {
  animation: slideInUp 0.5s ease;
}

.animate-slideInDown {
  animation: slideInDown 0.5s ease;
}

.animate-slideInLeft {
  animation: slideInLeft 0.5s ease;
}

.animate-slideInRight {
  animation: slideInRight 0.5s ease;
}

/* Gradient shifting background */
.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* Hover triggers */
.hover-bounce:hover {
  animation: bounce 0.6s ease;
}

.hover-wiggle:hover {
  animation: wiggle 0.6s ease;
}

.hover-rubberBand:hover {
  animation: rubberBand 0.6s ease;
}

.hover-jello:hover {
  animation: jello 0.8s ease;
}

.hover-tada:hover {
  animation: tada 0.8s ease;
}

.hover-swing:hover {
  animation: swing 0.6s ease;
  transform-origin: top center;
}

.hover-pulse:hover {
  animation: pulse 0.8s ease;
}

.hover-pop:hover {
  animation: popIn 0.4s ease;
}

.hover-float:hover {
  transform: translateY(-6px);
  transition: transform 0.3s ease;
}


/* --------------------------------------------------------------------------
   Stagger Delay Utilities (for sequential animations)
   -------------------------------------------------------------------------- */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }


/* --------------------------------------------------------------------------
   Confetti Container
   -------------------------------------------------------------------------- */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  opacity: 0;
}

.confetti-piece:nth-child(odd) {
  animation: confettiFall var(--confetti-duration, 4s) linear var(--confetti-delay, 0s) forwards;
}

.confetti-piece:nth-child(even) {
  animation: confettiSway var(--confetti-duration, 5s) linear var(--confetti-delay, 0s) forwards;
}

/* Confetti with pseudo-elements for decoration */
.confetti-deco {
  position: relative;
  overflow: hidden;
}

.confetti-deco::before,
.confetti-deco::after {
  content: '';
  position: absolute;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

.confetti-deco::before {
  left: 15%;
  background: #FF6B35;
  animation: confettiFall 4.5s linear infinite;
  animation-delay: -1s;
}

.confetti-deco::after {
  left: 75%;
  background: #FFD166;
  animation: confettiSway 5.5s linear infinite;
  animation-delay: -2.5s;
}

/* Confetti colors - use in combination with JS-generated pieces */
.confetti-orange { background: #FF6B35; }
.confetti-blue { background: #004E98; }
.confetti-yellow { background: #FFD166; }
.confetti-green { background: #06D6A0; }
.confetti-pink { background: #EF476F; }
.confetti-purple { background: #7B2FBE; }

/* Confetti shapes */
.confetti-square { border-radius: 2px; }
.confetti-circle { border-radius: 50%; }
.confetti-strip {
  width: 4px !important;
  height: 16px !important;
  border-radius: 2px;
}


/* --------------------------------------------------------------------------
   Balloon Float
   -------------------------------------------------------------------------- */
.balloon-float {
  position: absolute;
  width: 40px;
  height: 50px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
  z-index: 0;
  animation: balloonRise var(--balloon-duration, 8s) ease-in-out var(--balloon-delay, 0s) infinite;
}

.balloon-float::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.15);
}

.balloon-float.balloon-orange {
  background: radial-gradient(circle at 35% 35%, #FF9B73, #FF6B35);
}

.balloon-float.balloon-blue {
  background: radial-gradient(circle at 35% 35%, #3A7CC5, #004E98);
}

.balloon-float.balloon-yellow {
  background: radial-gradient(circle at 35% 35%, #FFE29E, #FFD166);
}

.balloon-float.balloon-pink {
  background: radial-gradient(circle at 35% 35%, #F58DA3, #EF476F);
}

.balloon-float.balloon-green {
  background: radial-gradient(circle at 35% 35%, #5EE8C3, #06D6A0);
}

/* Balloon sizes */
.balloon-sm {
  width: 28px;
  height: 35px;
}

.balloon-lg {
  width: 55px;
  height: 68px;
}

/* Balloon container for hero or sections */
.balloon-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}


/* --------------------------------------------------------------------------
   Sparkle Effects
   -------------------------------------------------------------------------- */
.sparkle-container {
  position: relative;
}

.sparkle-container::before,
.sparkle-container::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
}

.sparkle-container::before {
  top: 10%;
  right: 5%;
  animation-delay: 0s;
}

.sparkle-container::after {
  bottom: 15%;
  left: 8%;
  animation-delay: 1s;
  width: 4px;
  height: 4px;
}


/* --------------------------------------------------------------------------
   Scroll-triggered Animations (Intersection Observer)
   -------------------------------------------------------------------------- */

/* Elements start hidden and animate in when .is-visible is added via JS */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
}

/* Variants: different entry directions */
.animate-on-scroll.from-bottom {
  transform: translateY(40px);
}

.animate-on-scroll.from-bottom.is-visible {
  transform: translateY(0);
}

.animate-on-scroll.from-top {
  transform: translateY(-40px);
}

.animate-on-scroll.from-top.is-visible {
  transform: translateY(0);
}

.animate-on-scroll.from-left {
  transform: translateX(-40px);
}

.animate-on-scroll.from-left.is-visible {
  transform: translateX(0);
}

.animate-on-scroll.from-right {
  transform: translateX(40px);
}

.animate-on-scroll.from-right.is-visible {
  transform: translateX(0);
}

.animate-on-scroll.from-scale {
  transform: scale(0.85);
}

.animate-on-scroll.from-scale.is-visible {
  transform: scale(1);
}

/* Stagger children inside a container */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }
.stagger-children .animate-on-scroll:nth-child(7) { transition-delay: 0.6s; }
.stagger-children .animate-on-scroll:nth-child(8) { transition-delay: 0.7s; }
.stagger-children .animate-on-scroll:nth-child(9) { transition-delay: 0.8s; }
.stagger-children .animate-on-scroll:nth-child(10) { transition-delay: 0.9s; }
.stagger-children .animate-on-scroll:nth-child(11) { transition-delay: 1.0s; }
.stagger-children .animate-on-scroll:nth-child(12) { transition-delay: 1.1s; }


/* --------------------------------------------------------------------------
   Fun Background Patterns (decorative)
   -------------------------------------------------------------------------- */

/* Polka dots background */
.bg-dots {
  background-image: radial-gradient(circle, rgba(255, 107, 53, 0.08) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

/* Diagonal stripes */
.bg-stripes {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 107, 53, 0.04) 10px,
    rgba(255, 107, 53, 0.04) 20px
  );
}

/* Wavy pattern */
.bg-wavy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='rgba(255,107,53,0.03)' d='M0,30 C360,60 720,0 1080,30 C1260,45 1350,50 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E");
  background-size: 100% 60px;
  background-repeat: repeat;
}


/* --------------------------------------------------------------------------
   Party Mode (toggle-able celebration overlay)
   -------------------------------------------------------------------------- */
.party-mode {
  position: relative;
}

.party-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 53, 0.03) 0%,
    rgba(0, 78, 152, 0.03) 33%,
    rgba(255, 209, 102, 0.03) 66%,
    rgba(6, 214, 160, 0.03) 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  pointer-events: none;
  z-index: 0;
}


/* --------------------------------------------------------------------------
   Counting / Number Animation (for stats)
   -------------------------------------------------------------------------- */
.count-up {
  display: inline-block;
  transition: all 0.5s ease-out;
}


/* --------------------------------------------------------------------------
   Typewriter Effect
   -------------------------------------------------------------------------- */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
  max-width: fit-content;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary);
  }
}


/* --------------------------------------------------------------------------
   Reduced Motion - Accessibility
   -------------------------------------------------------------------------- */
@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;
  }

  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .animate-bounce,
  .animate-bounce-loop,
  .animate-float,
  .animate-float-slow,
  .animate-float-rotate,
  .animate-pulse,
  .animate-wiggle,
  .animate-wiggle-loop,
  .animate-heartbeat,
  .animate-gradient,
  .confetti-piece,
  .confetti-deco::before,
  .confetti-deco::after,
  .balloon-float,
  .sparkle-container::before,
  .sparkle-container::after,
  .typewriter {
    animation: none !important;
  }

  .hover-bounce:hover,
  .hover-wiggle:hover,
  .hover-rubberBand:hover,
  .hover-jello:hover,
  .hover-tada:hover,
  .hover-swing:hover,
  .hover-pulse:hover,
  .hover-pop:hover,
  .hover-float:hover {
    animation: none !important;
    transform: none !important;
  }

  .confetti-container {
    display: none !important;
  }

  .balloon-scene {
    display: none !important;
  }

  .party-mode::before {
    animation: none !important;
  }

  .typewriter {
    border-right: none;
    white-space: normal;
    width: auto;
    max-width: none;
  }
}
