       }
        });
    });

    // Add this cleanup on page load
    document.addEventListener('DOMContentLoaded', () => {
        hideLoadingOverlay();
    });

    overviewCloseBtn.addEventListener('click', () => {
        overviewModal.style.display = 'none';
    });

    document.addEventListener('click', (e) => {
        document.querySelectorAll('.menu-dropdown').forEach(dropdown => {
            if (!dropdown.contains(e.target) && !e.target.classList.contains('menu-btn')) {
                dropdown