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

/* Fade in up animation */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

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

@keyframes float-delayed {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes float-strong {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-28px); }
}

@keyframes glitch {
  0%, 92%, 100% {
    transform: translate3d(0, 0, 0);
    filter: none;
  }
  93% {
    transform: translate3d(-2px, 1px, 0) skewX(-2deg);
    filter: contrast(1.2) saturate(1.25) drop-shadow(2px 0 0 rgba(34, 197, 94, 0.7)) drop-shadow(-2px 0 0 rgba(79, 70, 229, 0.7));
  }
  94% {
    transform: translate3d(3px, -2px, 0) skewX(2deg);
    filter: contrast(1.35) saturate(1.35) hue-rotate(8deg) drop-shadow(3px 0 0 rgba(34, 197, 94, 0.65)) drop-shadow(-3px 0 0 rgba(79, 70, 229, 0.65));
  }
  95% {
    transform: translate3d(-4px, 2px, 0) skewX(-3deg);
    filter: contrast(1.15) saturate(1.2) hue-rotate(-10deg) drop-shadow(4px 0 0 rgba(34, 197, 94, 0.55)) drop-shadow(-4px 0 0 rgba(79, 70, 229, 0.55));
  }
  96% {
    transform: translate3d(2px, 1px, 0);
    filter: contrast(1.05) saturate(1.1) drop-shadow(2px 0 0 rgba(34, 197, 94, 0.45)) drop-shadow(-2px 0 0 rgba(79, 70, 229, 0.45));
  }
  97% {
    transform: translate3d(0, 0, 0);
    filter: none;
  }
}

@keyframes spin-slow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -220; }
}

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

.animate-float-slow {
  animation: float 7s ease-in-out infinite;
  will-change: transform;
}

.animate-float-strong {
  animation: float-strong 3.2s ease-in-out infinite;
  will-change: transform;
}

.animate-glitch {
  animation: glitch 2.8s steps(1, end) infinite;
  will-change: transform, filter;
}

.animate-float-delayed {
  animation: float-delayed 3.5s ease-in-out infinite;
  animation-delay: 0.5s;
}

@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-float-slow,
  .animate-float-strong,
  .animate-float-delayed,
  .animate-glitch,
  .animate-spin-slow {
    animation: none !important;
  }
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Header shadow on scroll */
.header-scrolled {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Form input focus glow */
input:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Selection color */
::selection {
  background: rgba(99, 102, 241, 0.15);
  color: #312e81;
}

/* Active nav link */
.nav-active {
  color: #4f46e5 !important;
  background-color: #eef2ff;
}

/* Blog card image hover */
.blog-img-wrap:hover img {
  transform: scale(1.05);
}

/* Counter animation */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.count-animate {
  animation: count-up 0.6s ease-out forwards;
}
