 // Basic JS for future enhancements
    console.log('Professional Real Estate Website Loaded');



    

function openCert(src) {
  document.getElementById("certModal").style.display = "flex";
  document.getElementById("certImage").src = src;
}

function closeCert() {
  document.getElementById("certModal").style.display = "none";
}

// Scroll Animation
const cards = document.querySelectorAll(".cert-card");

const observer = new IntersectionObserver(entries => {
  entries.forEach(entry => {
    if(entry.isIntersecting){
      entry.target.style.opacity = 1;
      entry.target.style.transform = "translateY(0)";
    }
  });
}, {threshold: 0.3});

cards.forEach(card => {
  card.style.opacity = 0;
  card.style.transform = "translateY(60px)";
  observer.observe(card);
});








// counter 
const counters = document.querySelectorAll(".counter");

counters.forEach(counter => {
  const update = () => {
    const target = +counter.getAttribute("data-target");
    const current = +counter.innerText;
    const increment = target / 100;

    if(current < target){
      counter.innerText = Math.ceil(current + increment);
      setTimeout(update, 20);
    } else {
      counter.innerText = target;
    }
  };
  update();
});