{# tag_me/templates/tag_me/tag_me_select_search_bar_desktop.html #}
{% comment %}
  DESKTOP INLINE ACTION BUTTONS
  Icon-only buttons that appear conditionally based on state
  Always visible when relevant (no menu)
{% endcomment %}
<!-- Quick Actions (Desktop Only - Always Visible When Relevant) -->
<div class="flex items-center gap-1">
    <!-- Add Button (Desktop) -->
    <button type="button"
            x-show="canAddTag && !isCreatingTag"
            x-transition.opacity.duration.150ms
            @click.stop="createNewTag()"
            class="relative p-2 text-indigo-500 dark:text-indigo-400 rounded transition-colors duration-150 hover:bg-gray-100 dark:hover:bg-white/10 hover:text-indigo-600 dark:hover:text-indigo-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-gray-800"
            title="Add new tag">
        <svg xmlns="http://www.w3.org/2000/svg"
             class="h-5 w-5"
             fill="none"
             viewBox="0 0 24 24"
             stroke="currentColor"
             stroke-width="2">
            <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
        </svg>
    </button>
    <!-- Loading Spinner (Desktop) -->
    <div x-show="isCreatingTag" class="inline-flex items-center px-2">
        <svg class="animate-spin h-5 w-5 text-indigo-500 dark:text-indigo-400"
             xmlns="http://www.w3.org/2000/svg"
             fill="none"
             viewBox="0 0 24 24">
            <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
            <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
            </path>
        </svg>
    </div>
    <!-- Clear Search Button -->
    <button type="button"
            x-show="search.length > 0 && !isCreatingTag"
            x-transition.opacity.duration.150ms
            @click.stop="clearSearch()"
            class="relative p-2 text-gray-500 dark:text-gray-400 rounded transition-colors duration-150 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-gray-800"
            title="Clear search">
        <svg xmlns="http://www.w3.org/2000/svg"
             class="h-5 w-5"
             fill="none"
             viewBox="0 0 24 24"
             stroke="currentColor"
             stroke-width="2">
            <path stroke-linecap="round" stroke-linejoin="round" d="m6 6 12 12m3-6a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
        </svg>
    </button>
    <!-- Remove All Tags Button -->
    <button type="button"
            x-show="selectedTags.size > 0 && !isCreatingTag"
            x-transition.opacity.duration.150ms
            @click.stop="deselectAll()"
            class="relative p-2 text-gray-500 dark:text-gray-400 rounded transition-colors duration-150 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-gray-800"
            :title="'Remove ' + selectedTags.size + ' tags'">
        <svg xmlns="http://www.w3.org/2000/svg"
             class="h-5 w-5"
             fill="none"
             viewBox="0 0 24 24"
             stroke="currentColor"
             stroke-width="2">
            <path stroke-linecap="round" stroke-linejoin="round" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z" />
        </svg>
        <span class="absolute -top-1 -right-1 inline-flex items-center justify-center px-1 py-0.5 text-[10px] font-bold text-white bg-indigo-500 dark:bg-indigo-500 rounded-full min-w-[0.875rem] h-3.5"
              x-text="selectedTags.size"></span>
    </button>
    <!-- Help Icon (Desktop) -->
    <a x-show="helpUrl"
       :href="helpUrl"
       target="_blank"
       class="relative p-2 text-gray-500 dark:text-gray-400 rounded transition-colors duration-150 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-gray-800"
       title="Help">
        <svg xmlns="http://www.w3.org/2000/svg"
             class="h-5 w-5"
             fill="none"
             viewBox="0 0 24 24"
             stroke="currentColor"
             stroke-width="2">
            <path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" />
        </svg>
    </a>
    <!-- Management Icon (Desktop) -->
    <a x-show="mgmtUrl"
       :href="mgmtUrl"
       class="relative p-2 text-gray-500 dark:text-gray-400 rounded transition-colors duration-150 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-gray-800"
       target="_blank"
       title="Tag Management">
        <svg xmlns="http://www.w3.org/2000/svg"
             class="h-5 w-5"
             fill="none"
             viewBox="0 0 24 24"
             stroke="currentColor"
             stroke-width="2">
            <path stroke-linecap="round" stroke-linejoin="round" d="M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z" />
            <path stroke-linecap="round" stroke-linejoin="round" d="M6 6h.008v.008H6V6Z" />
        </svg>
    </a>
</div>
