<div class="flex items-center justify-between bg-gray-200 text-black rounded-full px-4 py-2 w-64 mx-auto mt-8">

    <!-- Previous Button -->
    @if ($paginator->onFirstPage())
        <span class="gradient-btn w-8 h-8 flex items-center justify-center rounded-full text-sm">
            <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-black" fill="none" viewBox="0 0 24 24"
                stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
            </svg>
        </span>
    @else
        <a href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-disabled="true"
            class="gradient-btn hover:bg-gray-700 w-8 h-8 flex items-center justify-center rounded-full text-sm  paginator-link relative">
            <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-black" fill="none" viewBox="0 0 24 24"
                stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
            </svg>
        </a>
    @endif

    @php
        $pageCount = $paginator->lastPage();
        $currentPage = $paginator->currentPage();
        $startIndex = $currentPage <= 2 ? 1 : max($currentPage - 2, 1);
        $endIndex = $currentPage <= 2 ? min($pageCount, 6) : min($currentPage + 2, $pageCount);
    @endphp

    <!-- Page Indicator -->
    <span class="text-sm font-medium">
        <span>{{ $currentPage }} of {{ $pageCount }}</span>
    </span>

    <!-- Next Button -->
    @if ($paginator->hasMorePages())
        <a href="{{ $paginator->nextPageUrl() }}" rel="next" aria-disabled="true"
            class="gradient-btn hover:bg-gray-700 w-8 h-8 flex items-center justify-center rounded-full text-sm  paginator-link relative">
            <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-black" fill="none" viewBox="0 0 24 24"
                stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
            </svg>
        </a>
    @else
        <span class="gradient-btn w-8 h-8 flex items-center justify-center rounded-full text-sm">
            <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-black" fill="none" viewBox="0 0 24 24"
                stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
            </svg>
        </span>
    @endif
</div>
