// app/javascript/application.js or app/assets/javascripts/application.js
document.addEventListener("DOMContentLoaded", () => {
  const flash = document.getElementById("flash-message");
  if (flash) {
    setTimeout(() => {
      flash.style.transition = "opacity 0.5s ease";
      flash.style.opacity = "0";
      setTimeout(() => flash.remove(), 500); // remove from DOM after fade
    }, 3000); // 3 seconds
  }
});
