/**
 * Animation Styles
 * Scroll animations, effects, and motion for Cohiru Lab.
 */

/* ===== Scroll Animations ===== */
[data-animate] {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"] {
  transform: translateY(30px);
}

[data-animate="fade-down"] {
  transform: translateY(-30px);
}

[data-animate="fade-left"] {
  transform: translateX(30px);
}

[data-animate="fade-right"] {
  transform: translateX(-30px);
}

[data-animate="scale"] {
  transform: scale(0.95);
}

[data-animate].animate-in {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* ===== Floating Particles ===== */
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.floating-particle {
  position: absolute;
  background: linear-gradient(135deg, var(--redice-accent-cyan, #6ba3b8) 0%, var(--redice-accent-red, #b85450) 100%);
  border-radius: 50%;
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  25% {
    transform: translateY(-30px) translateX(10px) rotate(90deg);
  }
  50% {
    transform: translateY(-15px) translateX(-15px) rotate(180deg);
  }
  75% {
    transform: translateY(-40px) translateX(5px) rotate(270deg);
  }
}

/* ===== Ripple Effect ===== */
.ripple-effect {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Ensure parent has relative positioning for ripple */
.btn,
.nav-card,
.redice-event__link {
  position: relative;
  overflow: hidden;
}

/* ===== Enhanced Hover Effects ===== */
.nav-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-card:not(.nav-card--disabled):hover {
  transform: translateY(-8px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.08),
    0 0 0 1px var(--color-accent-primary, #e07850);
}

.nav-card:not(.nav-card--disabled):active {
  transform: translateY(-4px);
}

/* ===== Glow Effects ===== */
.hero__title {
  text-shadow: 0 0 40px rgba(224, 120, 80, 0.3);
}

.redice-hero__tagline {
  animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
  from {
    text-shadow: 0 2px 8px rgba(58, 69, 80, 0.6), 0 0 20px rgba(58, 69, 80, 0.3);
  }
  to {
    text-shadow: 0 2px 12px rgba(58, 69, 80, 0.8), 0 0 30px rgba(58, 69, 80, 0.4), 0 0 60px rgba(107, 163, 184, 0.2);
  }
}

/* ===== Staggered Animation for Lists ===== */
.navigation__grid .nav-card:nth-child(1) { transition-delay: 0.05s; }
.navigation__grid .nav-card:nth-child(2) { transition-delay: 0.1s; }
.navigation__grid .nav-card:nth-child(3) { transition-delay: 0.15s; }
.navigation__grid .nav-card:nth-child(4) { transition-delay: 0.2s; }

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .floating-particles {
    display: none;
  }

  .floating-particle,
  .ripple-effect {
    animation: none;
  }

  .redice-hero__tagline {
    animation: none;
  }

  .nav-card {
    transition: none;
  }
}
