/* ============================================
   Delvin Psychology Clinic — Animations
   ============================================ */

/* --- Hero gradient drift --- */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.hero {
  animation: gradientShift 14s ease infinite;
}

/* --- Gallery infinite scroll --- */
@keyframes galleryScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* RTL: scroll in opposite direction */
[dir="rtl"] .gallery-track {
  animation-direction: reverse;
}

/* --- Fade in up --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Service cards stagger --- */
.service-card.visible {
  animation: fadeInUp 0.6s var(--ease) both;
}

.service-card:nth-child(1).visible { animation-delay: 0s; }
.service-card:nth-child(2).visible { animation-delay: 0.1s; }
.service-card:nth-child(3).visible { animation-delay: 0.2s; }
.service-card:nth-child(4).visible { animation-delay: 0.3s; }

/* --- Why cards stagger --- */
.why-card.visible {
  animation: fadeInUp 0.6s var(--ease) both;
}

.why-card:nth-child(1).visible { animation-delay: 0s; }
.why-card:nth-child(2).visible { animation-delay: 0.12s; }
.why-card:nth-child(3).visible { animation-delay: 0.24s; }

/* --- Team cards stagger --- */
.team-card.visible {
  animation: fadeInUp 0.6s var(--ease) both;
}

.team-card:nth-child(1).visible { animation-delay: 0s; }
.team-card:nth-child(2).visible { animation-delay: 0.15s; }

/* --- Stat items stagger --- */
.stat-item.visible {
  animation: fadeInUp 0.5s var(--ease) both;
}

.stat-item:nth-child(1).visible { animation-delay: 0s; }
.stat-item:nth-child(2).visible { animation-delay: 0.08s; }
.stat-item:nth-child(3).visible { animation-delay: 0.16s; }
.stat-item:nth-child(4).visible { animation-delay: 0.24s; }

/* --- Button shimmer --- */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

/* --- Navbar logo hover pulse --- */
@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

.navbar-logo:hover {
  animation: logoPulse 0.5s ease;
}

/* --- Language toggle --- */
.lang-toggle button {
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}

.lang-toggle button:active {
  transform: scale(0.94);
}

/* --- Mobile menu stagger --- */
/* child 1: lang-btn, children 2-6: nav links */
.mobile-nav.open .lang-btn {
  animation: fadeInUp 0.35s var(--ease) both;
  animation-delay: 0.03s;
}

.mobile-nav.open a {
  animation: fadeInUp 0.4s var(--ease) both;
}

.mobile-nav.open a:nth-child(2) { animation-delay: 0.08s; }
.mobile-nav.open a:nth-child(3) { animation-delay: 0.13s; }
.mobile-nav.open a:nth-child(4) { animation-delay: 0.18s; }
.mobile-nav.open a:nth-child(5) { animation-delay: 0.23s; }
.mobile-nav.open a:nth-child(6) { animation-delay: 0.28s; }

/* --- Hero float badge pulse --- */
@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.hero-float-badge {
  animation: floatBadge 4s ease-in-out infinite;
}

/* --- Team initials glow on hover --- */
@keyframes initialsGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 154, 184, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(74, 154, 184, 0.2); }
}

.team-card:hover .team-initials {
  animation: initialsGlow 1.5s ease-in-out infinite;
}

/* --- Scroll indicator bounce --- */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%       { transform: translateY(8px); opacity: 0.5; }
}

.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}

/* --- 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;
  }

  .hero { animation: none; }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .gallery-track {
    animation: none;
  }

  .hero-float-badge {
    animation: none;
  }
}
