/* ============================================================
   ROYAL HEALTH CLUB — Animations
   ============================================================ */

/* ── Keyframes ── */
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-10px); }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
  50%       { box-shadow: 0 4px 40px rgba(37,211,102,0.7); }
}

@keyframes loader-fill {
  from { width: 0; }
  to   { width: 100%; }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes counter-tick {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes line-grow {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes particle-float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.4; }
  25%       { transform: translate(20px, -30px) rotate(90deg); opacity: 0.7; }
  50%       { transform: translate(-15px, -50px) rotate(180deg); opacity: 0.4; }
  75%       { transform: translate(25px, -20px) rotate(270deg); opacity: 0.7; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212,175,55,0.2); }
  50%       { box-shadow: 0 0 40px rgba(212,175,55,0.5), 0 0 80px rgba(212,175,55,0.2); }
}

@keyframes btn-shine {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ── Scroll Reveal Classes ── */
/* Initial hidden state */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.reveal-left {
  transform: translateX(-50px);
}

.reveal.reveal-right {
  transform: translateX(50px);
}

.reveal.reveal-scale {
  transform: scale(0.88);
}

.reveal.reveal-fast {
  transition-duration: 0.45s;
}

.reveal.reveal-slow {
  transition-duration: 1s;
}

/* Visible (triggered) state */
.reveal.visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.54s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hover & Interactive Effects ── */

/* Magnetic button hover effect */
.btn-magnetic {
  position: relative;
  overflow: hidden;
}

.btn-magnetic::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
  opacity: 0;
}

.btn-magnetic:active::after {
  width: 200px;
  height: 200px;
  opacity: 0;
}

/* Shine sweep on cards */
.shine-card {
  position: relative;
  overflow: hidden;
}

.shine-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.04),
    transparent
  );
  transition: left 0.6s ease;
}

.shine-card:hover::after { left: 150%; }

/* Glow border on focus/hover */
.glow-hover {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glow-hover:hover {
  box-shadow: 0 0 0 1px rgba(212,175,55,0.3),
              0 8px 32px rgba(0,0,0,0.4),
              0 0 60px rgba(212,175,55,0.08);
}

/* Float animation for decorative elements */
.float {
  animation: float-orb 6s ease-in-out infinite;
}

.float-slow {
  animation: float-orb 10s ease-in-out infinite;
}

/* Glowing logo/icon */
.glow-icon {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* Particles decoration */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.3;
  animation: particle-float linear infinite;
}

/* ── Text animations ── */
.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--gold-dark) 0%,
    var(--gold-light) 30%,
    var(--gold) 50%,
    var(--gold-light) 70%,
    var(--gold-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Page Transition ── */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}

.page-transition-overlay.entering { transform: translateY(0); }
.page-transition-overlay.leaving  { transform: translateY(-100%); }

/* ── Progress bar at top ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--gradient-gold);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── Hero image parallax wrapper ── */
.parallax-img {
  will-change: transform;
}

/* ── Form success animation ── */
@keyframes success-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.form-success {
  display: none;
  text-align: center;
  padding: 40px;
  animation: success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.form-success.show { display: block; }

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.success-title {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.success-text {
  font-size: 14px;
  color: var(--text-secondary);
}
