/* Keyframe Animations */

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0; /* Start hidden */
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

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

.slide-in-left {
    animation: slideInLeft 0.7s ease-out forwards;
    opacity: 0;
}

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

.slide-in-right {
    animation: slideInRight 0.7s ease-out forwards;
    opacity: 0;
}

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

.pulse {
    animation: pulse 2s infinite ease-in-out;
}

/* Hover Effects */

/* Button Hover */
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Card Hover */
.car-card:hover, .testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Image Zoom on Hover */
.car-card img {
    transition: transform 0.5s ease;
}

.car-card:hover img {
    transform: scale(1.05);
}

/* Parallax Effect (for hero section background) */
/* This will be handled more by JS for true parallax, but here's a subtle CSS version */
#hero {
    background-attachment: fixed; /* This creates a simple parallax effect */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Scroll-based animations (will be triggered by JS) */
.animated-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animated-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Specific animations for elements */
header .logo, header nav ul li {
    animation: fadeInDown 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header .logo { animation-delay: 0.1s; }
header nav ul li:nth-child(1) { animation-delay: 0.2s; }
header nav ul li:nth-child(2) { animation-delay: 0.3s; }
header nav ul li:nth-child(3) { animation-delay: 0.4s; }
header nav ul li:nth-child(4) { animation-delay: 0.5s; }
header nav ul li:nth-child(5) { animation-delay: 0.6s; }

#hero h1 { animation: fadeInUp 1s ease-out forwards; animation-delay: 0.7s; }
#hero p { animation: fadeInUp 1s ease-out forwards; animation-delay: 0.9s; }
#hero .btn { animation: fadeInUp 1s ease-out forwards; animation-delay: 1.1s; }

.car-search-form { animation: scaleIn 0.8s ease-out forwards; animation-delay: 1.3s; }

/* Delay for grid items */
.car-grid .car-card {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
.car-grid .car-card:nth-child(1) { animation-delay: 0.2s; }
.car-grid .car-card:nth-child(2) { animation-delay: 0.4s; }
.car-grid .car-card:nth-child(3) { animation-delay: 0.6s; }
.car-grid .car-card:nth-child(4) { animation-delay: 0.8s; }
/* Add more for more cards */

.testimonial-grid .testimonial-card {
    animation: scaleIn 0.8s ease-out forwards;
    opacity: 0;
}
.testimonial-grid .testimonial-card:nth-child(1) { animation-delay: 0.2s; }
.testimonial-grid .testimonial-card:nth-child(2) { animation-delay: 0.4s; }
.testimonial-grid .testimonial-card:nth-child(3) { animation-delay: 0.6s; }
/* Add more for more cards */