/* ==========================================================================
   HARMONY HOSPITAL — ANIMATIONS & MOTION SYSTEM
   Engine: GSAP 3 & CSS Micro-Interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom Cursor (Desktop Only)
   -------------------------------------------------------------------------- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: normal;
  display: none;
}

@media (pointer: fine) {
  .custom-cursor {
    display: block;
  }
}

.cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--color-teal);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(196, 84, 77, 0.45);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              background-color 0.3s ease;
}

/* Hover States for Interactive Elements */
.cursor-hover .cursor-ring {
  width: 60px;
  height: 60px;
  border-color: var(--color-teal);
  background-color: rgba(196, 84, 77, 0.08);
}

.cursor-hover .cursor-dot {
  transform: translate(-50%, -50%) scale(1.4);
  background-color: var(--color-navy);
}

.cursor-hidden {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   2. Staggered Scroll & Element Reveal Classes
   Graceful degradation: by default visible, animated once JS kicks in.
   -------------------------------------------------------------------------- */
.js-loaded .reveal-fade {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-loaded .reveal-fade.is-inview {
  opacity: 1;
  transform: translateY(0);
}

/* Masked Image Reveal */
.img-reveal-mask {
  position: relative;
  overflow: hidden;
}

.img-reveal-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--color-aqua);
  transform: translateY(0);
  transition: transform 0.85s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 3;
}

.img-reveal-mask.is-revealed::after {
  transform: translateY(-101%);
}

/* Parallax Container */
.parallax-wrap {
  overflow: hidden;
}

.parallax-img {
  will-change: transform;
}

/* --------------------------------------------------------------------------
   3. Subtle Micro-Interactions & Hover Physics
   -------------------------------------------------------------------------- */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Animated Navigation Underline */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--color-teal);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
  width: 60%;
  left: 20%;
}

/* Magnetic Button Base */
.btn-magnetic {
  display: inline-flex;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Shimmer Loading / Accent Effect */
.shimmer-effect {
  position: relative;
  overflow: hidden;
}

.shimmer-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  animation: shimmerMove 3.5s infinite;
  pointer-events: none;
}

@keyframes shimmerMove {
  0% { left: -100%; }
  60%, 100% { left: 150%; }
}

/* Pulse Glow for Emergency & Accents */
.pulse-glow-emergency {
  animation: pulseGlow 2.2s infinite;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(230, 11, 73, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(230, 11, 73, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(230, 11, 73, 0);
  }
}

.pulse-glow-teal {
  animation: pulseTeal 2.5s infinite;
}

@keyframes pulseTeal {
  0% {
    box-shadow: 0 0 0 0 rgba(196, 84, 77, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(196, 84, 77, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(196, 84, 77, 0);
  }
}

/* --------------------------------------------------------------------------
   4. Page Fade Transition Overlay
   -------------------------------------------------------------------------- */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-navy);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.page-transition-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   5. Accessibility: Respect 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;
  }

  .custom-cursor {
    display: none !important;
  }

  .reveal-fade,
  .js-loaded .reveal-fade {
    opacity: 1 !important;
    transform: none !important;
  }

  .img-reveal-mask::after {
    display: none !important;
  }

  .floating-stat-badge {
    animation: none !important;
  }
}
