/* Basic Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(126, 63, 242, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(126, 63, 242, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(126, 63, 242, 0.5);
  }
}

/* Magical Sparkle Effects */
@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Element Animation Classes */
.fade-in {
  animation: fadeIn 1s ease;
}

.fade-in-up {
  animation: fadeInUp 1s ease;
}

.fade-in-down {
  animation: fadeInDown 1s ease;
}

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

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

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

/* Scroll Animation */
.reveal {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Feature Card Animation */
.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon::before,
.feature-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  z-index: -1;
  animation: pulse 2s infinite;
}

.feature-icon::after {
  animation-delay: 1s;
}

/* Game Card Animations */
.game-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  transition: all 0.3s ease;
  opacity: 0;
}

.game-card:hover::after {
  animation: shine 1.5s ease;
}

@keyframes shine {
  0% {
    top: -50%;
    left: -50%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    top: 150%;
    left: 150%;
    opacity: 0;
  }
}

/* Button Animations */
.btn-play::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  z-index: -1;
  background: linear-gradient(45deg, var(--accent), var(--primary), var(--accent));
  border-radius: var(--radius-full);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-play:hover::before {
  opacity: 1;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Logo Animation */
.logo a:hover i {
  animation: magic 1s ease;
}

@keyframes magic {
  0% {
    transform: scale(1) rotate(0);
  }
  50% {
    transform: scale(1.2) rotate(20deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Hero Sparkle Effect */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    circle,
    rgba(255, 204, 51, 0.4) 1px,
    transparent 1px
  );
  background-size: 30px 30px;
  z-index: 1;
  opacity: 0.3;
  pointer-events: none;
  animation: sparkleMove 60s linear infinite;
}

@keyframes sparkleMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 1000px 1000px;
  }
}

/* Magic Underline Animation */
.magic-underline {
  position: relative;
  overflow: hidden;
}

.magic-underline::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Game Card Hover Effects */
.game-card .btn-play {
  transform: translateY(5px);
  opacity: 0.9;
  transition: all 0.3s ease;
}

.game-card:hover .btn-play {
  transform: translateY(0);
  opacity: 1;
}

/* Gallery Item Hover Effects */
.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, var(--primary) 200%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1;
}

.gallery-item:hover::before {
  opacity: 0.7;
}

/* Social Icon Animations */
.social-icon {
  overflow: hidden;
  position: relative;
}

.social-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0);
  transition: all 0.3s ease;
  border-radius: 50%;
}

.social-icon:hover::before {
  transform: scale(1);
  animation: ripple 0.6s linear;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Form Input Focus Effects */
.form-group input:focus ~ .magic-border,
.form-group select:focus ~ .magic-border,
.form-group textarea:focus ~ .magic-border {
  animation: borderGrow 0.3s forwards;
}

@keyframes borderGrow {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

/* FAQ Animations */
.faq-toggle {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}

.faq-question:hover {
  background: rgba(126, 63, 242, 0.05);
}

/* Page Load Animations */
.hero-content {
  animation: fadeIn 1s ease;
}

.section-header {
  animation: fadeInDown 1s ease;
}

/* Active Navigation Link */
.nav-link.active::before {
  animation: pulse 2s infinite;
}