var acc = document.getElementsByClassName("accordion");
var arrows = document.querySelectorAll(".faqArrow");

for (let i = 0; i < acc.length; i++) {
    acc[i].addEventListener("click", function () {
        this.classList.toggle("active");
        
        var panel = this.nextElementSibling;
        if (panel.style.maxHeight) {
            panel.style.maxHeight = null; 
            arrows[i].style.transform = 'rotate(0deg)'; 
        } else {
            panel.style.maxHeight = panel.scrollHeight + "px"; 
            arrows[i].style.transform = 'rotate(180deg)';
        }
    });
}