/* ==========================================
   Sky World Travel - Animations & Transitions
   ========================================== */

/* ============ Global smooth scroll ============ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px; /* offset for sticky navbar */
}

/* ============ Page Load Fade-In ============ */
body {
    opacity: 0;
    animation: pageIn 0.6s ease forwards;
}

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

/* Page fade-OUT when navigating away */
body.page-leaving {
    animation: pageOut 0.35s ease forwards;
}
@keyframes pageOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-8px); }
}

/* ============ Scroll Reveal (JS toggles .revealed) ============ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Slide variants */
.reveal-left    { transform: translateX(-40px); }
.reveal-right   { transform: translateX(40px); }
.reveal-scale   { transform: scale(0.92); }
.reveal-left.revealed,
.reveal-right.revealed { transform: translateX(0); }
.reveal-scale.revealed { transform: scale(1); }

/* Stagger delays (JS assigns these to grid children) */
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.40s; }
.reveal.delay-6 { transition-delay: 0.48s; }

/* ============ Hero animated entrance ============ */
.hero-title,
.hero-subtitle,
.search-box {
    opacity: 0;
    animation: heroIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-title    { animation-delay: 0.15s; }
.hero-subtitle { animation-delay: 0.35s; }
.search-box    { animation-delay: 0.55s; }

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

/* ============ Navbar link hover polish ============ */
.nav-links a,
.btn,
.destination-card,
.package-card,
.service-item,
.testi-card,
.why-card,
.team-card,
.service-detail-card,
.contact-info-card,
.stat-item,
.chip,
.toggle-btn,
.float-btn,
.footer-social a,
.top-social a,
.dest-badge,
.section-flag {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease,
                background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                opacity 0.3s ease;
}

/* Card lift micro-interactions (override default hover if same as before) */
.destination-card:hover,
.package-card:hover,
.testi-card:hover,
.why-card:hover,
.team-card:hover,
.service-detail-card:hover,
.contact-info-card:hover,
.stat-item:hover {
    transform: translateY(-6px);
}

/* Image zoom on card hover */
.dest-img,
.package-img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.destination-card:hover .dest-img,
.package-card:hover .package-img {
    transform: scale(1.06);
}
.destination-card,
.package-card {
    overflow: hidden;
}

/* ============ Button hover shimmer ============ */
.btn {
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}
.btn:hover::before {
    left: 100%;
}

/* ============ Floating buttons continuous pulse ============ */
@keyframes floatPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(0,0,0,0.2), 0 0 0 0 rgba(37,211,102,0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(0,0,0,0.2), 0 0 0 14px rgba(37,211,102,0);
    }
}
.float-btn.whatsapp { animation: floatPulse 2.2s infinite; }

/* ============ Section headings underline animation ============ */
.section-tag,
.section-flag {
    transform-origin: center;
}

/* ============ Scroll indicator on hero (optional) ============ */
.scroll-indicator {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: 22px;
    animation: bounceDown 2s ease-in-out infinite;
    z-index: 3;
    cursor: pointer;
}
@keyframes bounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(10px); }
}

/* ============ Smooth appearance of tabs content ============ */
.tab-content {
    animation: fadeSlide 0.4s ease;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ Form success message slide-in ============ */
.form-success {
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: block !important;
    max-height: 0;
    overflow: hidden;
    padding: 0 18px !important;
    margin-bottom: 0 !important;
}
.form-success.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
    padding: 14px 18px !important;
    margin-bottom: 20px !important;
}

/* ============ Respect reduced motion preference ============ */
@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; }
}


/* SAFETY NET for Back/Forward (bfcache): never leave a restored page invisible */
body.bfcache-restored { opacity:1 !important; animation:none !important; transform:none !important; }
