          `;
            return;
        }

        let html = '';
        categories.forEach(category => {
            html += renderModalTreeCategory(category);
        });
        
        container.innerHTML = html;
    }
    
    function renderModalTreeCategory(category) {
        let html = `
            <div class="tree-category">
                <div class="tree-category-header" onclick="toggleModalTreeNode('category-${category.id}')">
                    <i class="bi bi-chevron-right tree-chevron"