/* Animations for Norlitha Gaming Website */

/* Keyframes */
@keyframes float {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  50% {
    opacity: 0.8;
    transform: translateY(-40px) scale(1.5);
  }
  100% {
    transform: translateY(-80px) scale(0.5);
    opacity: 0;
  }
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes glow {
  0% {
    text-shadow: 0 0 10px rgba(252, 43, 225, 0.5),
                 0 0 20px rgba(252, 43, 225, 0.2);
  }
  50% {
    text-shadow: 0 0 20px rgba(252, 43, 225, 0.8),
                 0 0 30px rgba(252, 43, 225, 0.5);
  }
  100% {
    text-shadow: 0 0 10px rgba(252, 43, 225, 0.5),
                 0 0 20px rgba(252, 43, 225, 0.2);
  }
}

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

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
    filter: hue-rotate(360deg);
  }
}

@keyframes fireBreath {
  0%, 100% {
    box-shadow: 0 0 20px var(--color-fire-orange),
                0 0 40px var(--color-lava-red);
  }
  50% {
    box-shadow: 0 0 40px var(--color-fire-orange),
                0 0 60px var(--color-lava-red);
  }
}

/* Apply Animations */
.logo h1 {
  animation: glow 3s infinite;
}

.hero-content h2 {
  animation: glow 4s infinite;
}

.cta-button, .submit-button {
  background-size: 200% 200%;
  animation: lavaFlow 5s infinite;
}

.feature-icon {
  animation: pulse 3s infinite;
}

/* Game Card Animations */
.game-card {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
  transform: translateY(-10px) scale(1.02);
}

.game-card::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--color-fire-orange), var(--color-neon-pink));
  z-index: -1;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover::after {
  opacity: 1;
  animation: rotateGlow 3s linear infinite;
}

/* Enhanced Button Animations */
.cta-button, .play-button, .nav-button {
  position: relative;
  overflow: hidden;
}

.cta-button::before, .play-button::before, .nav-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

/* Scroll Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animated Lava Background */
.lava-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 10% 90%, var(--color-fire-orange) 0%, transparent 20%),
    radial-gradient(circle at 90% 10%, var(--color-lava-red) 0%, transparent 25%),
    radial-gradient(circle at 50% 50%, var(--color-neon-pink) 0%, transparent 20%);
  filter: blur(70px);
  opacity: 0.1;
  animation: lavaFlow 20s infinite alternate;
  transform-origin: center;
}

/* Hover Animations */
.game-card:hover .play-button {
  animation: pulse 2s infinite;
}

/* Staggered Animations for Lists */
.games-grid .game-card, .features-grid .feature-card {
  opacity: 0;
  transform: translateY(20px);
}

.games-grid .game-card:nth-child(1), .features-grid .feature-card:nth-child(1) {
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.1s;
}

.games-grid .game-card:nth-child(2), .features-grid .feature-card:nth-child(2) {
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.2s;
}

.games-grid .game-card:nth-child(3), .features-grid .feature-card:nth-child(3) {
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.3s;
}

.games-grid .game-card:nth-child(4), .features-grid .feature-card:nth-child(4) {
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.4s;
}

.games-grid .game-card:nth-child(5) {
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.5s;
}

.games-grid .game-card:nth-child(6) {
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.6s;
}

/* Logo Ember Animation */
.logo-embers span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--color-fire-orange), var(--color-lava-red));
  box-shadow: 0 0 10px var(--color-ember-yellow), 0 0 20px var(--color-fire-orange);
}

.logo-embers span:nth-child(1) {
  animation: float 4s infinite;
  animation-delay: 0s;
  left: 20%;
  top: 50%;
}

.logo-embers span:nth-child(2) {
  animation: float 4s infinite;
  animation-delay: 1s;
  left: 50%;
  top: 30%;
}

.logo-embers span:nth-child(3) {
  animation: float 4s infinite;
  animation-delay: 2s;
  left: 80%;
  top: 60%;
}