/* ============================================================
   animations.css - Keyframes, Scroll Animations, Hover Effects
   ============================================================ */

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

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

/* Glow pulse */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(124, 58, 237, 0.2); }
  50% { box-shadow: 0 0 40px rgba(124, 58, 237, 0.45); }
}

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

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

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

/* Scale in */
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.scale-in {
  animation: scale-in 0.5s ease-out forwards;
}

/* Slide up */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slide-up 0.8s ease-out forwards;
}

/* Slide in from left */
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-left {
  animation: slide-in-left 0.8s ease-out forwards;
}

/* Slide in from right */
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slide-in-right 0.8s ease-out forwards;
}

/* Fade in */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

/* Fade in with delay variants */
.fade-in-delay-1 { animation: fade-in 0.6s ease-out 0.1s forwards; opacity: 0; }
.fade-in-delay-2 { animation: fade-in 0.6s ease-out 0.2s forwards; opacity: 0; }
.fade-in-delay-3 { animation: fade-in 0.6s ease-out 0.3s forwards; opacity: 0; }
.fade-in-delay-4 { animation: fade-in 0.6s ease-out 0.4s forwards; opacity: 0; }

/* Typewriter */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--primary-light);
  animation: typewriter 2s steps(30) forwards,
             blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  50% { border-right-color: transparent; }
}

/* Progress bar fill */
@keyframes fill-bar {
  from { width: 0%; }
}

.animate-bar {
  animation: fill-bar 1.5s ease-out forwards;
}

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

.shimmer {
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(124, 58, 237, 0.1) 50%, 
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Rotate */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotate {
  animation: rotate 12s linear infinite;
}

/* Bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.bounce {
  animation: bounce 2s ease-in-out infinite;
}

/* Card hover lift */
.card-lift {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.4s ease;
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.2);
}

/* Reveal line */
@keyframes reveal-line {
  from { width: 0; }
  to { width: 100%; }
}

.reveal-line {
  animation: reveal-line 1s ease-out forwards;
}

/* Staggered card entrance for grids */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
}

.stagger-children.visible > *:nth-child(1) { animation: stagger-item 0.6s ease-out 0.05s forwards; }
.stagger-children.visible > *:nth-child(2) { animation: stagger-item 0.6s ease-out 0.1s forwards; }
.stagger-children.visible > *:nth-child(3) { animation: stagger-item 0.6s ease-out 0.15s forwards; }
.stagger-children.visible > *:nth-child(4) { animation: stagger-item 0.6s ease-out 0.2s forwards; }
.stagger-children.visible > *:nth-child(5) { animation: stagger-item 0.6s ease-out 0.25s forwards; }
.stagger-children.visible > *:nth-child(6) { animation: stagger-item 0.6s ease-out 0.3s forwards; }
.stagger-children.visible > *:nth-child(7) { animation: stagger-item 0.6s ease-out 0.35s forwards; }
.stagger-children.visible > *:nth-child(8) { animation: stagger-item 0.6s ease-out 0.4s forwards; }
.stagger-children.visible > *:nth-child(9) { animation: stagger-item 0.6s ease-out 0.45s forwards; }
.stagger-children.visible > *:nth-child(10) { animation: stagger-item 0.6s ease-out 0.5s forwards; }
.stagger-children.visible > *:nth-child(11) { animation: stagger-item 0.6s ease-out 0.55s forwards; }
.stagger-children.visible > *:nth-child(12) { animation: stagger-item 0.6s ease-out 0.6s forwards; }

@keyframes stagger-item {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ring pulse (for icons) */
@keyframes ring-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(124, 58, 237, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

.ring-pulse {
  animation: ring-pulse 2s ease-out infinite;
}
