/* ═══════════════════════════════════════════════════════════
   ALPHA HOSPITAL SOLUTIONS — ANIMATIONS.CSS
═══════════════════════════════════════════════════════════ */

/* ── Reveal Animations (triggered by IntersectionObserver) ── */
/* Only hide elements after JS runs — prevents permanent invisibility if JS is slow/fails */
html.js-ready .reveal-up,
html.js-ready .reveal-left,
html.js-ready .reveal-right,
html.js-ready .reveal-scale {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
              transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
html.js-ready .reveal-up    { transform: translateY(40px); }
html.js-ready .reveal-left  { transform: translateX(-48px); }
html.js-ready .reveal-right { transform: translateX(48px); }
html.js-ready .reveal-scale { transform: scale(0.92); }

.revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* Stagger children — only when JS is active */
html.js-ready .reveal-up:nth-child(2)  { transition-delay: 0.08s; }
html.js-ready .reveal-up:nth-child(3)  { transition-delay: 0.16s; }
html.js-ready .reveal-up:nth-child(4)  { transition-delay: 0.24s; }
html.js-ready .reveal-up:nth-child(5)  { transition-delay: 0.32s; }
html.js-ready .reveal-up:nth-child(6)  { transition-delay: 0.40s; }

/* ── Magnetic Button Effect ── */
.magnetic { transition: transform 0.25s cubic-bezier(0.33,1,0.68,1); }

/* ── Hover Glow ── */
.hover-glow {
  position: relative;
}
.hover-glow::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(0,153,255,0.25), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}
.hover-glow:hover::after { opacity: 1; }

/* ── Animated Gradient Background ── */
@keyframes animGrad {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.anim-grad {
  background-size: 200% 200%;
  animation: animGrad 6s ease infinite;
}

/* ── Floating animation ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
.float { animation: float 4s ease-in-out infinite; }

/* ── Pulse ring ── */
@keyframes pulseRing {
  0%   { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0,153,255,0.5); }
  70%  { transform: scale(1);   box-shadow: 0 0 0 16px rgba(0,153,255,0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0,153,255,0); }
}
.pulse { animation: pulseRing 2s infinite; }

/* ── Slide in from bottom (stagger utility) ── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-in-up { animation: slideInUp 0.6s cubic-bezier(0.4,0,0.2,1) both; }

/* ── Text shimmer ── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.text-shimmer {
  background: linear-gradient(90deg, var(--primary) 25%, var(--accent) 50%, var(--primary) 75%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Parallax layer ── */
.parallax-slow { will-change: transform; }

/* ── Intro loader exit ── */
.intro-loader.hide {
  animation: introHide 0.8s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes introHide {
  to { opacity: 0; transform: scale(1.05); pointer-events: none; }
}

/* ── Counter number pop ── */
@keyframes counterPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); color: var(--accent); }
  100% { transform: scale(1); }
}
.counter-pop { animation: counterPop 0.4s ease; }

/* ── Card entrance (used in services/why grid) ── */
.service-card, .why-card, .approval-card {
  animation: none;
}
.service-card.entered, .why-card.entered, .approval-card.entered {
  animation: slideInUp 0.5s ease both;
}

/* ── Skeleton loading ── */
@keyframes skeleton {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e8eef4 25%, #f4f8fc 50%, #e8eef4 75%);
  background-size: 800px 100%;
  animation: skeleton 1.5s infinite linear;
  border-radius: 8px;
}

/* ── Blur reveal for page transition ── */
.blur-reveal {
  animation: blurReveal 0.8s ease both;
}
@keyframes blurReveal {
  from { filter: blur(20px); opacity: 0; transform: scale(0.98); }
  to   { filter: blur(0);    opacity: 1; transform: scale(1); }
}

/* ── Glow button pulse ── */
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary:hover::after { opacity: 1; }

/* ── Image reveal on load ── */
.img-reveal {
  animation: imgReveal 0.8s ease both;
}
@keyframes imgReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* ── Mouse trail sparkle ── */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: sparkleAnim 0.6s ease forwards;
}
@keyframes sparkleAnim {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0) translateY(-20px); }
}

/* ── Active nav underline slide ── */
.nav-link { overflow: hidden; }

/* ── Scroll progress bar ── */
#scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 10001;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(0,153,255,0.5);
}

/* ── Section dividers ── */
.wave-divider {
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  display: block;
  width: 100%;
}
