       `;
        document
            .body
            .appendChild(clearPopup);
    }

    function closeClearPopup() {
        const popup = document.querySelector('.delete-popup');
        if (popup) {
            popup.remove();
        }
    }

    function confirmClear() {
        localStorage.removeItem('mindmap-history');
        localStorage.removeItem('mindmap-playground');
        loadMindmaps();
        closeClearPopup();
    }

    function formatDate(timestamp) {
        return new Date(time