/* ==================== UNIVERSAL ANIMATIONS ==================== */

/* Prepare elements for animation */
[class*="animate-"] {
  opacity: 0;
}

/* Animation classes */
.animate-fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-down {
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-left {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-right {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Visible state */
.animate-in,
.is-visible {
  opacity: 1 !important;
  transform: translate(0) scale(1) !important;
}

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

.animate-stagger > *:nth-child(1) { transition-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { transition-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { transition-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { transition-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { transition-delay: 0.5s; }
.animate-stagger > *:nth-child(6) { transition-delay: 0.6s; }
.animate-stagger > *:nth-child(7) { transition-delay: 0.7s; }
.animate-stagger > *:nth-child(8) { transition-delay: 0.8s; }

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

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

@keyframes glow {
  0%, 100% { box-shadow: 0 5px 20px rgba(0, 191, 255, 0.3); }
  50% { box-shadow: 0 10px 40px rgba(0, 191, 255, 0.5); }
}

.service-card,
.country-card,
.bank-card,
.price-card,
.accounting-card,
.it-card,
.article__card,
.kik-card,
.process-step,
.news-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.country-card:hover,
.bank-card:hover,
.price-card:hover,
.accounting-card:hover,
.it-card:hover,
.article__card:hover,
.kik-card:hover,
.process-step:hover,
.news-card:hover {
  animation: float 2s ease-in-out infinite, glow 2s ease-in-out infinite;
}

/* Hero background animations */
@keyframes heroWave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(1deg); }
  50% { transform: translateY(0) rotate(-1deg); }
  75% { transform: translateY(20px) rotate(1deg); }
}

.hero__bg,
.audit-hero__bg,
.banks-hero__bg,
.other-hero__bg,
.accounting-hero__bg {
  animation: heroWave 20s ease-in-out infinite;
}

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

.hero__title,
.audit-hero__title,
.banks-hero__title,
.other-hero__title,
.accounting-hero__title {
  background: linear-gradient(
    90deg,
    #ffffff 25%,
    var(--brand-light) 50%,
    #ffffff 75%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
  animation-play-state: paused;
}

.hero__title:hover,
.audit-hero__title:hover,
.banks-hero__title:hover,
.other-hero__title:hover,
.accounting-hero__title:hover {
  animation-play-state: running;
}

/* Counter animation */
@keyframes countUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card__number,
.banks-hero__number {
  animation: countUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.btn--primary {
  animation: pulse 2s ease-in-out infinite;
  animation-play-state: paused;
}

.btn--primary:hover {
  animation-play-state: running;
}

/* Loading state */
@keyframes loadingDots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  80%, 100% { content: ''; }
}

.loading::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

/* Ensure animations work on mobile */
@media (max-width: 768px) {
  /* Reduce motion for mobile */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* Faster animations on mobile */
  .animate-fade-up,
  .animate-fade-down,
  .animate-fade-left,
  .animate-fade-right,
  .animate-scale {
    transition-duration: 0.5s;
  }
}
