(() => { let toastContainer = null; let toastId = 0; function ensureToastContainer() { if (!toastContainer) { toastContainer = document.createElement("div"); toastContainer.className = "toast-container"; document.body.appendChild(toastContainer); } return toastContainer; } function showToast(message, type = "info", duration = 4000) { const container = ensureToastContainer(); const id = ++toastId; const icons = { success: "fa-circle-check", error: "fa-circle-xmark", info: "fa-circle-info", warning: "fa-triangle-exclamation", }; const titles = { success: "Success", error: "Error", info: "Info", warning: "Warning", }; const toast = document.createElement("div"); toast.className = `toast toast-${type}`; toast.id = `toast-${id}`; toast.style.opacity = "0"; toast.innerHTML = `