function show_details(){
  let domains = document.querySelectorAll(".alert-container");
  let details = document.querySelectorAll(".alert-details");

  domains.forEach((element, i) => {
    element.addEventListener("click", function(){
      details[i].classList.toggle('details-show');
    })
  })

}

function aggiornaDati() {
  fetch('/process/ajax-refresh.php')
    .then(response => response.text())
    .then(html => {
      const container = document.getElementById('main-container');
      if (container) {
        container.innerHTML = html;

        // Se hai funzioni tipo show_details()
        if (typeof show_details === "function") {
          show_details();
        }
      }
    })
    .catch(error => console.error('Errore AJAX:', error));
}

