// Function to open the modal
function openModal() {
    document.getElementById('guideModal').style.display = 'flex';
}

// Function to close the modal
function closeModal() {
    document.getElementById('guideModal').style.display = 'none';
}

// Close modal if clicked outside the modal content
window.onclick = function(event) {
    const modal = document.getElementById('guideModal');
    if (event.target === modal) {
        modal.style.display = 'none';
    }
};

// Function to copy UPI ID and show alert box
function copyUpiId() {
    const upiId = document.getElementById('upiId');
    upiId.select();
    document.execCommand('copy');

    // Show the alert box
    const alertUpi = document.getElementById('alertUpi');
    alertUpi.style.display = 'block';

    // Hide the alert box after 2 seconds
    setTimeout(() => {
        alertUpi.style.display = 'none';
    }, 2000);
}

// Hide the loader when the page is fully loaded
window.onload = function() {
    const loader = document.getElementById('loader');
    loader.style.display = 'none';
};