/* ===== ANIMATIONS & TRANSITIONS ===== */

/* Base Animation Classes */
.animate {
  animation-duration: 1.5s;
  animation-fill-mode: both;
}

.animate-fast {
  animation-duration: 0.8s;
}

.animate-slow {
  animation-duration: 2.5s;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-30px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(30px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Slide Animations */
@keyframes slideInUp {
  from {
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInDown {
  from {
    transform: translate3d(0, -100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Scale Animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleInUp {
  from {
    opacity: 0;
    transform: scale(0.9) translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

@keyframes scaleInDown {
  from {
    opacity: 0;
    transform: scale(0.9) translate3d(0, -30px, 0);
  }
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

/* Bounce Animations */
@keyframes bounceIn {
  from,
  20%,
  40%,
  60%,
  80%,
  to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes bounceInUp {
  from,
  60%,
  75%,
  90%,
  to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  from {
    opacity: 0;
    transform: translate3d(0, 3000px, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(0, -20px, 0);
  }
  75% {
    transform: translate3d(0, 10px, 0);
  }
  90% {
    transform: translate3d(0, -5px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Rotate Animations */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate3d(0, 0, 1, -200deg);
  }
  to {
    opacity: 1;
    transform: rotate3d(0, 0, 1, 0deg);
  }
}

@keyframes rotateInDownLeft {
  from {
    opacity: 0;
    transform: rotate3d(0, 0, 1, -45deg);
  }
  to {
    opacity: 1;
    transform: rotate3d(0, 0, 1, 0deg);
  }
}

@keyframes rotateInDownRight {
  from {
    opacity: 0;
    transform: rotate3d(0, 0, 1, 45deg);
  }
  to {
    opacity: 1;
    transform: rotate3d(0, 0, 1, 0deg);
  }
}

/* Flip Animations */
@keyframes flipInX {
  from {
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

@keyframes flipInY {
  from {
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

/* Zoom Animations */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}

@keyframes zoomInUp {
  from {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }
  60% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}

/* Pulse and Attention Animations */
@keyframes pulse {
  from {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

@keyframes heartbeat {
  from {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

@keyframes rubberBand {
  from {
    transform: scale(1);
  }
  30% {
    transform: scaleX(1.25) scaleY(0.75);
  }
  40% {
    transform: scaleX(0.75) scaleY(1.25);
  }
  50% {
    transform: scaleX(1.15) scaleY(0.85);
  }
  65% {
    transform: scaleX(0.95) scaleY(1.05);
  }
  75% {
    transform: scaleX(1.05) scaleY(0.95);
  }
  to {
    transform: scale(1);
  }
}

/* Shake Animations */
@keyframes shake {
  from,
  to {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(10px, 0, 0);
  }
}

@keyframes shakeX {
  from,
  to {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(10px, 0, 0);
  }
}

@keyframes shakeY {
  from,
  to {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(0, -10px, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(0, 10px, 0);
  }
}

/* Hover Animations */
@keyframes hoverUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

@keyframes hoverScale {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

@keyframes hoverRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(5deg);
  }
}

/* Loading Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

/* Progress Animations */
@keyframes progressBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes progressBarStripe {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%,
  50% {
    border-color: transparent;
  }
  51%,
  100% {
    border-color: var(--accent-color);
  }
}

/* Floating Animation */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes floatFast {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-18px);
  }
}

/* Wave Animation */
@keyframes wave {
  0%,
  60%,
  100% {
    transform: initial;
  }
  30% {
    transform: translateY(-8px);
  }
}

/* Glow Animation */
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px var(--accent-color);
  }
  50% {
    box-shadow: 0 0 20px var(--accent-color), 0 0 30px var(--accent-color);
  }
}

 @keyframes glowPulse {
   0%,
   100% {
     box-shadow: 0 0 5px var(--accent-color);
   }
   50% {
     box-shadow: 0 0 20px var(--accent-color), 0 0 30px var(--accent-color), 0 0 40px var(--accent-color);
   }
 }
 
 @keyframes pulse-star {
   0%, 100% {
     transform: scale(1) rotate(0deg);
   }
   50% {
     transform: scale(1.1) rotate(180deg);
   }
 }

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

@keyframes gradientFlow {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.2s; }
.stagger-2 { animation-delay: 0.4s; }
.stagger-3 { animation-delay: 0.6s; }
.stagger-4 { animation-delay: 0.8s; }
.stagger-5 { animation-delay: 1s; }
.stagger-6 { animation-delay: 1.2s; }

/* Animation Classes */
.fade-in { animation-name: fadeIn; }
.fade-in-up { animation-name: fadeInUp; }
.fade-in-down { animation-name: fadeInDown; }
.fade-in-left { animation-name: fadeInLeft; }
.fade-in-right { animation-name: fadeInRight; }

.slide-in-up { animation-name: slideInUp; }
.slide-in-down { animation-name: slideInDown; }
.slide-in-left { animation-name: slideInLeft; }
.slide-in-right { animation-name: slideInRight; }

.scale-in { animation-name: scaleIn; }
.scale-in-up { animation-name: scaleInUp; }
.scale-in-down { animation-name: scaleInDown; }

.bounce-in { animation-name: bounceIn; }
.bounce-in-up { animation-name: bounceInUp; }

.rotate-in { animation-name: rotateIn; }
.rotate-in-down-left { animation-name: rotateInDownLeft; }
.rotate-in-down-right { animation-name: rotateInDownRight; }

.flip-in-x { animation-name: flipInX; }
.flip-in-y { animation-name: flipInY; }

.zoom-in { animation-name: zoomIn; }
.zoom-in-up { animation-name: zoomInUp; }

.pulse { animation-name: pulse; }
.heartbeat { animation-name: heartbeat; }
.rubber-band { animation-name: rubberBand; }

.shake { animation-name: shake; }
.shake-x { animation-name: shakeX; }
.shake-y { animation-name: shakeY; }

.hover-up { animation-name: hoverUp; }
.hover-scale { animation-name: hoverScale; }
.hover-rotate { animation-name: hoverRotate; }

.spin { animation-name: spin; }
.spin-slow { animation-name: spinSlow; animation-duration: 3s; }
.spin-reverse { animation-name: spinReverse; }

.progress-bar { animation-name: progressBar; }
.progress-bar-stripe { animation-name: progressBarStripe; }

.typing { animation-name: typing; }
.blink { animation-name: blink; animation-duration: 1s; animation-iteration-count: infinite; }

.float { animation-name: float; }
.float-slow { animation-name: floatSlow; animation-duration: 6s; }
.float-fast { animation-name: floatFast; animation-duration: 3s; }

.wave { animation-name: wave; animation-duration: 4s; animation-iteration-count: infinite; }

.glow { animation-name: glow; animation-duration: 2s; animation-iteration-count: infinite; }
.glow-pulse { animation-name: glowPulse; animation-duration: 2s; animation-iteration-count: infinite; }

.gradient-shift { animation-name: gradientShift; animation-duration: 3s; animation-iteration-count: infinite; }
.gradient-flow { animation-name: gradientFlow; animation-duration: 4s; animation-iteration-count: infinite; }

/* Hover Animation Classes */
.hover-up:hover { animation: hoverUp 0.3s ease-out forwards; }
.hover-scale:hover { animation: hoverScale 0.3s ease-out forwards; }
.hover-rotate:hover { animation: hoverRotate 0.3s ease-out forwards; }

/* Continuous Animations */
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* Bounce Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Ping Animation */
@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Utility Classes */
.animate-once { animation-iteration-count: 1; }
.animate-infinite { animation-iteration-count: infinite; }
.animate-paused { animation-play-state: paused; }
.animate-running { animation-play-state: running; }

/* Responsive Animation Classes */
@media (prefers-reduced-motion: reduce) {
  .animate,
  .animate-fast,
  .animate-slow,
  [class*="animate-"] {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles for Animations */
@media print {
  .animate,
  .animate-fast,
  .animate-slow,
  [class*="animate-"] {
    animation: none !important;
    transition: none !important;
  }
}
