    <div class="flex flex-wrap gap-1">
      <% base_params = { q: @query, category: @category.presence, language: @language_code.presence, starts_with: @starts_with.presence }.compact %>
      <% all_category_params = base_params.except(:category) %>
      <%= link_to "All",
                  entries_path(all_category_params),
                  class: "px-3 py-1 rounded-full #{@category.blank? ? 'bg-indigo-100 text-indigo-700' : 'bg-white border border-slate-200 text-slate-600 hover:border-indigo-300'} text-xs font-bold uppercase tracking-wider",
                  data: { turbo_stream: true } %>
      <% Entry.categories.keys.each do |category_name| %>
        <%= link_to category_name.tr('_', ' ').capitalize,
                    entries_path(base_params.merge(category: category_name)),
                    class: "px-3 py-1 rounded-full #{@category == category_name ? 'bg-indigo-100 text-indigo-700' : 'bg-white border border-slate-200 text-slate-600 hover:border-indigo-300'} text-xs font-bold uppercase tracking-wider",
                    data: { turbo_stream: true } %>
      <% end %>
    </div>

    <div class="flex flex-wrap gap-1 mt-2 mb-2">
      <% all_language_params = base_params.except(:language, :starts_with, :page) %>
      <%= link_to "All Languages",
                  entries_path(all_language_params),
                  class: "px-3 py-1 rounded-full #{@language_code.blank? ? 'bg-slate-900 text-white' : 'bg-white border border-slate-200 text-slate-600 hover:border-slate-300'} text-xs font-semibold uppercase tracking-wider",
                  data: { turbo_stream: true } %>
      <% @supported_languages.each do |language| %>
        <%= link_to "#{language.name} (#{language.code.upcase})",
                    entries_path(all_language_params.merge(language: language.code)),
                    class: "px-3 py-1 rounded-full #{@language_code == language.code ? 'bg-slate-900 text-white' : 'bg-white border border-slate-200 text-slate-600 hover:border-slate-300'} text-xs font-semibold uppercase tracking-wider",
                    data: { turbo_stream: true } %>
      <% end %>
    </div>

    <% if @language_code.present? %>
      <div class="flex flex-wrap gap-1 text-xs mb-2">
        <% alphabet_params = base_params.merge(language: @language_code).except(:starts_with, :page) %>
        <%= link_to "All",
                    entries_path(alphabet_params),
                    class: "px-2 py-1 rounded-md #{@starts_with.blank? ? 'bg-indigo-600 text-white' : 'bg-white border border-slate-200 text-slate-600 hover:border-indigo-300'}",
                    data: { turbo_stream: true } %>
        <% alphabet_letters(@language_code).each do |letter| %>
          <%= link_to letter,
                      entries_path(alphabet_params.merge(starts_with: letter)),
                      class: "px-2 py-1 rounded-md #{@starts_with == letter ? 'bg-indigo-600 text-white' : 'bg-white border border-slate-200 text-slate-600 hover:border-indigo-300'}",
                      data: { turbo_stream: true } %>
        <% end %>
      </div>
    <% end %>
