/*попап подсказок на настройки*/
    function showPopup(tooltipId) {
        var tooltip = document.getElementById(tooltipId);
        var popupOverlay = document.createElement('div');
        var closeButton = '<span class="close-button dashicons dashicons-no-alt" onclick="closePopup(this)"></span>';

        popupOverlay.className = 'ai-content-wizard-overlay';
        popupOverlay.innerHTML = '<div class="ai-content-wizard-popup" onclick="event.stopPropagation()">' + closeButton + tooltip.innerHTML + '</div>';
        popupOverlay.onclick = function() { closePopup(this); };

        document.body.appendChild(popupOverlay);
    }

    function closePopup(element) {
        if (element.className === 'ai-content-wizard-overlay') {
            document.body.removeChild(element);
        } else {
            var overlay = element.closest('.ai-content-wizard-overlay');
            document.body.removeChild(overlay);
        }
    }



/* Подсказки в системном анализе */
document.addEventListener('DOMContentLoaded', function() {
    var helpLinks = document.querySelectorAll('.help-link');
    var popup = document.getElementById('help-popup');
    var popupMessage = document.getElementById('help-popup-message');

    helpLinks.forEach(function(link) {
        link.addEventListener('click', function(e) {
            e.preventDefault();
            var helpMessage = this.getAttribute('data-help-message');
            popupMessage.innerHTML = helpMessage;
            popup.style.display = 'flex';
        });
    });
});
