.href = url.toString();
            }
        }
        
        function previousPage() {
            if (currentPage > 1) {
                currentPage--;
                const url = new URL(window.location);
                url.searchParams.set('page', currentPage);
                window.location.href = url.toString();
            }
        }
        
        // Update button states based on current page
        function updateButtonStates() {
            const prevBtn = document.querySelector('a[onclic