                   );
                    });
                }

                // Apply sorting
                sortDatasets();

                datasetCount.textContent = `${filteredDatasets.length} datasets`;
                currentPage = 1;
                displayCurrentPage();
                updatePagination();
            }

            function sortDatasets() {
                const sortMethod = sortSelect.value;

                switch (sortMethod) {
                    case 'title-asc':
         