// Initialize everything when DOM is loaded document.addEventListener("DOMContentLoaded", function () { // Initialize components if (typeof createStars === "function") createStars(); if (typeof updateNavigation === "function") updateNavigation(); if (typeof setupForm === "function") setupForm(); if (typeof setupMobileNavigation === "function") setupMobileNavigation(); // Set up event listeners window.addEventListener("scroll", updateNavigation); // Smooth scrolling for navigation links document.querySelectorAll('a[href^="#"]').forEach((anchor) => { anchor.addEventListener("click", function (e) { e.preventDefault(); const targetId = this.getAttribute("href"); if (targetId === "#") return; const targetElement = document.querySelector(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: "smooth", }); } }); }); });