/* === Animation Keyframes === */

/* Basic Entrance Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Special Effect Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg);
  }
}

@keyframes logo-wiggle {
  0%, 100% {
    transform: rotate(-5deg) scale(1);
  }
  25% {
    transform: rotate(5deg) scale(1.05);
  }
  50% {
    transform: rotate(-5deg) scale(1.05);
  }
  75% {
    transform: rotate(5deg) scale(1.05);
  }
}

@keyframes gentle-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* === Animation Classes === */

/* Entrance Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.fade-in.animate {
  animation: fadeIn var(--transition-normal, 0.3s) ease forwards;
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  will-change: opacity, transform;
}

.scale-in.animate {
  animation: scaleIn var(--transition-normal, 0.3s) ease forwards;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-20px);
  will-change: opacity, transform;
}

.slide-in-left.animate {
  animation: slideInLeft var(--transition-normal, 0.3s) ease forwards;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(20px);
  will-change: opacity, transform;
}

.slide-in-right.animate {
  animation: slideInRight var(--transition-normal, 0.3s) ease forwards;
}

/* Delayed Animations */
[class*="delay-"] {
  animation-delay: var(--delay);
}

.fade-in.delay-1 { --delay: 0.1s; }
.fade-in.delay-2 { --delay: 0.2s; }
.fade-in.delay-3 { --delay: 0.3s; }
.fade-in.delay-4 { --delay: 0.4s; }

.scale-in.delay-1 { --delay: 0.1s; }
.scale-in.delay-2 { --delay: 0.2s; }
.scale-in.delay-3 { --delay: 0.3s; }
.scale-in.delay-4 { --delay: 0.4s; }

/* Continuous Animations */
.pulse {
  animation: pulse 2s infinite ease-in-out;
  will-change: transform, box-shadow;
}

.bounce {
  animation: bounce 2s infinite;
  will-change: transform;
}

.float {
  animation: float 3s ease-in-out infinite;
  will-change: transform;
}

.float-slow {
  animation: float-slow 4s ease-in-out infinite;
  will-change: transform;
}

.wiggle {
  animation: wiggle 2s ease-in-out infinite;
  display: inline-block;
  will-change: transform;
}

/* Logo Specific Animation */
.wiggle-logo {
  animation: logo-wiggle 3s ease-in-out infinite;
  display: inline-block;
  will-change: transform;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
  transition: all 0.3s ease;
}

.wiggle-logo:hover {
  animation: logo-wiggle 0.8s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.8));
}

/* Hover Effects */
.meme-hover:hover {
  animation: wiggle 0.5s ease;
}

.gif-hover:hover {
  animation: gentle-pulse 2s ease-in-out infinite;
}

/* Intersection Observer Trigger */
[data-animate] {
  opacity: 0;
}

[data-animate].animate {
  opacity: 1;
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
  .wiggle-logo {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    animation: logo-wiggle 4s ease-in-out infinite;
  }
  
  .float-slow {
    animation: float-slow 5s ease-in-out infinite;
  }
}