/**
 * MYM Travels Sri Lanka — Luxury Bespoke Motion Engine
 * Graceful, silky, hardware-accelerated animations calibrated for premium luxury travel.
 * Emil Kowalski's Design Engineering & UI/UX Pro Max Principles.
 */

:root {
  /* Silky smooth luxury easing curves */
  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.25, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  
  /* Reduced, refined timing hierarchy (calm & deliberate) */
  --dur-fast: 200ms;
  --dur-subtle: 320ms;
  --dur-smooth: 500ms;
  --dur-luxury: 680ms;
  --dur-graceful: 950ms;
}

/* ================= 1. REFINED TACTILE BUTTONS & CTAS ================= */
button, 
.btn-press,
a[class*="bg-sunset"],
a[class*="bg-ceylon"],
a[class*="bg-gradient"],
button[id*="Btn"],
.theme-toggle-btn {
  transition: transform var(--dur-subtle) var(--ease-luxury), 
              box-shadow var(--dur-subtle) var(--ease-luxury), 
              background-color var(--dur-subtle) var(--ease-luxury), 
              filter var(--dur-subtle) var(--ease-luxury) !important;
  will-change: transform;
}

button:hover,
.btn-press:hover,
a[class*="bg-sunset"]:hover,
a[class*="bg-ceylon"]:hover,
a[class*="bg-gradient"]:hover {
  transform: translateY(-2.5px);
  filter: brightness(1.04);
}

button:active:not(:disabled),
.btn-press:active,
a[class*="bg-sunset"]:active,
a[class*="bg-ceylon"]:active,
a[class*="bg-gradient"]:active,
button[id*="Btn"]:active {
  transform: scale(0.975) translateY(0) !important;
  transition-duration: 140ms !important;
}

/* Luxurious Slow Button Light Sweep */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  animation: btnShine 6s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes btnShine {
  0% { left: -100%; }
  20%, 100% { left: 150%; }
}

/* ================= 2. GRACEFUL SCROLL REVEAL (680ms Silky Ease) ================= */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-luxury) var(--ease-luxury), 
              transform var(--dur-luxury) var(--ease-luxury);
  will-change: opacity, transform;
}

.scroll-reveal.is-revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Graceful Orchestrated Stagger Delays */
.delay-1 { transition-delay: 80ms !important; }
.delay-2 { transition-delay: 160ms !important; }
.delay-3 { transition-delay: 240ms !important; }
.delay-4 { transition-delay: 320ms !important; }
.delay-5 { transition-delay: 400ms !important; }
.delay-6 { transition-delay: 480ms !important; }

/* ================= 3. HERO & HEADLINE AESTHETICS ================= */
/* Subtle, Slow-Flowing Gold & Sunset Text Shimmer */
.hero-gradient-text {
  background: linear-gradient(110deg, #fdba74 0%, #f59e0b 25%, #ffffff 50%, #f59e0b 75%, #fdba74 100%);
  background-size: 220% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textShine 8s ease-in-out infinite;
}

@keyframes textShine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* Calming Beacon Glow in Badges */
@keyframes beaconGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.35; }
}
.beacon-pulse {
  animation: beaconGlow 2.8s ease-in-out infinite;
}

/* Cinematic Slow Zoom on Active Hero Images */
.hero-slide.opacity-100 img {
  animation: kenBurnsZoom 14s ease-out infinite alternate;
}

@keyframes kenBurnsZoom {
  0% { transform: scale(1.01); }
  100% { transform: scale(1.05); }
}

/* Floating Luxury 3D Badge / Card Float */
@keyframes luxuryFloat {
  0%, 100% { transform: perspective(1000px) translateY(0px) rotateY(-0.5deg); }
  50% { transform: perspective(1000px) translateY(-8px) rotateY(0.5deg); }
}
.animate-float-3d {
  animation: luxuryFloat 6s ease-in-out infinite !important;
}

/* ================= 4. LUXURY CARDS & DRIFTING IMAGES ================= */
.tilt-card,
.shadow-card,
[class*="group hover:border-sunset"],
.gallery-3d-card {
  position: relative;
  transition: transform var(--dur-smooth) var(--ease-luxury), 
              box-shadow var(--dur-smooth) var(--ease-luxury), 
              border-color var(--dur-smooth) var(--ease-luxury) !important;
}

.tilt-card:hover,
.shadow-card:hover,
.gallery-3d-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 24px 44px -10px rgba(234, 88, 12, 0.18), 0 10px 20px -5px rgba(17, 24, 39, 0.08) !important;
}

/* Drifting image scale inside cards */
.group:hover img,
.tilt-card:hover img {
  transform: scale(1.045) !important;
  transition: transform var(--dur-graceful) var(--ease-luxury) !important;
}

/* Delicate Card Light Drift */
.tilt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: skewX(-20deg);
  transition: left 1100ms ease;
  pointer-events: none;
  z-index: 10;
}
.tilt-card:hover::before {
  left: 140%;
}

