/* ==========================================================================
   Intellis Health — animation layer
   Replaces Framer Motion + tailwindcss-animate from the React build.
   The original compiled Tailwind stylesheet (styles.css) is untouched.
   ========================================================================== */

/* ---- Enter animations used by modals, toasts, step panels, success views
        (tailwindcss-animate style: .animate-in + fade-in / zoom-in-95 / slide-in-from-bottom-5) */
@keyframes ih-enter {
  from {
    opacity: var(--ih-enter-opacity, 1);
    transform: translate3d(0, var(--ih-enter-ty, 0), 0) scale(var(--ih-enter-scale, 1));
  }
}
@keyframes ih-exit {
  to {
    opacity: var(--ih-exit-opacity, 1);
    transform: translate3d(0, var(--ih-exit-ty, 0), 0) scale(var(--ih-exit-scale, 1));
  }
}
.animate-in { animation: ih-enter 150ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-in.duration-200 { animation-duration: 200ms; }
.animate-in.duration-300 { animation-duration: 300ms; }
.fade-in { --ih-enter-opacity: 0; }
.zoom-in-95 { --ih-enter-scale: 0.95; }
.slide-in-from-bottom-5 { --ih-enter-ty: 1.25rem; }

.ih-fade-out { animation: ih-exit 180ms ease-in both; --ih-exit-opacity: 0; }
.ih-toast-out { animation: ih-exit 220ms ease-in both; --ih-exit-opacity: 0; --ih-exit-ty: 1.25rem; }

/* ---- ECG trace: draws the heartbeat line on load (JS sets pathLength="1") */
@keyframes ih-ecg-draw { to { stroke-dashoffset: 0; } }
@keyframes ih-ecg-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(45, 212, 191, 0)); }
  50% { filter: drop-shadow(0 0 3px rgba(45, 212, 191, 0.55)); }
}
.ih-js .animate-ecg {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    ih-ecg-draw 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards,
    ih-ecg-glow 2.4s ease-in-out 2.6s infinite;
}

/* ---- whileHover { y: -5 } on service cards */
[data-lift]:hover { transform: translateY(-5px); }

/* ---- FAQ accordion body */
[data-faq-a] { overflow: hidden; }

/* ---- Filter pill (layoutId spring) */
[data-pill] { will-change: transform; }

/* ---- Respect reduced-motion preferences */
@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;
  }
  .ih-js .animate-ecg { stroke-dasharray: none; stroke-dashoffset: 0; }
}
