document.addEventListener('DOMContentLoaded', () => {
  const loading = document.querySelector('.loading');

  // Hide overlay initially
  if (loading) {
    loading.style.display = 'none';
  }

  // Select all links except those with href="#" or href="javascript:void(0)"
  document.querySelectorAll('a[href]:not([href="#"]):not([href="javascript:void(0)"])').forEach(link => {
    link.addEventListener('click', () => {
      if (loading) {
        loading.style.display = 'flex'; // show overlay
      }
    });
  });
});



