@if ($paginator->hasPages())
    <nav class="flex items-center space-x-1" role="navigation" aria-label="Pagination">
        @if ($paginator->onFirstPage())
            <span class="w-10 h-10 flex items-center justify-center rounded-lg text-gray-400 bg-gray-100 cursor-not-allowed">
                <i class="fas fa-chevron-left text-xs"></i>
            </span>
        @else
            <a href="{{ $paginator->previousPageUrl() }}#gallery" class="w-10 h-10 flex items-center justify-center rounded-lg text-gray-600 bg-white border border-gray-200 hover:bg-primary-50 hover:text-primary-600 hover:border-primary-200 transition-all duration-200">
                <i class="fas fa-chevron-left text-xs"></i>
            </a>
        @endif

        @foreach ($elements as $element)
            @if (is_array($element))
                @foreach ($element as $page => $url)
                    @if ($page == $paginator->currentPage())
                        <span class="w-10 h-10 flex items-center justify-center rounded-lg bg-primary-500 text-white font-medium text-sm shadow-md">
                            {{ $page }}
                        </span>
                    @else
                        <a href="{{ $url }}#gallery" class="w-10 h-10 flex items-center justify-center rounded-lg text-gray-600 bg-white border border-gray-200 hover:bg-primary-50 hover:text-primary-600 hover:border-primary-200 transition-all duration-200 text-sm">
                            {{ $page }}
                        </a>
                    @endif
                @endforeach
            @endif
        @endforeach

        @if ($paginator->hasMorePages())
            <a href="{{ $paginator->nextPageUrl() }}#gallery" class="w-10 h-10 flex items-center justify-center rounded-lg text-gray-600 bg-white border border-gray-200 hover:bg-primary-50 hover:text-primary-600 hover:border-primary-200 transition-all duration-200">
                <i class="fas fa-chevron-right text-xs"></i>
            </a>
        @else
            <span class="w-10 h-10 flex items-center justify-center rounded-lg text-gray-400 bg-gray-100 cursor-not-allowed">
                <i class="fas fa-chevron-right text-xs"></i>
            </span>
        @endif
    </nav>
@endif
