;
            }

            if (currentMessage) {
                currentMessage.classList.remove('show');
                currentMessage.classList.add('hide');
                setTimeout(() => {
                    if (currentMessage && currentMessage.parentNode) {
                        currentMessage.parentNode.removeChild(currentMessage);
                    }
                    currentMessage = null;
                    if (callback) callback();
                }, 800); // Match animatio