        categoryDiv.appendChild(categoryName);
                        categoryDiv.appendChild(channelsList);

                        categoryContainer.appendChild(categoryDiv);
                    });
                    hideLoader();
                })
                .catch(error => {
                    hideLoader();
                    console.error('Error loading categories:', error);
                    alert('Categories could not be loaded. Please try again later.');
                });
        }

