    // radio buttons
const sameRadio = document.getElementById('same');
    const differentRadio = document.getElementById('different');
    const whatsappInput = document.getElementById('whatsapp-input');

    sameRadio.addEventListener('change', () => {
        whatsappInput.style.display = 'none';
    });

    differentRadio.addEventListener('change', () => {
        whatsappInput.style.display = 'block';
    })
    const resiInRadio = document.getElementById('resi_in');
    const resiOutRadio = document.getElementById('resi_out');
    const resiInInput = document.getElementById('resi-in_input');
    const resiOutInput = document.getElementById('resi_out_input');

    
    resiInRadio.addEventListener('change', () => {
        resiInInput.style.display = 'block';  
        resiOutInput.style.display = 'none';  
    });

    resiOutRadio.addEventListener('change', () => {
        resiInInput.style.display = 'none';  
        resiOutInput.style.display = 'block';
    });

     // image

    document.getElementById('selectFileButton').addEventListener('click', function() {
        document.getElementById('photo').click(); 
    });

    document.getElementById('photo').addEventListener('change', function(event) {
        const file = event.target.files[0]; 
        
        const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png'];
        if (!allowedTypes.includes(file.type)) {
            alert("Only JPG, JPEG, or PNG files are allowed.");
            document.getElementById('photo').value = ''; 
            return;
        }

        
        if (file.size > 8 * 1024 * 1024) {
            alert("File size must be less than 3.5MB.");
            document.getElementById('photo').value = ''; 
            return;
        }

       
        const img = new Image();
        img.onload = function() {
          
            if (img.width < 350 || img.height < 450) {
                alert("Image dimensions must be at least 350x450 pixels.");
                document.getElementById('photo').value = ''; 
                return;
            }

            
            document.getElementById('imagePreview').src = URL.createObjectURL(file);
            document.getElementById('imageName').innerText = file.name;
            document.getElementById('imagePreviewContainer').style.display = 'block'; 
        };

        img.src = URL.createObjectURL(file);
    });

    
    document.getElementById('removeImage').addEventListener('click', function() {
        document.getElementById('imagePreviewContainer').style.display = 'none'; 
        document.getElementById('photo').value = ''; 
    });

