      elementsToShow.forEach(id => {
            document.getElementById(id).style.display = 'block';
        });
    });

    function closeModal() {
        const modal = document.getElementById('popupModal');
        const overlay = document.getElementById('overlay');

        // Apply animations before hiding
         modal.style.animation = 'slideOutToRight 0.3s ease-out forwards';
         overlay.style.animation = 'fadeOut 0.3s ease-out forwards';

         setTimeout(() => {
                modal.st