 const currentPathname = window.location.pathname;
   const navLinks = document.querySelectorAll('.nav-link');
   
   navLinks.forEach(link => {
        // Extract the pathname from the link's href to ignore query parameters or hashes
        const linkPathname = new URL(link.href).pathname;

        if (linkPathname === currentPathname) {
            link.classList.add('active');
            link.setAttribute('aria-current', 'page'); // For accessibility
        } else {
            link.classList.remove('active'); // Remove active from other links
            link.removeAttribute('aria-current');
        }
    });
    
 