document.addEventListener("DOMContentLoaded", function () {
  const loader = document.getElementById("site-preloader");
  const skipBtn = document.getElementById("skip-preloader");

  const hideLoader = () => {
    if (loader) {
      loader.classList.add("loader-hidden");
    }
  };

  // Auto-hide when page loads
  window.addEventListener("load", function () {
    setTimeout(hideLoader, 600);
  });

  // Manual hide when button clicked
  if (skipBtn) {
    skipBtn.addEventListener("click", hideLoader);
  }
});
