

const carouselWrapper = document.getElementById('imageCarousel');
const prevButton = document.getElementById('prevButton');
const nextButton = document.getElementById('nextButton');

let currentIndex = 0;

function updateCarousel() {
    carouselWrapper.innerHTML = '';
    imagesUrls.forEach((imageUrl, index) => {
        const item = document.createElement('div');
        item.classList.add('carousel-item');
        if (index === currentIndex) {
            item.innerHTML = `<img src="${imageUrl}" alt="Image ${index + 1}">`;
        }
        carouselWrapper.appendChild(item);
    });
}

prevButton.addEventListener('click', () => {
    if (currentIndex > 0) {
        currentIndex--;
        updateCarousel();
    } else {
        currentIndex = imagesUrls.length - 1;
        updateCarousel();
    }
});

nextButton.addEventListener('click', () => {
    if (currentIndex < imagesUrls.length - 1) {
        currentIndex++;
        updateCarousel();
    } else {
        currentIndex = 0;
        updateCarousel();
    }
});

if (carouselWrapper)
    updateCarousel();

function toggleBio() {
    const bioContent = document.querySelector('.actress-biography-content');
    bioContent.classList.toggle('expanded');
}