loseAddDeviceToCaseModal();
        }
    });

    // Responsive handling for mobile devices
    function handleMobileResize() {
        const modals = document.querySelectorAll('.rc-modal-content');
        const isMobile = window.innerWidth < 768;
        const isTablet = window.innerWidth >= 768 && window.innerWidth < 1200;
        
        modals.forEach(modal => {
            // Special handling for the Add Device modal
            if (modal.parentElement.id === 'addDeviceToCaseModal') {
              