/* =========================================
   1. CORE ANIMATIONS
   ========================================= */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Slide Up */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Down */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Left */
@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide Right */
@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale Up */
@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pop In (bouncy scale) */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  70% {
    opacity: 1;
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Count Up */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Floating Gradient Background */
@keyframes floatingGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Card Lift */
@keyframes cardLift {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-8px);
  }
}

/* Scroll Trigger Animation */
@keyframes scrollReveal {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger Reveal Animation */
@keyframes staggerReveal {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Enhanced Floating Animation */
@keyframes enhancedFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-15px) rotate(1deg);
  }
  50% {
    transform: translateY(-25px) rotate(-1deg);
  }
  75% {
    transform: translateY(-15px) rotate(1deg);
  }
}
/* ================================
   BUTTON BASE
================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00ff8a, #00b65f);
  color: #001a0d;
  box-shadow: 0 0 25px rgba(0, 255, 138, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0, 255, 138, 0.7);
}

.btn-outline {
  border: 1px solid rgba(0,255,140,0.4);
  color: #9affc6;
  background: transparent;
}

.btn-outline:hover {
  background: rgba(0,255,140,0.12);
}

/* =========================================
   2. UTILITY CLASSES
   ========================================= */

/* Base class for elements to animate */
.animate-on-scroll,
.reveal,
.animate-fade-in,
.animate-fade-in-up,
.animate-slide-up,
.animate-slide-down,
.animate-slide-left,
.animate-slide-right,
.animate-scale-up,
.animate-pop-in,
.animate-count-up,
.animate-card-lift {
  opacity: 0;
  /* Hidden by default */
  will-change: opacity, transform;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* When visible (added by JS) */
.visible {
  opacity: 1 !important;
  transform: none !important;
  animation-fill-mode: forwards;
}

/* Specific Animations (applied when .visible is added) */
.visible.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.visible.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.visible.animate-slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

.visible.animate-slide-down {
  animation: slideDown 0.8s ease-out forwards;
}

.visible.animate-slide-left {
  animation: slideLeft 0.8s ease-out forwards;
}

.visible.animate-slide-right {
  animation: slideRight 0.8s ease-out forwards;
}

.visible.animate-scale-up {
  animation: scaleUp 0.6s ease-out forwards;
}

.visible.animate-pop-in {
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.visible.animate-count-up {
  animation: countUp 0.6s ease-out forwards;
}

.visible.animate-card-lift {
  animation: cardLift 0.4s ease-out forwards;
}

.visible.animate-scroll-reveal {
  animation: scrollReveal 1s ease-out forwards;
}

.visible.animate-stagger-reveal {
  animation: staggerReveal 0.8s ease-out forwards;
}

/* =========================================
   3. STAGGERED ANIMATIONS (Children)
   ========================================= */

/* 
   We use :nth-child delays for elements inside a .stagger-children container.
   The JS will add .visible to the children when the parent is scrolled into view.
*/

.stagger-children .animate-on-scroll {
  opacity: 0;
}

.stagger-children.visible .animate-on-scroll:nth-child(1) {
  transition-delay: 0.1s;
}

.stagger-children.visible .animate-on-scroll:nth-child(2) {
  transition-delay: 0.2s;
}

.stagger-children.visible .animate-on-scroll:nth-child(3) {
  transition-delay: 0.3s;
}

.stagger-children.visible .animate-on-scroll:nth-child(4) {
  transition-delay: 0.4s;
}

.stagger-children.visible .animate-on-scroll:nth-child(5) {
  transition-delay: 0.5s;
}

.stagger-children.visible .animate-on-scroll:nth-child(6) {
  transition-delay: 0.6s;
}

.stagger-children.visible .animate-on-scroll:nth-child(7) {
  transition-delay: 0.7s;
}

.stagger-children.visible .animate-on-scroll:nth-child(8) {
  transition-delay: 0.8s;
}

/* Also support data-stagger attribute for manual control if needed, 
   but CSS nth-child is often simpler for grids. 
*/

/* =========================================
   4. DELAY UTILITIES
   ========================================= */
.delay-100 {
  animation-delay: 0.1s;
  transition-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
  transition-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
  transition-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
  transition-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
  transition-delay: 0.5s;
}

/* =========================================
   5. HOVER EFFECTS (Advanced)
   ========================================= */

/* 1. ADVANCED CARD HOVER - 3D Tilt + Glow */
.hover-card-3d {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.hover-card-3d:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 255, 136, 0.1);
}

.hover-card-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), transparent, rgba(0, 255, 136, 0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  pointer-events: none;
}

.hover-card-3d:hover::before {
  opacity: 1;
}

/* 2. MAGNETIC BUTTON HOVER */
.hover-magnetic {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.hover-magnetic::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
  border-radius: 50%;
}

