document.addEventListener('DOMContentLoaded', function() {
    var viewDescLinks = document.querySelectorAll('.toggle-description');
    viewDescLinks.forEach(function(link) {
        link.addEventListener('click', function(event) {
            event.preventDefault();
            var logId = this.getAttribute('data-log-id');
            var descriptionDiv = document.getElementById('log-description-' + logId);
            if (descriptionDiv) {
                descriptionDiv.style.display = (descriptionDiv.style.display === 'none' || descriptionDiv.style.display === '') ? 'block' : 'none';
            }
        });
    });
});