/* Gentle Arrow Slide on Hover */
.group:hover .fa-arrow-right,
.group:hover .fa-chevron-right {
  transform: translateX(4px);
  transition: transform var(--dur-subtle) var(--ease-luxury);
}

/* ================= 5. LUXURY ROAD MAP (Calm 2.8s GPS Stream & Dark Theme) ================= */
@keyframes calmHighwayStream {
  from { stroke-dashoffset: 48; }
  to { stroke-dashoffset: 0; }
}

.active-highway-stream {
  stroke-dasharray: 8 10 !important;
  animation: calmHighwayStream 2.8s linear infinite !important;
}

/* Waypoint Concentric Radar Rings */
@keyframes luxuryRadarPing {
  0% { transform: scale(1); opacity: 0.85; }
  65% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.waypoint-radar {
  animation: luxuryRadarPing 3.2s cubic-bezier(0, 0, 0.2, 1) infinite;
  transform-origin: center;
}

/* Map Dark Theme Luxury Styling */
.dark #svgIslandFill {
  fill: #18181b !important;
  stroke: #ea580c !important;
}
.dark #cartographicGrid line {
  stroke: rgba(255, 255, 255, 0.08) !important;
}
.dark #cartographicGrid text {
  fill: #94a3b8 !important;
}
.dark #svgCoastOuter1 {
  stroke: #7c2d12 !important;
  opacity: 0.22 !important;
}
.dark #svgCoastOuter2 {
  stroke: #9a3412 !important;
  opacity: 0.32 !important;
}
.dark #svgCoastOuter3 {
  stroke: #ea580c !important;
  opacity: 0.55 !important;
}

/* ================= 6. VALUE PILLARS & FEATURES ================= */
.feature-pillar-box {
  transition: transform var(--dur-smooth) var(--ease-luxury), 
              border-color var(--dur-smooth) var(--ease-luxury), 
              background-color var(--dur-smooth) var(--ease-luxury);
}
.feature-pillar-box:hover {
  transform: translateY(-5px);
}
.feature-pillar-box:hover .feature-icon-wrapper {
  transform: scale(1.1) rotate(3deg);
  transition: transform var(--dur-subtle) var(--ease-spring);
}

/* ================= 7. FLOATING ACTION BADGES ================= */
@keyframes softPulseAura {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  65% { box-shadow: 0 0 0 12px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.wa-pulse-aura {
  animation: softPulseAura 3s infinite;
}

.theme-icon-spin {
  transform: rotate(360deg) scale(1.18) !important;
  transition: transform 500ms var(--ease-spring) !important;
}

/* ================= 8. NAVIGATION DROPDOWNS (Graceful Scale & Fade) ================= */
nav .group > div[class*="absolute"] {
  transform: translateY(8px) scale(0.98) !important;
  opacity: 0 !important;
  visibility: hidden;
  transform-origin: top left !important;
  transition: transform var(--dur-subtle) var(--ease-luxury), 
              opacity var(--dur-subtle) var(--ease-luxury), 
              visibility var(--dur-subtle) var(--ease-luxury) !important;
}

nav .group:hover > div[class*="absolute"] {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Nav Item Hover Underline Bar */
nav > a, nav .group > a {
  position: relative;
}
nav > a:not(.px-5)::after, 
nav .group > a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #ea580c;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-subtle) var(--ease-luxury);
  border-radius: 9999px;
}
nav > a:hover::after, 
nav .group:hover > a::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ================= 9. FLOATING BACK TO TOP BUTTON ================= */
#backToTopBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity var(--dur-subtle) var(--ease-luxury), 
              transform var(--dur-subtle) var(--ease-luxury), 
              visibility var(--dur-subtle) var(--ease-luxury);
}

#backToTopBtn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#backToTopBtn:hover i {
  animation: arrowBounce 0.8s infinite alternate ease-in-out;
}

@keyframes arrowBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

/* ================= 10. ITINERARY DAY EXPANSION ================= */
.itinerary-day-card {
  transition: transform var(--dur-subtle) var(--ease-luxury), 
              border-color var(--dur-subtle) var(--ease-luxury),
              box-shadow var(--dur-subtle) var(--ease-luxury);
}
.itinerary-day-card:hover {
  transform: translateX(4px);
  border-color: rgba(234, 88, 12, 0.45) !important;
}

/* ================= 11. LUXURY LIGHTBOX MODAL ================= */
#lightboxModal {
  opacity: 0;
  transition: opacity var(--dur-subtle) var(--ease-luxury) !important;
}
#lightboxModal > div {
  transform: scale(0.96);
  opacity: 0;
  transition: transform var(--dur-smooth) var(--ease-luxury), 
              opacity var(--dur-smooth) var(--ease-luxury) !important;
  transform-origin: center;
}
#lightboxModal:not(.hidden) {
  opacity: 1;
}
#lightboxModal:not(.hidden) > div {
  transform: scale(1);
  opacity: 1;
}

/* ================= 12. REDUCED MOTION PREFERENCE ================= */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
