/* =============================================
   WAKACYJNI.COM — Animations Stylesheet
   Scroll-driven animations, reveals, and 
   interactive motion effects
   ============================================= */

/* --- Scroll Reveal Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.animate-on-scroll[data-delay="100"] { transition-delay: 0.1s; }
.animate-on-scroll[data-delay="200"] { transition-delay: 0.2s; }
.animate-on-scroll[data-delay="300"] { transition-delay: 0.3s; }
.animate-on-scroll[data-delay="400"] { transition-delay: 0.4s; }
.animate-on-scroll[data-delay="500"] { transition-delay: 0.5s; }
.animate-on-scroll[data-delay="600"] { transition-delay: 0.6s; }

/* --- Native Scroll-Driven Entry/Exit Effects (Progressive Enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
        @keyframes sda-fade-in {
            from {
                opacity: 0;
                transform: translateY(50px) scale(0.95);
            }
        }

        @keyframes sda-fade-out {
            to {
                opacity: 0;
                transform: translateY(-30px) scale(0.98);
            }
        }

        .destination-card,
        .feature-card,
        .deal-card,
        .testimonial-card {
            animation:
                sda-fade-in auto linear backwards,
                sda-fade-out auto linear forwards;
            animation-timeline: view();
            animation-range: entry 0% entry 100%, exit 70% exit 100%;
        }

        /* Parallax hero layers */
        @keyframes sda-parallax {
            from {
                transform: translateY(100px);
            }
        }

        .hero-bg-1 {
            view-timeline: --hero-parallax;
        }
    }
}

/* --- Magnetic Cursor Effect on Cards --- */
.destination-card,
.feature-card,
.deal-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

/* --- Loading Animation for Hero --- */
@keyframes heroContentSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content .hero-badge {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

.hero-content .title-line:nth-child(1) {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

.hero-content .title-line:nth-child(2) {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.7s both;
}

.hero-content .title-line:nth-child(3) {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.9s both;
}

.hero-subtitle {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.1s both;
}

.hero-cta {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.3s both;
}

.hero-stats {
    animation: heroContentSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.5s both;
}

/* --- Card Shimmer / Shine Effect --- */
.destination-card::before,
.deal-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        transparent 60%
    );
    transform: translateX(-100%) rotate(0deg);
    transition: transform 0.8s ease;
    z-index: 2;
    pointer-events: none;
}

.destination-card:hover::before,
.deal-card:hover::before {
    transform: translateX(30%) rotate(0deg);
}

/* --- Ripple Effect on Buttons --- */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.btn-primary:active::after {
    transform: scale(2.5);
    opacity: 0;
    transition: 0s;
}

/* --- Floating Label Animation for Search --- */
.search-field input:focus + label,
.search-field select:focus + label,
.search-field input:not(:placeholder-shown) + label {
    color: var(--color-primary);
}

/* --- Counter Number Roll-up --- */
@keyframes countUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.stat-number.counting {
    animation: countUp 0.6s ease-out;
}

/* --- Floating Icon Wobble --- */
@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(-5deg); }
    75% { transform: rotate(3deg); }
}

.feature-card:hover .feature-icon span {
    animation: wobble 0.6s ease-in-out;
}

/* --- Gradient Border Animation --- */
@keyframes borderGlow {
    0%, 100% { border-color: rgba(0, 102, 255, 0.3); }
    50% { border-color: rgba(0, 212, 170, 0.5); }
}

.search-card:hover {
    animation: borderGlow 3s ease-in-out infinite;
}

/* --- Morphing Background Blobs --- */
@keyframes morphBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* --- Newsletter Floating Cards Enhanced --- */
.floating-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-card:hover {
    transform: translateY(-10px) scale(1.05) !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

/* --- Typing Cursor for Hero --- */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Image Zoom on Card Hover --- */
.card-image {
    transition: none;
}

.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background-size: inherit;
    background-position: inherit;
    background-image: inherit;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.destination-card .card-image {
    overflow: hidden;
}

.destination-card:hover .card-image {
    background-size: 110%;
}

/* --- Staggered Grid Animation --- */
@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Smooth Navbar Transition --- */
.navbar {
    transition: background 0.5s ease,
                padding 0.4s ease,
                box-shadow 0.4s ease;
}

/* --- Mobile Menu Animation --- */
.nav-links.active a {
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
}

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

.nav-links.active a:nth-child(1) { animation-delay: 0.1s; }
.nav-links.active a:nth-child(2) { animation-delay: 0.15s; }
.nav-links.active a:nth-child(3) { animation-delay: 0.2s; }
.nav-links.active a:nth-child(4) { animation-delay: 0.25s; }
.nav-links.active a:nth-child(5) { animation-delay: 0.3s; }

/* --- Hamburger Animation --- */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-bg {
        animation: none !important;
    }

    .floating-card {
        animation: none !important;
    }

    .title-accent {
        animation: none !important;
    }

    .badge-dot {
        animation: none !important;
    }

    .scroll-arrow {
        animation: none !important;
    }

    .deal-tag-hot {
        animation: none !important;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
