/* ==========================================================================
   HELIOSUNTECH PLASTICS PRIVATE LIMITED - ENHANCED ANIMATION SYSTEM
   Kinetic Circularity / Staggered Scroll Reveals / 3D Card Tilts & Shimmers
   Accessibility: Complete prefers-reduced-motion coverage
   ========================================================================== */

/* 1. Luminous Pulse & Breathing */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(82, 178, 22, 0.25);
    opacity: 0.9;
  }
  50% {
    box-shadow: 0 0 20px rgba(82, 178, 22, 0.65);
    opacity: 1;
  }
}

@keyframes emerald-breathe {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(20, 107, 68, 0.25));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(82, 178, 22, 0.45));
  }
}

/* 2. Floating Polymer Crystals & Nodes */
@keyframes soft-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(3deg);
  }
}

/* 3. Kinetic Circular Rotation */
@keyframes circular-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 4. Stream Flow for SVG Paths */
@keyframes stroke-dash-flow {
  0% {
    stroke-dashoffset: 40;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* 5. Luminous Card Shimmer */
@keyframes card-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 6. Subtle Pulse Ring */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(82, 178, 22, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(82, 178, 22, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(82, 178, 22, 0);
  }
}

/* Utility Animation Classes */
.animate-pulse-glow {
  animation: pulse-glow 2.5s infinite ease-in-out;
}

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

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

.animate-rotate {
  animation: circular-spin 26s linear infinite;
}

.animate-breathe {
  animation: emerald-breathe 4s infinite ease-in-out;
}

.animate-ring {
  animation: pulse-ring 2.2s infinite ease-in-out;
}

/* ==========================================================================
   PAGE-TO-PAGE TRANSITION ANIMATION SYSTEM
   ========================================================================== */

/* Top Loading Progress Bar */
#pageProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #146B44 0%, #52B216 50%, #88DE3D 100%);
  z-index: 99999;
  box-shadow: 0 0 12px rgba(82, 178, 22, 0.8);
  pointer-events: none;
  opacity: 0;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

#pageProgressBar.is-loading {
  opacity: 1;
}

/* Page Enter / Exit Animations */
@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageExit {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

body.page-enter {
  animation: pageEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.page-exit {
  animation: pageExit 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

/* 7. Scroll Reveal Framework with Staggering */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-smooth), transform 0.75s var(--ease-smooth);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Children Support */
.stagger-container.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-container > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.stagger-container.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-container.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.stagger-container.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.stagger-container.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.stagger-container.is-visible > *:nth-child(5) { transition-delay: 0.45s; }
.stagger-container.is-visible > *:nth-child(6) { transition-delay: 0.55s; }

/* 8. Button & Interactive Micro-Animations */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
  transform: skewX(-22deg);
  transition: none;
  pointer-events: none;
}

.btn:hover::after {
  left: 150%;
  transition: left 0.7s ease-in-out;
}

.btn:hover {
  transform: translateY(-2px) !important;
}

.btn:active {
  transform: translateY(1px) !important;
}

/* Navbar Link Indicator Sweep */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0%;
  height: 2.5px;
  background: linear-gradient(90deg, var(--accent-emerald) 0%, var(--accent-lime) 100%);
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 999px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
  left: 10%;
}

/* Pulsing Badge Indicator */
.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  animation: pulse-glow 2.5s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-on-scroll,
  .stagger-container > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  body.page-enter,
  body.page-exit {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

