/* FocusFund - Animations */
/* Stars, Rain, Shooting Stars, and Ambient Effects */

/* Stars Container */
.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
}

.star {
  position: absolute;
  background: var(--color-star);
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  box-shadow: 0 0 var(--glow-size, 4px) var(--color-star-glow);
}

.star.small {
  width: 1px;
  height: 1px;
  --glow-size: 2px;
}

.star.medium {
  width: 2px;
  height: 2px;
  --glow-size: 4px;
}

.star.large {
  width: 3px;
  height: 3px;
  --glow-size: 6px;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Shooting Stars */
.shooting-stars {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shooting-star {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-star), transparent);
  border-radius: 50%;
  animation: shoot var(--duration, 2s) linear forwards;
  opacity: 0;
}

.shooting-star::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--color-star);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-star-glow), 0 0 20px var(--color-star-glow);
}

@keyframes shoot {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(-45deg);
  }
  10% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(500px) translateY(500px) rotate(-45deg);
  }
}

/* Rain */
.rain {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.4;
}

.raindrop {
  position: absolute;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-rain));
  animation: fall var(--duration, 1s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes fall {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

/* Pulsing Glow Effect */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px var(--color-accent-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--color-accent-glow), 0 0 60px var(--color-accent-glow);
  }
}

/* Floating Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Breathe Animation */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* Slide Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Scale */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Ring Progress Animation */
@keyframes ring-progress {
  from {
    stroke-dashoffset: 565.48;
  }
}

/* Utility Animation Classes */
.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-breathe {
  animation: breathe 4s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.animate-slide-up {
  animation: slideInUp 0.5s ease-out;
}

.animate-slide-left {
  animation: slideInLeft 0.5s ease-out;
}

.animate-slide-right {
  animation: slideInRight 0.5s ease-out;
}

.animate-fade-scale {
  animation: fadeInScale 0.4s ease-out;
}

/* Stagger animations */
.stagger > * {
  animation: slideInUp 0.5s ease-out backwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* Timer Ring Animation */
.timer-ring svg {
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: hsla(215, 30%, 30%, 0.3);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: url(#timer-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: hsla(210, 60%, 55%, 0.3);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    hsla(210, 60%, 55%, 0.1),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Gradient Animation */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}
