/* Color Animations and Effects */

@keyframes sparkleFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-40px) rotate(180deg);
    opacity: 0.8;
  }
  75% {
    transform: translateY(-20px) rotate(270deg);
    opacity: 0.6;
  }
}

@keyframes paintPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 20px var(--shadow-gentle);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 30px var(--shadow-deep);
  }
}

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

@keyframes brushStroke {
  0% {
    transform: translateX(-100%) rotate(-45deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%) rotate(45deg);
    opacity: 0;
  }
}

@keyframes dropSplash {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

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

@keyframes colorWave {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Hover Effects */
.feature-card:hover,
.world-card:hover {
  animation: paintPulse 2s infinite ease-in-out;
}

.nav-link:hover {
  animation: gentleBounce 0.6s ease-in-out;
}

.submit-button:hover {
  animation: paintPulse 1s infinite ease-in-out;
}

/* Gradient Animations */
.brush-title {
  background-size: 200% 200%;
  animation: colorShift 3s ease infinite;
}

/* Splash Effects */
.paint-splash::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--color-spark) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: dropSplash 4s infinite ease-in-out;
  opacity: 0.3;
}

/* Brush Stroke Effect */
.brush-zone::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-sunset);
  animation: brushStroke 3s infinite ease-in-out;
  opacity: 0;
}

/* Card Entrance Animations */
.feature-card,
.world-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.feature-card:nth-child(1) {
  animation-delay: 0.1s;
}
.feature-card:nth-child(2) {
  animation-delay: 0.2s;
}
.feature-card:nth-child(3) {
  animation-delay: 0.3s;
}

.world-card:nth-child(1) {
  animation-delay: 0.1s;
}
.world-card:nth-child(2) {
  animation-delay: 0.2s;
}
.world-card:nth-child(3) {
  animation-delay: 0.3s;
}
.world-card:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-soft);
  border-top: 4px solid var(--color-spark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Form Focus Effects */
.form-input:focus,
.form-textarea:focus {
  animation: gentleBounce 0.3s ease-in-out;
}

/* Button Click Effect */
.submit-button:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Mobile Menu Animation */
.mobile-menu {
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
  transform: translateY(0);
}

/* Burger Menu Animation */
.burger-button.active .burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger-button.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-button.active .burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

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

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

/* Color Palette Animation */
.canvas-hero {
  background-size: 400% 400%;
  animation: colorShift 8s ease infinite;
}

/* Text Glow Effect */
.color-title {
  text-shadow: 0 0 20px var(--spark-30);
}

/* Card Hover Glow */
.feature-card:hover,
.world-card:hover,
.tool-card:hover {
  box-shadow: 0 8px 30px var(--shadow-deep), 0 0 20px var(--spark-20);
}

/* Smooth Page Transitions */
.splash-page {
  opacity: 0;
  animation: pageFadeIn 0.8s ease-out forwards;
}

@keyframes pageFadeIn {
  to {
    opacity: 1;
  }
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
  .paint-splash::before {
    width: 60px;
    height: 60px;
  }

  .drop-sparkle {
    width: 15px;
    height: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
