/* Animation Definitions */

/* Keyframe Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

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

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

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

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

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

@keyframes wiggle {
  0%, 7% {
    transform: rotateZ(0);
  }
  15% {
    transform: rotateZ(-15deg);
  }
  20% {
    transform: rotateZ(10deg);
  }
  25% {
    transform: rotateZ(-10deg);
  }
  30% {
    transform: rotateZ(6deg);
  }
  35% {
    transform: rotateZ(-4deg);
  }
  40%, 100% {
    transform: rotateZ(0);
  }
}

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

/* Hover Animations */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  animation: bounce 0.6s ease-out;
}

/* Card Hover Effects */
.about-card {
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

.about-card:hover::before {
  opacity: 0.1;
}

.about-card:hover .card-icon {
  animation: wiggle 1s ease-in-out;
}

/* Social Link Animations */
.social-link {
  position: relative;
  overflow: hidden;
}

.social-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all var(--transition-base);
}

.social-link:hover::after {
  width: 200px;
  height: 200px;
}

.social-link:hover .social-icon {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Navigation Animations */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

/* Tokenomics Card Animations */
.tokenomics-card:hover {
  animation: pulse 2s infinite;
}

.tokenomics-value {
  transition: all var(--transition-base);
}

.tokenomics-card:hover .tokenomics-value {
  transform: scale(1.1);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Hero Mascot Animation */
.hero-mascot {
  transition: all var(--transition-base);
  cursor: pointer;
}

.hero-mascot:hover {
  animation: wiggle 1s ease-in-out;
  transform: scale(1.1);
}

/* Logo Animation */
.logo-text {
  transition: all var(--transition-base);
  cursor: pointer;
}

.logo-text:hover {
  animation: pulse 1s ease-in-out;
  text-shadow: 0 0 20px var(--primary-color);
}

/* Scroll Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease-out;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.6s ease-out;
}

.fade-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.6s ease-out;
}

.fade-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered Animation Delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Click Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}

/* Floating Elements */
.float-1 {
  animation: float 3s ease-in-out infinite;
}

.float-2 {
  animation: float 4s ease-in-out infinite reverse;
}

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

/* Entrance Animations for Page Load */
.hero-title {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-buttons {
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-mascot {
  animation: fadeInRight 1s ease-out 0.8s both, float 3s ease-in-out 1.8s infinite;
}

/* Reduced Motion Overrides */
@media (prefers-reduced-motion: reduce) {
  .hero-title,
  .hero-subtitle,
  .hero-buttons,
  .hero-mascot {
    animation: none;
  }

  .float-1,
  .float-2,
  .float-3 {
    animation: none;
  }

  .fade-in-up,
  .fade-in-left,
  .fade-in-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Interactive Feedback */
.interactive:hover {
  cursor: pointer;
}

.interactive:active {
  transform: scale(0.98);
}

/* Smooth Transitions for All Interactive Elements */
button,
a,
.card,
.nav-link,
.social-link {
  transition: all var(--transition-base);
}

/* Focus Animations for Accessibility */
button:focus,
a:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  animation: pulse 2s infinite;
}

/* Success Animation */
.success-animation {
  animation: bounce 0.6s ease-out;
}

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

.error-animation {
  animation: shake 0.6s ease-out;
}