// Dark Mode
document.addEventListener("DOMContentLoaded", () => {
  const toggle = document.getElementById("dark-mode-toggle");
  if (!toggle) return;

  if (localStorage.getItem("darkMode") === "true") {
    document.body.classList.add("dark");
  }

  updateToggle(toggle);

  toggle.addEventListener("click", () => {
    const isDark = document.body.classList.toggle("dark");
    localStorage.setItem("darkMode", isDark);
    updateToggle(toggle);
  });
});

function updateToggle(toggle) {
  const isDark = document.body.classList.contains("dark");
  toggle.textContent = isDark ? "☀️ Light" : "🌙 Dark";
}

}



