/* ================================================================
   COWAY INDONESIA - LANDING PAGE
   animation.css - Animations & Keyframes
================================================================ */

/* ----------------------------------------------------------------
   1. KEYFRAME DEFINITIONS
---------------------------------------------------------------- */

/* Fade In animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(1deg); }
  66% { transform: translateY(-4px) rotate(-1deg); }
}

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

@keyframes pulseFast {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

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

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

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

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

/* Wave */
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

/* Bounce */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-20px);
  }
  70% {
    transform: translateY(-10px);
  }
  90% {
    transform: translateY(-4px);
  }
}

/* Heartbeat */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

/* Gradient flow */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Orb movement */
@keyframes orbMove {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 10px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Typing cursor */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Ripple */
@keyframes ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Spin in */
@keyframes spinIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* ----------------------------------------------------------------
   2. ANIMATION UTILITY CLASSES
---------------------------------------------------------------- */

.animate-fadeIn {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.7s ease forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.7s ease forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.7s ease forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.animate-float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

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

.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-rotate-slow {
  animation: rotateSlow 8s linear infinite;
}

.animate-bounce {
  animation: bounce 1.2s ease infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-wave {
  animation: wave 0.5s ease-in-out infinite alternate;
}

/* ----------------------------------------------------------------
   3. HERO ANIMATIONS
---------------------------------------------------------------- */

.hero-content > * {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-badge {
  animation-delay: 0.1s;
}

.hero-title {
  animation-delay: 0.2s;
}

.hero-subtitle {
  animation-delay: 0.35s;
}

.hero-cta-group {
  animation-delay: 0.5s;
}

.hero-stats {
  animation-delay: 0.65s;
}

.hero-image-frame {
  opacity: 0;
  animation: fadeInRight 1s ease 0.3s forwards;
}

.hero-float-badge-1 {
  animation: float-badge 3s ease-in-out infinite;
  opacity: 0;
  animation: float-badge 3s ease-in-out 0.8s infinite, fadeIn 0.6s ease 0.8s forwards;
}

.hero-float-badge-2 {
  opacity: 0;
  animation: float-badge 3s ease-in-out 2.3s infinite, fadeIn 0.6s ease 1.1s forwards;
}

@keyframes float-badge {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* ----------------------------------------------------------------
   4. HERO BG ORB ANIMATIONS
---------------------------------------------------------------- */

.hero-bg-orb-1 {
  animation: orbMove 12s ease-in-out infinite;
}

.hero-bg-orb-2 {
  animation: orbMove 15s ease-in-out 2s infinite reverse;
}

/* ----------------------------------------------------------------
   5. SHIMMER GRADIENT TEXT
---------------------------------------------------------------- */
.gradient-text-animated {
  background: linear-gradient(
    270deg,
    #00AEEF,
    #0D6EFD,
    #7FD4F5,
    #00AEEF
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 3s linear infinite;
}

/* ----------------------------------------------------------------
   6. CARD HOVER ANIMATIONS
---------------------------------------------------------------- */

/* Why card icon hover */
.why-card:hover .why-card-icon {
  animation: pulseFast 0.4s ease-in-out;
}

/* Product card image hover */
.product-card:hover .product-card-image img {
  animation: float 2.5s ease-in-out infinite;
}

/* How step hover */
.how-step:hover .how-step-number {
  animation: heartbeat 1s ease-in-out;
}

/* ----------------------------------------------------------------
   7. SCROLL INDICATOR ENHANCED
---------------------------------------------------------------- */

.scroll-indicator {
  animation: fadeIn 0.6s ease 1.5s both;
}

.scroll-indicator-dot {
  animation: scroll-dot 1.8s ease-in-out infinite;
}

@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  71% { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ----------------------------------------------------------------
   8. WHATSAPP BUTTON ANIMATIONS
---------------------------------------------------------------- */

/* First ring */
.sticky-wa-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.5);
  animation: wa-ripple 2s ease-out infinite;
}

/* Second ring */
.sticky-wa-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.3);
  animation: wa-ripple 2s ease-out 0.5s infinite;
}

@keyframes wa-ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ----------------------------------------------------------------
   9. COUNTER ANIMATION
---------------------------------------------------------------- */

.stat-number {
  animation: countUp 0.4s ease both;
}

/* ----------------------------------------------------------------
   10. FAQ ACCORDION ANIMATION
---------------------------------------------------------------- */

.faq-answer {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.faq-item.open .faq-answer {
  opacity: 1;
}

.faq-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.2s ease,
              color 0.2s ease;
}

/* ----------------------------------------------------------------
   11. LOADING BAR ANIMATION
---------------------------------------------------------------- */

.loader-logo {
  animation: pulseFast 1s ease-in-out infinite;
}

/* ----------------------------------------------------------------
   12. TRUST BAR MARQUEE (optional, for mobile auto-scroll)
---------------------------------------------------------------- */

@media (max-width: 640px) {
  .trust-bar-inner {
    animation: marquee 20s linear infinite;
    white-space: nowrap;
    flex-wrap: nowrap;
    width: max-content;
  }

  @keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
}

/* ----------------------------------------------------------------
   13. PAGE TRANSITIONS
---------------------------------------------------------------- */

.page-enter {
  animation: fadeIn 0.4s ease forwards;
}

/* ----------------------------------------------------------------
   14. TOAST NOTIFICATION
---------------------------------------------------------------- */

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  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.9);
  }
}

.toast-enter {
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-exit {
  animation: toastOut 0.2s ease forwards;
}

/* ----------------------------------------------------------------
   15. GRADIENT BORDERS
---------------------------------------------------------------- */

.gradient-border {
  position: relative;
  background: var(--color-white);
  background-clip: padding-box;
  border: 2px solid transparent;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-primary);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
  opacity: 1;
}

/* ----------------------------------------------------------------
   16. PRODUCT CARD SHINE EFFECT
---------------------------------------------------------------- */

.product-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

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

/* ----------------------------------------------------------------
   17. STAGGER CHILDREN
---------------------------------------------------------------- */

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

/* ----------------------------------------------------------------
   18. TESTIMONIAL SLIDER TRANSITION
---------------------------------------------------------------- */

.testimonials-track {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------------------------------
   19. COMPARISON TABLE ROW HOVER
---------------------------------------------------------------- */

.comparison-table tr {
  transition: background-color 0.2s ease;
}

/* ----------------------------------------------------------------
   20. SPECIAL EFFECTS
---------------------------------------------------------------- */

/* Glow effect for primary button */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.2) 0%,
    transparent 50%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::after {
  opacity: 1;
}

/* WhatsApp button hover glow */
.btn-whatsapp {
  position: relative;
  overflow: hidden;
}

.btn-whatsapp::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-whatsapp:hover::after {
  opacity: 1;
}
