/* ============================================
   HEALTH GYM CLUB - Animations
   Scroll-triggered & CSS Animations
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

/* Hero Slideshow */
@keyframes slideshow {
  0% {
    opacity: 0;
    transform: scale(1.05);
  }
  4% {
    opacity: 1;
    transform: scale(1);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  29% {
    opacity: 0;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

/* Logo Reveal */
@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* Marquee Scroll */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Countdown Flip */
@keyframes countdownFlip {
  0% {
    transform: rotateX(0deg);
  }
  50% {
    transform: rotateX(-90deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(66, 149, 90, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(66, 149, 90, 0.6);
  }
}

/* Heartbeat Pulse - Animação de batimento cardíaco */
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

.text-glow-pulse {
  animation: heartbeat 1.5s ease-in-out infinite;
  display: inline-block;
  transform-origin: center;
}

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

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

/* ============================================
   Scroll-Triggered Animations
   ============================================ */

/* Fade Up */
.animate-fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade In */
.animate-fade-in {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.animate-fade-in.is-visible {
  opacity: 1;
}

/* Fade Left */
.animate-fade-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade Right */
.animate-fade-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale Reveal */
.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Clip Reveal */
.animate-clip {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s ease-out;
}

.animate-clip.is-visible {
  clip-path: inset(0 0 0 0);
}

/* Stagger Delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
.stagger-7 { transition-delay: 0.7s; }
.stagger-8 { transition-delay: 0.8s; }
.stagger-9 { transition-delay: 0.9s; }
.stagger-10 { transition-delay: 1s; }

/* ============================================
   NEW CREATIVE SCROLL ANIMATIONS
   ============================================ */

/* Blur Reveal - Elementos aparecem desfocados e focam */
.animate-blur-reveal {
  opacity: 0;
  filter: blur(20px);
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-blur-reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Rotate In - Elementos rotacionam ao entrar */
.animate-rotate-in {
  opacity: 0;
  transform: rotate(-10deg) translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-rotate-in.is-visible {
  opacity: 1;
  transform: rotate(0deg) translateY(0);
}

/* Slide Diagonal - Desliza na diagonal */
.animate-slide-diagonal {
  opacity: 0;
  transform: translate(-50px, 50px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-diagonal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Elastic Scale - Escala com efeito elástico */
.animate-elastic {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.6s ease-out, transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-elastic.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Flip In - Efeito 3D de virada */
.animate-flip-in {
  opacity: 0;
  transform: perspective(1000px) rotateX(-60deg);
  transform-origin: top center;
  transition: opacity 0.6s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-flip-in.is-visible {
  opacity: 1;
  transform: perspective(1000px) rotateX(0deg);
}

/* Slide Up with Bounce */
.animate-bounce-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.5s ease-out, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-bounce-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Zoom Fade - Zoom com fade suave */
.animate-zoom-fade {
  opacity: 0;
  transform: scale(1.2);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-zoom-fade.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Curtain Reveal - Efeito de cortina */
.animate-curtain {
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.animate-curtain.is-visible {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Slide from Center - Expande do centro */
.animate-expand-center {
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: opacity 0.6s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-expand-center.is-visible {
  opacity: 1;
  transform: scaleX(1);
}

/* Glitch In - Efeito glitch moderno */
@keyframes glitchIn {
  0% {
    opacity: 0;
    transform: translate(0);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  20% {
    opacity: 1;
    transform: translate(-5px, 5px);
    clip-path: polygon(0 20%, 100% 20%, 100% 80%, 0 80%);
  }
  40% {
    transform: translate(5px, -5px);
    clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
  }
  60% {
    transform: translate(-3px, 3px);
    clip-path: polygon(0 10%, 100% 10%, 100% 90%, 0 90%);
  }
  80% {
    transform: translate(3px, -3px);
    clip-path: polygon(0 5%, 100% 5%, 100% 95%, 0 95%);
  }
  100% {
    opacity: 1;
    transform: translate(0);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

.animate-glitch {
  opacity: 0;
}

.animate-glitch.is-visible {
  animation: glitchIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Text Reveal - Revela texto letra por letra (container) */
.animate-text-reveal {
  overflow: hidden;
}

.animate-text-reveal > * {
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-text-reveal.is-visible > * {
  transform: translateY(0);
}

/* Parallax Fade - Fade com efeito parallax sutil */
.animate-parallax-fade {
  opacity: 0;
  transform: translateY(80px) scale(0.95);
  transition: opacity 0.8s ease-out, transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-parallax-fade.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Split Reveal - Revela dividindo ao meio */
.animate-split-reveal {
  position: relative;
  overflow: hidden;
}

.animate-split-reveal::before,
.animate-split-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: #000;
  z-index: 10;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.animate-split-reveal::before {
  left: 0;
}

.animate-split-reveal::after {
  right: 0;
}

.animate-split-reveal.is-visible::before {
  transform: translateX(-100%);
}

.animate-split-reveal.is-visible::after {
  transform: translateX(100%);
}

/* Morph In - Entrada com morphing */
.animate-morph {
  opacity: 0;
  border-radius: 50%;
  transform: scale(0.8);
  transition: opacity 0.6s ease-out,
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-radius 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-morph.is-visible {
  opacity: 1;
  border-radius: 0;
  transform: scale(1);
}

/* Swing In - Balanço ao entrar */
@keyframes swingIn {
  0% {
    opacity: 0;
    transform: rotateZ(-30deg) translateY(-40px);
    transform-origin: top center;
  }
  50% {
    transform: rotateZ(15deg);
  }
  70% {
    transform: rotateZ(-10deg);
  }
  85% {
    transform: rotateZ(5deg);
  }
  100% {
    opacity: 1;
    transform: rotateZ(0deg) translateY(0);
  }
}

.animate-swing {
  opacity: 0;
  transform-origin: top center;
}

.animate-swing.is-visible {
  animation: swingIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Typewriter Line - Linha que revela conteúdo */
.animate-typewriter {
  position: relative;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-typewriter.is-visible {
  width: 100%;
}

/* Glow Reveal - Aparece com brilho */
.animate-glow-reveal {
  opacity: 0;
  transform: translateY(20px);
  filter: brightness(0.5);
  transition: opacity 0.6s ease-out,
              transform 0.6s ease-out,
              filter 0.8s ease-out;
}

.animate-glow-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: brightness(1);
}

/* Cascade - Efeito cascata para listas */
.animate-cascade > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-cascade.is-visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(7) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }
.animate-cascade.is-visible > *:nth-child(8) { transition-delay: 0.7s; opacity: 1; transform: translateY(0); }

/* ============================================
   Hero Specific Animations
   ============================================ */

.hero-title {
  opacity: 0;
  transform: translateY(30px);
  animation: heroTextReveal 0.8s ease-out 0.3s forwards;
}

.hero-tagline {
  opacity: 0;
  transform: translateY(20px);
  animation: heroTextReveal 0.8s ease-out 0.5s forwards;
}

.unit-selector {
  opacity: 0;
  transform: translateY(30px);
  animation: heroTextReveal 0.8s ease-out 0.7s forwards;
}

@keyframes heroTextReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Card Hover Animations
   ============================================ */

.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Image Zoom on Hover */
.image-zoom {
  overflow: hidden;
}

.image-zoom img {
  transition: transform 0.5s ease;
}

.image-zoom:hover img {
  transform: scale(1.1);
}

/* ============================================
   Button Animations
   ============================================ */

.btn-animate {
  position: relative;
  overflow: hidden;
}

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

.btn-animate:hover::after {
  width: 300px;
  height: 300px;
}

/* ============================================
   Loading States
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-green-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   Countdown Animation Styles
   ============================================ */

.countdown-number {
  perspective: 300px;
}

.countdown-digit {
  display: inline-block;
  backface-visibility: hidden;
}

.countdown-flip .countdown-digit {
  animation: countdownFlip 0.5s ease-in-out;
}

/* ============================================
   Marquee Animation
   ============================================ */

.marquee-content {
  display: flex;
  width: max-content;
}

.marquee:hover .marquee-content {
  animation-play-state: paused;
}

/* ============================================
   Floating Elements
   ============================================ */

.float {
  animation: float 3s ease-in-out infinite;
}

.pulse {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ============================================
   Page Transition
   ============================================ */

.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-black);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-transition.active {
  opacity: 1;
}

/* ============================================
   Text Reveal
   ============================================ */

.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.6s ease-out;
}

.text-reveal.is-visible span {
  transform: translateY(0);
}

/* Staggered text reveal for words */
.text-reveal span:nth-child(1) { transition-delay: 0s; }
.text-reveal span:nth-child(2) { transition-delay: 0.05s; }
.text-reveal span:nth-child(3) { transition-delay: 0.1s; }
.text-reveal span:nth-child(4) { transition-delay: 0.15s; }
.text-reveal span:nth-child(5) { transition-delay: 0.2s; }
.text-reveal span:nth-child(6) { transition-delay: 0.25s; }
.text-reveal span:nth-child(7) { transition-delay: 0.3s; }
.text-reveal span:nth-child(8) { transition-delay: 0.35s; }
.text-reveal span:nth-child(9) { transition-delay: 0.4s; }
.text-reveal span:nth-child(10) { transition-delay: 0.45s; }

/* ============================================
   Activity Card Expand Animation
   ============================================ */

.activity-card {
  transition: all 0.3s ease;
}

.activity-card .activity-description {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.activity-card.expanded .activity-description {
  max-height: 200px;
  opacity: 1;
}

/* ============================================
   FAQ Accordion Animation
   ============================================ */

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* ============================================
   Responsive Animation Adjustments
   ============================================ */

@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;
  }

  .animate-fade-up,
  .animate-fade-in,
  .animate-fade-left,
  .animate-fade-right,
  .animate-scale,
  .animate-clip {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}

/* Disable some animations on mobile for performance */
@media (max-width: 768px) {
  .hero-slide {
    animation-duration: 24s;
  }

  .marquee-content {
    animation-duration: 40s;
  }
}