.hover-magnetic:hover::before {
  width: 300px;
  height: 300px;
}

.hover-magnetic:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
}

/* 3. SHINE EFFECT ON HOVER */
.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.hover-shine:hover::after {
  transform: rotate(45deg) translateX(100%);
}

/* 4. BORDER GLOW PULSE */
.hover-border-glow {
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.hover-border-glow:hover {
  border-color: rgba(0, 255, 136, 0.6);
  box-shadow: 
    0 0 20px rgba(0, 255, 136, 0.3),
    inset 0 0 20px rgba(0, 255, 136, 0.05);
  animation: borderPulse 1.5s infinite;
}

@keyframes borderPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3), inset 0 0 20px rgba(0, 255, 136, 0.05);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5), inset 0 0 30px rgba(0, 255, 136, 0.1);
  }
}

/* 5. IMAGE ZOOM + OVERLAY */
.hover-image-zoom {
  overflow: hidden;
  position: relative;
}

.hover-image-zoom img {
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-image-zoom:hover img {
  transform: scale(1.15);
}

.hover-image-zoom::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 255, 136, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hover-image-zoom:hover::after {
  opacity: 1;
}

/* 6. TEXT SLIDE UP REVEAL */
.hover-text-reveal {
  position: relative;
  overflow: hidden;
}

.hover-text-reveal .text-original {
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.hover-text-reveal .text-hover {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  transition: transform 0.4s ease;
  color: #00ff8a;
}

.hover-text-reveal:hover .text-original {
  transform: translateY(-100%);
  opacity: 0;
}

.hover-text-reveal:hover .text-hover {
  transform: translateY(-100%);
}

/* 7. ICON BOUNCE HOVER */
.hover-icon-bounce {
  transition: all 0.3s ease;
}

.hover-icon-bounce:hover {
  transform: translateY(-8px);
}

.hover-icon-bounce:hover i,
.hover-icon-bounce:hover svg {
  animation: iconBounce 0.6s ease infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 8. GRADIENT SHIFT HOVER */
.hover-gradient-shift {
  background-size: 200% 200%;
  transition: all 0.5s ease;
}

.hover-gradient-shift:hover {
  background-position: 100% 100%;
  transform: translateY(-3px);
}

/* 9. SCALE + SHADOW DEPTH */
.hover-depth {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-depth:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 255, 136, 0.2);
}

/* 10. RIPPLE EFFECT */
.hover-ripple {
  position: relative;
  overflow: hidden;
}

.hover-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(0, 255, 136, 0.5);
  opacity: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  transition: all 0.6s ease;
}

.hover-ripple:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(50);
}

/* =========================================
   EXISTING HOVER EFFECTS (Preserved)
   ========================================= */

/* Enhanced Card Lift + Glow */
.hover-card-lift {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: center;
}

.hover-card-lift:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 255, 136, 0.2);
}

/* Enhanced Glow Hover */
.hover-glow-enhanced {
  transition: all 0.3s ease;
  position: relative;
}

.hover-glow-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(45deg, transparent, rgba(0, 255, 136, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.hover-glow-enhanced:hover::before {
  opacity: 1;
}

.hover-glow-enhanced:hover {
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.4), 0 0 60px rgba(0, 255, 136, 0.2);
  transform: translateY(-2px);
}

/* Enhanced Underline Grow */
.hover-underline-grow {
  position: relative;
  text-decoration: none;
  display: inline-block;
}

.hover-underline-grow::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -6px;
  left: 50%;
  background: linear-gradient(90deg, #00ff8a, #00b65f);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateX(-50%);
}

.hover-underline-grow:hover::after {
  width: 100%;
  transform: translateX(-50%);
}

/* Glow Hover (border/box-shadow) */
.hover-glow {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  border-color: rgba(0, 255, 136, 0.5);
}

/* Underline Grow (for links) */
.hover-underline {
  position: relative;
  text-decoration: none;
}

.hover-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: currentColor;
  transition: width 0.3s ease-in-out;
}

.hover-underline:hover::after {
  width: 100%;
}

/* Floating Gradient Background */
.floating-gradient {
  background: linear-gradient(-45deg, #00ff8a, #00b65f, #19BF0E, #00ff8a);
  background-size: 400% 400%;
  animation: floatingGradient 8s ease infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-enhanced-float {
  animation: enhancedFloat 8s ease-in-out infinite;
}

/* Stagger Reveal Animation */
.stagger-reveal {
  opacity: 0;
  animation: staggerReveal 0.8s ease-out forwards;
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(to right, #00C9FF, #92FE9D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Number Counter Animation */
.counter {
  display: inline-block;
}

.counter.animate-count-up {
  animation: countUp 0.6s ease-out forwards;
}