/* ============================================
   Animations
   ============================================ */

/* --- Entrance animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Continuous animations --- */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.2); }
  50% { box-shadow: 0 0 40px rgba(139,92,246,0.4); }
}
@keyframes dash {
  to { stroke-dashoffset: 0; }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

/* --- Bar growth --- */
@keyframes growBar {
  from { height: 0; }
}

/* --- Node pulse --- */
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(139,92,246,0); }
}

/* --- Loading shimmer --- */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    var(--glass) 25%,
    var(--bg-card-hover) 50%,
    var(--glass) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --- Gradient text animation --- */
.gradient-text-animated {
  background: linear-gradient(
    90deg,
    #8b5cf6,
    #ec4899,
    #06b6d4,
    #8b5cf6
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}

/* --- Staggered children --- */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}
.stagger-children.visible > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children.visible > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children.visible > *:nth-child(10) { animation-delay: 0.5s; }
.stagger-children.visible > *:nth-child(n+11) { animation-delay: 0.55s; }

/* --- SVG line draw --- */
.draw-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease forwards;
}

/* --- Hover ripple --- */
.ripple-effect {
  position: relative;
  overflow: hidden;
}
.ripple-effect::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(139,92,246,0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.ripple-effect:hover::after { opacity: 1; }

/* --- Counter --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-animated {
  animation: countUp 0.4s ease forwards;
}
