@if ($paginator->hasPages())
    <nav role="navigation" aria-label="Pagination Navigation" class="inline-flex space-x-1">
        {{-- Previous Page Link --}}
        @if ($paginator->onFirstPage())
            <span class="px-3 py-1 text-gray-400 bg-gray-100 border border-gray-300 rounded cursor-not-allowed">←</span>
        @else
            <a href="{{ $paginator->previousPageUrl() }}"
               class="px-3 py-1 bg-white border border-gray-300 text-blue-600 hover:bg-blue-50 rounded">
                ←
            </a>
        @endif

        {{-- Pagination Elements --}}
        @foreach ($elements as $element)
            {{-- "Three Dots" Separator --}}
            @if (is_string($element))
                <span class="px-3 py-1 text-gray-400 bg-gray-100 border border-gray-300 rounded">{{ $element }}</span>
            @endif

            {{-- Array Of Links --}}
            @if (is_array($element))
                @foreach ($element as $page => $url)
                    @if ($page == $paginator->currentPage())
                        <span class="px-3 py-1 bg-blue-600 text-white border border-blue-600 rounded font-semibold">{{ $page }}</span>
                    @else
                        <a href="{{ $url }}"
                           class="px-3 py-1 bg-white border border-gray-300 text-blue-600 hover:bg-blue-50 rounded">
                            {{ $page }}
                        </a>
                    @endif
                @endforeach
            @endif
        @endforeach

        {{-- Next Page Link --}}
        @if ($paginator->hasMorePages())
            <a href="{{ $paginator->nextPageUrl() }}"
               class="px-3 py-1 bg-white border border-gray-300 text-blue-600 hover:bg-blue-50 rounded">
                →
            </a>
        @else
            <span class="px-3 py-1 text-gray-400 bg-gray-100 border border-gray-300 rounded cursor-not-allowed">→</span>
        @endif
    </nav>
@endif