document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll("a[data-scroll]").forEach(anchor => {
anchor.addEventListener("click", function (e) {
e.preventDefault();
const targetId = this.getAttribute("href");
const targetElement = document.querySelector(targetId);
if (targetElement) {
window.scrollTo({
top: targetElement.offsetTop,
behavior: "smooth"
});
}
});
});
});