/* ==========================================================================
   ToolsNexNova - Custom Animations
   ========================================================================== */

/* Keyframe Animations */
@keyframes floatParticle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.15;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    transform: translateY(-100vh) translateX(50px);
    opacity: 0;
  }
}

@keyframes floatIcon {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(3deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent); }
}

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

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

/* Animation Helper Classes */
.animate-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-zoom-in {
  animation: zoomIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-float-icon {
  animation: floatIcon 6s ease-in-out infinite;
}

/* Ripple Button Effect container */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-span {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: ripple 0.6s linear;
}

/* Spinner Loader */
.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--accent);
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Particle Background Setup */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  display: block;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.2;
  bottom: -20px;
  animation: floatParticle 15s linear infinite;
}

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

/* Typing animation wrapper */
.typing-wrapper {
  display: inline-block;
  overflow: hidden;
  border-right: .15em solid var(--accent);
  white-space: nowrap;
  letter-spacing: .05em;
  animation: 
    typing 3.5s steps(40, end),
    blink-caret .75s step-end infinite;
}
