document.addEventListener('DOMContentLoaded', function() {
    // Get testimonial and image slides separately
    const testimonialSlides = document.querySelectorAll('.testimonial .slide');
    const imageSlides = document.querySelectorAll('.image-container .slide');
    const prevBtn = document.querySelector('.btn-prev');
    const nextBtn = document.querySelector('.btn-next');
    let currentSlide = 0;

    function showSlide(index) {
        testimonialSlides.forEach(slide => slide.classList.remove('active'));
        imageSlides.forEach(slide => slide.classList.remove('active'));
        testimonialSlides[index].classList.add('active');
        imageSlides[index].classList.add('active');
    }

    function nextSlide() {
        currentSlide = (currentSlide + 1) % testimonialSlides.length;
        showSlide(currentSlide);
    }

    function prevSlide() {
        currentSlide = (currentSlide - 1 + testimonialSlides.length) % testimonialSlides.length;
        showSlide(currentSlide);
    }

    prevBtn.addEventListener('click', prevSlide);
    nextBtn.addEventListener('click', nextSlide);

    // Show first slide initially
    showSlide(0);
});
