document.addEventListener('DOMContentLoaded', function() {
    const contactForm = document.getElementById('recolor-form');

    if (contactForm) {
        contactForm.addEventListener('submit', function(e) {
            const pdfFile = document.getElementById('pdfFile').files[0];
            if (!pdfFile) {
                e.preventDefault(); // Stop submission only if validation fails
                alert('Please select a PDF file.');
            }
            // Allow the form to submit normally if a file is selected
        });
    }
});