 In list view, show up to 4 tags
                            const visibleTags = tagsArray.slice(0, 4);
                            visibleTags.forEach(tag => {
                                tagsHTML += `<span class="tag cursor-pointer" onclick="document.getElementById('search').value='${tag}'; document.getElementById('search').dispatchEvent(new Event('input'));">${tag}</span>`;
                            });

                            // Add a more tags indicator if needed
                            