/* ============================================================
   HAPI GRAND TOUR — Animations Stylesheet
   ============================================================ */

/* ------------------------------------------------------------
   @keyframes Definitions
------------------------------------------------------------ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Magazine slide-in from left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Magazine slide-in from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Scroll chevron perpetual bounce */
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(10px); }
}

/* WhatsApp floating button pulse ring */
@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(37,211,102,0.55), 0 4px 24px rgba(37,211,102,0.48);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37,211,102,0), 0 4px 24px rgba(37,211,102,0.48);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37,211,102,0), 0 4px 24px rgba(37,211,102,0.48);
  }
}

/* Gold shimmer sweep for VIP banner */
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Navbar slide-down entrance */
@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stat card pop entrance */
@keyframes statPop {
  0%   { transform: scale(0.82); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

/* Hero background slow ken-burns zoom — still used when no video */
@keyframes heroBgZoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1.00); }
}

/* Why-card icon spring wobble */
@keyframes iconWobble {
  0%   { transform: rotate(0deg)  scale(1); }
  35%  { transform: rotate(-9deg) scale(1.14); }
  70%  { transform: rotate(5deg)  scale(1.06); }
  100% { transform: rotate(0deg)  scale(1); }
}

/* Itinerary dot ping on hover */
@keyframes dotPing {
  0%   { box-shadow: 0 0 0 0 rgba(201,168,76,0.55), 0 4px 16px rgba(201,168,76,0.25); }
  70%  { box-shadow: 0 0 0 12px rgba(201,168,76,0), 0 4px 16px rgba(201,168,76,0.25); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,76,0), 0 4px 16px rgba(201,168,76,0.25); }
}

/* Cinematic fade-in for full-vh sections */
@keyframes cinematicIn {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------
   Navbar entrance
------------------------------------------------------------ */
#site-header {
  animation: navSlideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ------------------------------------------------------------
   Hero content — immediate CSS animations (no JS)
------------------------------------------------------------ */
.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.animate-fade-up.delay-1 { animation-delay: 0.28s; }
.animate-fade-up.delay-2 { animation-delay: 0.54s; }
.animate-fade-up.delay-3 { animation-delay: 0.80s; }

/* ------------------------------------------------------------
   Scroll-reveal — initial state (JS adds .visible)
------------------------------------------------------------ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity  0.68s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.68s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for sibling grid children */
.animate-on-scroll.delay-1 { transition-delay: 0.10s; }
.animate-on-scroll.delay-2 { transition-delay: 0.20s; }
.animate-on-scroll.delay-3 { transition-delay: 0.30s; }
.animate-on-scroll.delay-4 { transition-delay: 0.40s; }
.animate-on-scroll.delay-5 { transition-delay: 0.50s; }

/* ------------------------------------------------------------
   Scroll chevron bounce
------------------------------------------------------------ */
.animate-bounce {
  animation: bounce 2.2s ease-in-out infinite;
}

/* ------------------------------------------------------------
   WhatsApp float pulse
------------------------------------------------------------ */
.whatsapp-float {
  animation: pulseRing 2.8s ease-out infinite;
}

.whatsapp-float:hover {
  animation: none; /* stop jitter on hover */
}

/* ------------------------------------------------------------
   Hero background ken-burns — applied to fallback image only;
   video provides its own natural motion
------------------------------------------------------------ */
.hero-bg-img {
  animation: heroBgZoom 20s ease-out forwards;
}

/* Video fades in smoothly once loaded */
.hero-video {
  animation: fadeIn 1.2s ease forwards;
}

/* ------------------------------------------------------------
   VIP banner shimmer border
------------------------------------------------------------ */
.vip-banner {
  background: linear-gradient(
    105deg,
    #9a7830 0%,
    #c9a84c 25%,
    #e2c97a 50%,
    #c9a84c 75%,
    #9a7830 100%
  );
  background-size: 300% 300%;
  animation: shimmer 5s ease infinite;
}

/* ------------------------------------------------------------
   Highlight card image hover zoom (CSS-only, no JS)
------------------------------------------------------------ */
.highlight-card-img-wrap { overflow: hidden; }

.card-gradient {
  transition: transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}
.highlight-card:hover .card-gradient { transform: scale(1.09); }

/* ------------------------------------------------------------
   Why-card icon wobble on hover
------------------------------------------------------------ */
.why-card:hover .why-card-icon {
  animation: iconWobble 0.52s ease-out;
}

/* ------------------------------------------------------------
   Stat item pop when revealed
------------------------------------------------------------ */
.stats-grid .stat-item.animate-on-scroll.visible {
  animation: statPop 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   Facility card tighter initial offset
------------------------------------------------------------ */
.facilities-grid .facility-card.animate-on-scroll {
  transform: translateY(18px);
}

/* ------------------------------------------------------------
   Destination title overlay fade-in on scroll
------------------------------------------------------------ */
.destination-title-overlay {
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------
   Full-viewport-height destination image — cinematic entrance
------------------------------------------------------------ */
.destination-hero-image--fullvh .dest-kk,
.destination-hero-image--fullvh .dest-semporna {
  transform: scale(1.06);
  transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.destination-hero-image--fullvh.in-view .dest-kk,
.destination-hero-image--fullvh.in-view .dest-semporna {
  transform: scale(1);
}

.resort-hero--fullvh .resort-hero-bg {
  transform: scale(1.06);
  transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.resort-hero--fullvh.in-view .resort-hero-bg {
  transform: scale(1);
}

/* ------------------------------------------------------------
   Itinerary timeline — day card slide-in from right
------------------------------------------------------------ */
.itinerary-day .itinerary-day-card {
  transition:
    background var(--t-base),
    border-color var(--t-base),
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.itinerary-day:hover .itinerary-day-dot {
  animation: dotPing 1.2s ease-out;
}

/* Stagger animation for itinerary days via .animate-on-scroll */
.itinerary-timeline .animate-on-scroll {
  transform: translateX(24px);
  opacity: 0;
}
.itinerary-timeline .animate-on-scroll.visible {
  transform: translateX(0);
  opacity: 1;
}

/* ------------------------------------------------------------
   prefers-reduced-motion — disable all 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;
  }

  .whatsapp-float     { animation: none; }
  .animate-on-scroll  { opacity: 1; transform: none; transition: none; }
  .animate-fade-up    { opacity: 1; animation: none; }
  .animate-bounce     { animation: none; }
  .card-gradient      { transition: none; }
  .vip-banner         { animation: none; }
  .hero-bg-img        { animation: none; }
  .hero-video         { animation: none; }
  .destination-hero-image--fullvh .dest-kk,
  .destination-hero-image--fullvh .dest-semporna,
  .resort-hero--fullvh .resort-hero-bg { transform: none; transition: none; }
  .itinerary-timeline .animate-on-scroll { transform: none; }
  .destination-bg-img--parallax { transition: none; }
}
