/**
 * SmartForm Funnel Builder — Global JS
 * This file is optional. Core logic is inline in each view.
 * Add custom enhancements here.
 */

// Auto-dismiss flash messages after 5s
document.addEventListener('DOMContentLoaded', function () {
    var flashes = document.querySelectorAll('.flash-message');
    flashes.forEach(function (el) {
        setTimeout(function () {
            el.style.transition = 'opacity .4s';
            el.style.opacity = '0';
            setTimeout(function () { el.remove(); }, 400);
        }, 5000);
    });

    // Tooltip init (simple title-based)
    document.querySelectorAll('[title]').forEach(function (el) {
        el.setAttribute('data-title', el.getAttribute('title'));
    });
});
