/**
 * Animations - Telur Omega Premium
 * Scroll reveal, keyframes, transitions
 */

/* ===== SCROLL REVEAL ===== */
/* Default: selalu visible - hapus effect hide buat simplest fix */
.reveal {
  /* opacity: 0 dan transform делает элемент tidak terlihat sampai диengar скролл - kita hapus и biarkan visible */
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  /* Kelas ini ditambahkan JS saat scroll - opsional */
}

/* Staggered delays for grid items */
.keunggulan-card:nth-child(1) { transition-delay: 0.1s; }
.keunggulan-card:nth-child(2) { transition-delay: 0.2s; }
.keunggulan-card:nth-child(3) { transition-delay: 0.3s; }
.keunggulan-card:nth-child(4) { transition-delay: 0.4s; }

.product-card:nth-child(1) { transition-delay: 0.1s; }
.product-card:nth-child(2) { transition-delay: 0.2s; }
.product-card:nth-child(3) { transition-delay: 0.3s; }
.product-card:nth-child(4) { transition-delay: 0.4s; }
.product-card:nth-child(5) { transition-delay: 0.5s; }
.product-card:nth-child(6) { transition-delay: 0.6s; }

.testimoni-card:nth-child(1) { transition-delay: 0.1s; }
.testimoni-card:nth-child(2) { transition-delay: 0.2s; }
.testimoni-card:nth-child(3) { transition-delay: 0.3s; }

.nilai-card:nth-child(1) { transition-delay: 0.1s; }
.nilai-card:nth-child(2) { transition-delay: 0.2s; }
.nilai-card:nth-child(3) { transition-delay: 0.3s; }
.nilai-card:nth-child(4) { transition-delay: 0.4s; }

.standar-card:nth-child(1) { transition-delay: 0.1s; }
.standar-card:nth-child(2) { transition-delay: 0.2s; }
.standar-card:nth-child(3) { transition-delay: 0.3s; }
.standar-card:nth-child(4) { transition-delay: 0.4s; }

.sertifikasi-card:nth-child(1) { transition-delay: 0.1s; }
.sertifikasi-card:nth-child(2) { transition-delay: 0.2s; }
.sertifikasi-card:nth-child(3) { transition-delay: 0.3s; }

.timeline-item:nth-child(1) { transition-delay: 0.1s; }
.timeline-item:nth-child(2) { transition-delay: 0.2s; }
.timeline-item:nth-child(3) { transition-delay: 0.3s; }
.timeline-item:nth-child(4) { transition-delay: 0.4s; }
.timeline-item:nth-child(5) { transition-delay: 0.5s; }

.proses-step:nth-child(1) { transition-delay: 0.1s; }
.proses-step:nth-child(2) { transition-delay: 0.15s; }
.proses-step:nth-child(3) { transition-delay: 0.2s; }
.proses-step:nth-child(4) { transition-delay: 0.25s; }
.proses-step:nth-child(5) { transition-delay: 0.3s; }

.proses-connector:nth-child(2) { transition-delay: 0.1s; }
.proses-connector:nth-child(4) { transition-delay: 0.2s; }
.proses-connector:nth-child(6) { transition-delay: 0.3s; }
.proses-connector:nth-child(8) { transition-delay: 0.4s; }

/* ===== WHATSAPP FLOATING BUTTON ===== */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: var(--wa-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 9999;
  animation: wa-pulse 2s infinite;
  transition: transform 0.3s ease;
}

.wa-float:hover {
  transform: scale(1.1);
}

.wa-float svg {
  width: 28px;
  height: 28px;
  color: var(--white);
}

.wa-tooltip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--brown);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  margin-right: 12px;
}

.wa-float:hover .wa-tooltip {
  opacity: 1;
  visibility: visible;
}

@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ===== HOVER EFFECTS ===== */
.product-card,
.keunggulan-card,
.nilai-card,
.standar-card,
.sertifikasi-card,
.testimoni-card {
  will-change: transform, box-shadow;
}

.product-card:hover,
.keunggulan-card:hover,
.nilai-card:hover,
.standar-card:hover,
.sertifikasi-card:hover,
.testimoni-card:hover {
  transform: translateY(-4px);
}

/* ===== BUTTON HOVER ===== */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::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.4s ease, height 0.4s ease;
}

.btn:active::after {
  width: 200px;
  height: 200px;
}

/* ===== LINK HOVER ANIMATION ===== */
.navbar-menu a,
.footer-links a {
  position: relative;
}

.navbar-menu a::after,
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--amber);
  transition: width 0.3s ease;
}

.navbar-menu a:hover::after,
.footer-links a:hover::after {
  width: 100%;
}

/* ===== SMOOTH SCROLL ===== */
html {
  scroll-behavior: smooth;
}

/* ===== PAGE LOAD ANIMATION ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content > * {
  animation: fadeInUp 0.6s ease forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }

/* ===== HERO IMAGE FLOAT ===== */
.hero-image-placeholder {
  animation: float 6s ease-in-out infinite;
}

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

/* ===== TRUST BAR ITEMS ===== */
.trust-item {
  display: inline-flex;
  align-items: center;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.trust-item:nth-child(1) { animation-delay: 0.5s; }
.trust-item:nth-child(2) { animation-delay: 0.6s; }
.trust-item:nth-child(3) { animation-delay: 0.7s; }
.trust-item:nth-child(4) { animation-delay: 0.8s; }

/* ===== SECTION TRANSITION ===== */
.section {
  position: relative;
}

/* ===== PRODUCT BADGE ANIMATION ===== */
.product-badge {
  animation: slideIn 0.3s ease;
}

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

/* ===== TESTIMONI STARS ===== */
.testimoni-stars {
  animation: starPop 0.4s ease;
}

@keyframes starPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* ===== CTA BANNER ===== */
.cta-banner-content {
  animation: fadeInUp 0.6s ease;
}

/* ===== INPUT FOCUS ===== */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  transform: translateY(-2px);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--shell);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brown-light);
}

/* ===== SELECTION COLOR ===== */
::selection {
  background-color: var(--amber);
  color: var(--white);
}

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

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

  .wa-float {
    animation: none;
  }
}