Text');
            
            if (table.style.display === 'none') {
                table.style.display = 'block';
                icon.className = 'bi bi-chevron-up';
                text.textContent = 'Hide Details';
            } else {
                table.style.display = 'none';
                icon.className = 'bi bi-chevron-down';
                text.textContent = 'Show Details';
            }
        }

        // Close modal when clicking outside
        document.getElementById('deviceAnalytic