/* 
* Agriturismo Le Due Torri - Animations
* https://agriturismoleduetorri.com
* Version: 1.0
*/

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation for Elements */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

/* Staggered animation for multiple elements */
.fade-in-1 { animation-delay: 0.2s; }
.fade-in-2 { animation-delay: 0.4s; }
.fade-in-3 { animation-delay: 0.6s; }

/* Scroll Animation */
.scroll-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animation.active {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 20s linear infinite;
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 1s ease forwards;
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 1s ease forwards;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.8s ease;
}

/* Fade In Out Animation */
@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.fade-in-out {
    animation: fadeInOut 2s infinite;
}

/* Hero Text Animation */
.hero h1, .hero p {
    opacity: 0;
}

.hero h1 {
    animation: slideInRight 1s ease forwards 0.3s;
}

.hero p {
    animation: slideInRight 1s ease forwards 0.6s;
}

.hero .btn-primary {
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.9s;
}

/* Feature Card Hover Animation */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Testimonial Slider Animation */
.testimonial-slider.slide-1 { transform: translateX(0); }
.testimonial-slider.slide-2 { transform: translateX(-33.333%); }
.testimonial-slider.slide-3 { transform: translateX(-66.666%); }

/* Button Hover Animation */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary:before, .btn-secondary:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.btn-primary:hover:before, .btn-secondary:hover:before {
    left: 100%;
}
