document.addEventListener('DOMContentLoaded', function () {
    // Initialize Bootstrap Collapse components
    var collapseElementList = [].slice.call(document.querySelectorAll('.accordion-collapse'));
    collapseElementList.forEach(function (collapseEl) {
        new bootstrap.Collapse(collapseEl, {
            toggle: false // Initialize but don't toggle on page load, respect HTML 'show' class
        });
    });

    // Optional: You can add event listeners here if you need to perform actions
    // when accordion items are shown or hidden. For example:
    /*
    var accordionItems = document.querySelectorAll('.accordion-item .accordion-collapse');
    accordionItems.forEach(function(item) {
        item.addEventListener('shown.bs.collapse', function () {
            // console.log('Item shown: ' + this.id);
        });
        item.addEventListener('hidden.bs.collapse', function () {
            // console.log('Item hidden: ' + this.id);
        });
    });
    */
});
