/* ==========================================================================
   HELIUM ENTERPRISE PVT. LTD. - ANIMATION UTILITIES (WHITE THEME)
   Keyframes, Page Loader Curtain, GSAP ScrollTrigger Classes & Transitions
   ========================================================================== */

/* Page Loader Curtain (White Theme) */
#page-loader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-brand {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0f172a;
  margin-bottom: 1.5rem;
  text-align: center;
}

.loader-brand span {
  color: var(--primary-blue);
}

.loader-progress-bar {
  width: min(80vw, 220px);
  height: 4px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.loader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-blue), var(--cyan-light));
  transition: width 0.4s ease-out;
}

/* GSAP Reveal Helper Classes */
.reveal-fade-up {
  opacity: 0;
  transform: translateY(40px);
  will-change: opacity, transform;
}

.reveal-fade-in {
  opacity: 0;
  will-change: opacity;
}

.reveal-scale-up {
  opacity: 0;
  transform: scale(0.92);
  will-change: opacity, transform;
}

.reveal-stagger-item {
  opacity: 0;
  transform: translateY(30px);
}

/* Instant IntersectionObserver / GSAP is-visible reveal state */
.reveal-fade-up.is-visible,
.reveal-fade-in.is-visible,
.reveal-scale-up.is-visible,
.reveal-stagger-item.is-visible,
.reveal-stagger-grid.is-visible .reveal-stagger-item {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Fallback for when JS or GSAP is disabled/unloaded */
.no-js .reveal-fade-up,
.js-failed .reveal-fade-up,
.no-js .reveal-stagger-item,
.js-failed .reveal-stagger-item {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.no-js .reveal-fade-in,
.js-failed .reveal-fade-in {
  opacity: 1 !important;
  transition: opacity 0.8s ease-out;
}

.no-js .reveal-scale-up,
.js-failed .reveal-scale-up {
  opacity: 1 !important;
  transform: scale(1) !important;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Magnetic Button Inner Glow pulse */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.3); }
  50% { box-shadow: 0 0 35px rgba(2, 132, 199, 0.5); }
  100% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.3); }
}

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

/* Respect 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-fade-up, .reveal-scale-up, .reveal-stagger-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   STAT COUNTER ANIMATION
   -------------------------------------------------------------------------- */

/* Pulsing shimmer on stat numbers while they count up */
@keyframes statCountPulse {
  0%   { opacity: 0.6; transform: scale(0.95); }
  50%  { opacity: 1;   transform: scale(1.04); }
  100% { opacity: 1;   transform: scale(1); }
}

/* Card bounce-in when it enters the viewport */
@keyframes statCardIn {
  0%   { opacity: 0; transform: translateY(40px) scale(0.9); }
  65%  { opacity: 1; transform: translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* The stat number runs countPulse once while the counter animates */
.stat-number[data-animated="true"] {
  animation: statCountPulse 0.45s ease-out forwards;
}

/* Stat card gets a smooth bounce when it enters the viewport */
.stat-card.in-view {
  animation: statCardIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --------------------------------------------------------------------------
   SMOOTH SCROLLBAR LAYOUT FIXES
   -------------------------------------------------------------------------- */
.scrollbar-container {
  z-index: 100000 !important; /* Make sure the custom scrollbar track is visible above grids */
}

/* --- Mobile View Only: Remove Scroll Animations For Instant Crisp Display --- */
@media (max-width: 768px) {
  .reveal-fade-up,
  .reveal-fade-in,
  .reveal-scale-up,
  .reveal-stagger-item,
  .reveal-stagger-grid .reveal-stagger-item {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
  }
}

