              const closeModal = document.querySelector('.modal .close');
                closeModal.onclick = function() {
                  modal.style.display = 'none';
                }
              });
            
              // Hide the modal when clicking outside of it
              window.onclick = function(event) {
                const modal = document.getElementById('popupModal');
                if (event.target == modal) {
                  modal.style.display = 'none';
                }
  