@if ($paginator->hasPages())
    <nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="pagination-container">
        <div class="pagination-mobile">
            @if ($paginator->onFirstPage())
                <span class="pagination-link-btn disabled">
                    {!! __('pagination.previous') !!}
                </span>
            @else
                <a href="{{ $paginator->previousPageUrl() }}" class="pagination-link-btn">
                    {!! __('pagination.previous') !!}
                </a>
            @endif

            @if ($paginator->hasMorePages())
                <a href="{{ $paginator->nextPageUrl() }}" class="pagination-link-btn">
                    {!! __('pagination.next') !!}
                </a>
            @else
                <span class="pagination-link-btn disabled">
                    {!! __('pagination.next') !!}
                </span>
            @endif
        </div>

        <div class="pagination-desktop">
            <div class="pagination-info">
                Showing 
                <span class="info-highlight">{{ $paginator->firstItem() }}</span>
                to
                <span class="info-highlight">{{ $paginator->lastItem() }}</span>
                of
                <span class="info-highlight">{{ $paginator->total() }}</span>
                Results
            </div>

            <div class="pagination-links-group">
                {{-- Previous Page Link --}}
                @if ($paginator->onFirstPage())
                    <span class="pagination-link nav-icon disabled" aria-disabled="true">
                        <i data-lucide="chevron-left" size="16"></i>
                    </span>
                @else
                    <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-link nav-icon" aria-label="{{ __('pagination.previous') }}">
                        <i data-lucide="chevron-left" size="16"></i>
                    </a>
                @endif

                {{-- Pagination Elements --}}
                @foreach ($elements as $element)
                    @if (is_string($element))
                        <span class="pagination-link disabled" aria-disabled="true">{{ $element }}</span>
                    @endif

                    @if (is_array($element))
                        @foreach ($element as $page => $url)
                            @if ($page == $paginator->currentPage())
                                <span class="pagination-link active" aria-current="page">{{ $page }}</span>
                            @else
                                <a href="{{ $url }}" class="pagination-link" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
                                    {{ $page }}
                                </a>
                            @endif
                        @endforeach
                    @endif
                @endforeach

                {{-- Next Page Link --}}
                @if ($paginator->hasMorePages())
                    <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="pagination-link nav-icon" aria-label="{{ __('pagination.next') }}">
                        <i data-lucide="chevron-right" size="16"></i>
                    </a>
                @else
                    <span class="pagination-link nav-icon disabled" aria-disabled="true">
                        <i data-lucide="chevron-right" size="16"></i>
                    </span>
                @endif
            </div>
        </div>
    </nav>
    <script>lucide.createIcons();</script>
@endif
