endChild(componentDiv);
            }
            
            // Add event listeners for the detail toggle buttons
            document.querySelectorAll('.toggle-details').forEach(button => {
                button.addEventListener('click', function() {
                    const details = this.closest('.recommendation-item').querySelector('.component-details');
                    const icon = this.querySelector('.collapse-icon');
                    
                    if (details.style.display === 'bloc