/* ============================================
   HAYAT NATIONAL HOSPITALS — Premium Animations
   ============================================ */

/* --- Fade In Animations --- */
.animate-on-scroll {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-on-scroll.animated { opacity: 1; transform: translateY(0); }

.animate-left {
  opacity: 0; transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
[dir="rtl"] .animate-left { transform: translateX(40px); }
.animate-left.animated { opacity: 1; transform: translateX(0); }

.animate-right {
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
[dir="rtl"] .animate-right { transform: translateX(-40px); }
.animate-right.animated { opacity: 1; transform: translateX(0); }

.animate-scale {
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-scale.animated { opacity: 1; transform: scale(1); }

/* --- Stagger Delays --- */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* --- Counter Animation --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Pulse Animation --- */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* --- Slide In --- */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Hero Entrance --- */
.hero-content h1 { animation: slideInUp 0.8s ease-out 0.2s both; }
.hero-content p { animation: slideInUp 0.8s ease-out 0.4s both; }
.hero-buttons { animation: slideInUp 0.8s ease-out 0.6s both; }
.hero-stats { animation: slideInUp 0.8s ease-out 0.8s both; }

/* --- Floating --- */
@keyframes floating {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
.floating { animation: floating 3s ease-in-out infinite; }

/* --- Spin --- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Bounce --- */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* --- Wave --- */
@keyframes wave {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

/* --- Gradient Shift --- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.gradient-animated { background-size: 200% 200%; animation: gradientShift 6s ease infinite; }

/* --- Typing Effect --- */
@keyframes blink-cursor {
  0%, 100% { border-right-color: transparent; }
  50% { border-right-color: var(--primary); }
}
.typing-cursor { border-right: 2px solid var(--primary); animation: blink-cursor 1s step-end infinite; }

/* --- Page Transition --- */
.page-transition { animation: fadeIn 0.4s ease-out; }

/* --- Hover Effects --- */
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.hover-glow { transition: box-shadow var(--transition); }
.hover-glow:hover { box-shadow: 0 0 24px rgba(0,102,204,0.2); }

/* --- Ripple Effect --- */
.ripple { position: relative; overflow: hidden; }
.ripple::before {
  content: ''; position: absolute; width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
  transform: scale(10); opacity: 0; transition: transform 0.5s, opacity 0.5s;
}
.ripple:active::before { transform: scale(0); opacity: 1; transition: 0s; }

/* --- Shimmer on Cards --- */
.card::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.6s ease; pointer-events: none; z-index: 1;
}
.card:hover::after { left: 100%; }

/* --- Parallax Layers --- */
.parallax-layer { will-change: transform; transition: transform 0.1s linear; }

/* --- Skeleton Loading --- */
@keyframes skeleton-loading {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton-pulse { animation: skeleton-loading 1.5s ease-in-out infinite; }

/* --- Toast Notification --- */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}
.toast { animation: toastIn 0.3s ease-out; }
.toast.hiding { animation: toastOut 0.3s ease-in forwards; }

/* --- Number Counting Glow --- */
.stat-number, .hero-stat .number {
  position: relative;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll, .animate-left, .animate-right, .animate-scale {
    opacity: 1; transform: none;
  }
}
