// Redirect to payments section when "Buy Modpack" clicked
document.querySelector('.btn-primary').addEventListener('click', function (event) {
    event.preventDefault();

    // Show loading overlay
    const loadingOverlay = document.getElementById('loading-overlay');
    if (loadingOverlay) {
        loadingOverlay.style.display = 'flex';
    }

    // Simulate loading (e.g., 1.5 seconds) and then show the payments modal
    setTimeout(() => {
        if (loadingOverlay) {
            loadingOverlay.style.display = 'none'; // Hide loading overlay
        }

        // Hide current section and show payments modal
        const currentSection = document.querySelector('.container.mt-5');
        if (currentSection) {
            currentSection.classList.add('d-none');
        }

        const paymentsModal = document.getElementById('payments-modal');
        if (paymentsModal) {
            paymentsModal.classList.remove('d-none');
        }
    }, 1500); // Simulate 1.5 seconds of loading time
});

// Disable right-click context menu
document.addEventListener('contextmenu', function (event) {
    event.preventDefault();
});

// Disable F12, Ctrl+Shift+I, Ctrl+U, and Ctrl+S (Common Developer Tools Shortcuts)
document.onkeydown = function (e) {
    if (e.key === 'F12' ||
        (e.ctrlKey && e.shiftKey && e.key === 'I') ||
        (e.ctrlKey && e.key === 'U') ||
        (e.ctrlKey && e.key === 's')) {
        e.preventDefault();
    }
};

function submitKey() {
    const key = document.getElementById('key').value;
    if (key === 'XPl0si0nModpackKey9821') {
        window.location.href = 'unlock.html';
    } else {
        alert('Key salah! Coba lagi.');
    }
}

function reviewGTA() {
    window.location.href = 'shop2.html';
}
