       }
            
            const data = await response.json();
            modalTreeData = data.treeData;
            renderModalTreeView(modalTreeData);
        } catch (error) {
            console.error('Error loading modal tree data:', error);
            document.getElementById('modalTreeViewContainer').innerHTML = `
                <div class="text-center py-3 text-danger">
                    <i class="bi bi-exclamation-triangle"></i>
                    <p class="mt-2">Error loading tree stru