                      // Handle HTTP error
                            showToast(`Server error: ${xhr.status}`, 'error');
                        }
                    };
                    
                    xhr.onerror = () => {
                        // Clear animation
                        this.style.animation = '';
                        showToast("Network error occurred", 'error');
                        console.error("Network error occurred");
                    };
                    
     