/* ===================================
   ✨ ANIMATIONS
   =================================== */

/* ===================================
   KEYFRAME ANIMATIONS
   =================================== */

/* Float Animation */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
}

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Rotate In */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

/* Bounce */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

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

/* ===================================
   UTILITY CLASSES
   =================================== */

/* Fade Animations */
.animate {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.animate-up {
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
}

.animate-down {
  opacity: 0;
  animation: fadeInDown 1s ease forwards;
}

.animate-left {
  opacity: 0;
  animation: fadeInLeft 1s ease forwards;
}

.animate-right {
  opacity: 0;
  animation: fadeInRight 1s ease forwards;
}

.animate-scale {
  opacity: 0;
  animation: scaleIn 1s ease forwards;
}

.animate-rotate {
  opacity: 0;
  animation: rotateIn 1s ease forwards;
}

/* Animation Delays */
.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

.delay-5 {
  animation-delay: 1s;
}

/* Animation Durations */
.duration-fast {
  animation-duration: 0.5s;
}

.duration-normal {
  animation-duration: 1s;
}

.duration-slow {
  animation-duration: 1.5s;
}

/* ===================================
   HOVER ANIMATIONS
   =================================== */

/* Lift on Hover */
.hover-lift {
  transition: transform var(--transition);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Grow on Hover */
.hover-grow {
  transition: transform var(--transition);
}

.hover-grow:hover {
  transform: scale(1.05);
}

/* Shrink on Hover */
.hover-shrink {
  transition: transform var(--transition);
}

.hover-shrink:hover {
  transform: scale(0.95);
}

/* Rotate on Hover */
.hover-rotate {
  transition: transform var(--transition);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Glow on Hover */
.hover-glow {
  transition: box-shadow var(--transition);
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--primary-color);
}

/* ===================================
   SCROLL ANIMATIONS (via JS)
   =================================== */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s ease;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s ease;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s ease;
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ===================================
   LOADING ANIMATIONS
   =================================== */

/* Spinner */
.spinner {
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Dots Loader */
.dots-loader {
  display: flex;
  gap: 8px;
}

.dots-loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary-color);
  animation: bounce 1.4s ease-in-out infinite;
}

.dots-loader span:nth-child(1) {
  animation-delay: -0.32s;
}

.dots-loader span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-color) 25%,
    var(--card-bg) 50%,
    var(--border-color) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===================================
   PERFORMANCE OPTIMIZATION
   =================================== */

/* Force GPU Acceleration */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

/* Disable Animations on Mobile (Optional) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
