document.addEventListener('DOMContentLoaded', () => {
    document.querySelectorAll('.toast').forEach((toastNode) => {
        const toast = new bootstrap.Toast(toastNode);
        toast.show();
    });

    document.querySelectorAll('[data-file-input]').forEach((input) => {
        input.addEventListener('change', () => {
            const help = input.closest('.col-12')?.querySelector('.form-text');
            if (!help) {
                return;
            }
            const fileName = input.files && input.files[0] ? input.files[0].name : 'Supported: PDF, TXT, DOC, DOCX, PPT, PPTX. Max 12 MB.';
            help.textContent = fileName;
        });
    });
});
