@if ($paginator->hasPages())
    <nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="pagination">
        <div class="flex justify-center">
            {{-- Previous Page Link --}}
            @if ($paginator->onFirstPage())
                <span class="pagination-item disabled" aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
                    <span class="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-400 dark:text-gray-600">
                        <i class="fas fa-chevron-left"></i>
                    </span>
                </span>
            @else
                <a href="{{ $paginator->previousPageUrl() }}" 
                   rel="prev" 
                   class="pagination-item" 
                   aria-label="{{ __('pagination.previous') }}">
                    <span class="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
                        <i class="fas fa-chevron-left"></i>
                    </span>
                </a>
            @endif

            {{-- Pagination Elements --}}
            @foreach ($elements as $element)
                {{-- "Three Dots" Separator --}}
                @if (is_string($element))
                    <span class="pagination-item disabled" aria-disabled="true">
                        <span class="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-400 dark:text-gray-600">{{ $element }}</span>
                    </span>
                @endif

                {{-- Array Of Links --}}
                @if (is_array($element))
                    @foreach ($element as $page => $url)
                        @if ($page == $paginator->currentPage())
                            <span class="pagination-item active" aria-current="page">
                                <span class="px-3 py-2 border border-emerald-600 dark:border-emerald-500 rounded-lg bg-emerald-600 dark:bg-emerald-500 text-white">{{ $page }}</span>
                            </span>
                        @else
                            <a href="{{ $url }}" class="pagination-item" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
                                <span class="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">{{ $page }}</span>
                            </a>
                        @endif
                    @endforeach
                @endif
            @endforeach

            {{-- Next Page Link --}}
            @if ($paginator->hasMorePages())
                <a href="{{ $paginator->nextPageUrl() }}" 
                   rel="next" 
                   class="pagination-item" 
                   aria-label="{{ __('pagination.next') }}">
                    <span class="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
                        <i class="fas fa-chevron-right"></i>
                    </span>
                </a>
            @else
                <span class="pagination-item disabled" aria-disabled="true" aria-label="{{ __('pagination.next') }}">
                    <span class="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-400 dark:text-gray-600">
                        <i class="fas fa-chevron-right"></i>
                    </span>
                </span>
            @endif
        </div>
    </nav>
@endif