<?php if($paginator->total() > 0): ?>
    <div class="table-footer">
        <div style="display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;">
            <div style="display: flex; align-items: center; gap: 0.5rem; color: var(--text-label); font-size: 0.875rem; font-weight: 600;">
                <label for="per_page_select">Number of rows:</label>
                <select id="per_page_select" style="padding: 0.25rem 1.5rem 0.25rem 0.5rem; font-size: 0.875rem; border-radius: 6px; width: auto; border: 1px solid #e2e8f0; background-color: #ffffff; color: #0f172a; cursor: pointer; outline: none;" onchange="changePerPage(this)">
                    <?php $__currentLoopData = [10, 25, 50, 100, 250, 500]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($val); ?>" <?php echo e(request('per_page', 10) == $val ? 'selected' : ''); ?>><?php echo e($val); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
            <script>
                function changePerPage(select) {
                    const url = new URL(window.location.href);
                    url.searchParams.set('per_page', select.value);
                    url.searchParams.delete('page'); // reset to page 1
                    window.location.href = url.href;
                }
            </script>
            <span class="showing-text" style="margin: 0;">
                Showing <?php echo e($paginator->firstItem()); ?> to <?php echo e($paginator->lastItem()); ?> of <?php echo e($paginator->total()); ?> <?php echo e($resourceName ?? 'items'); ?>

            </span>
        </div>
        
        <?php if($paginator->hasPages()): ?>
            <ul class="pagination">
                <!-- Previous Page Link -->
                <?php if($paginator->onFirstPage()): ?>
                    <li class="page-item disabled">
                        <span>
                            <svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                                <path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7"></path>
                            </svg>
                        </span>
                    </li>
                <?php else: ?>
                    <li class="page-item">
                        <a href="<?php echo e($paginator->previousPageUrl()); ?>">
                            <svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                                <path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7"></path>
                            </svg>
                        </a>
                    </li>
                <?php endif; ?>

                <!-- Pagination Elements -->
                <?php $__currentLoopData = range(1, $paginator->lastPage()); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if($page == $paginator->currentPage()): ?>
                        <li class="page-item active">
                            <span><?php echo e($page); ?></span>
                        </li>
                    <?php else: ?>
                        <li class="page-item">
                            <a href="<?php echo e($paginator->url($page)); ?>"><?php echo e($page); ?></a>
                        </li>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                <!-- Next Page Link -->
                <?php if($paginator->hasMorePages()): ?>
                    <li class="page-item">
                        <a href="<?php echo e($paginator->nextPageUrl()); ?>">
                            <svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                                <path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </li>
                <?php else: ?>
                    <li class="page-item disabled">
                        <span>
                            <svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                                <path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"></path>
                            </svg>
                        </span>
                    </li>
                <?php endif; ?>
            </ul>
        <?php endif; ?>
    </div>
<?php endif; ?>

<style>
    /* Footer Pagination styling */
    .table-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 1.5rem;
        border-top: 1px solid var(--border-color, #e2e8f0);
        background-color: #fafafb;
        flex-wrap: wrap;
        gap: 1rem;
        width: 100%;
    }

    .showing-text {
        font-size: 0.85rem;
        color: var(--text-muted, #64748b);
        font-weight: 600;
    }

    .pagination {
        display: flex;
        align-items: center;
        list-style: none;
        gap: 0.25rem;
        margin: 0;
        padding: 0;
    }

    .page-item a, .page-item span {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        height: 32px;
        padding: 0 0.5rem;
        border-radius: 6px;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-label, #334155);
        text-decoration: none;
        border: 1px solid var(--border-color, #e2e8f0);
        background-color: var(--bg-card, #ffffff);
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .page-item.active span {
        background-color: var(--primary-light, #eff6ff);
        color: var(--primary-color, #3b46f1);
        border-color: var(--primary-color, #3b46f1);
    }

    .page-item a:hover {
        border-color: var(--border-hover, #cbd5e1);
        background-color: var(--bg-main, #f8fafc);
    }

    .page-item.disabled span {
        color: #cbd5e1;
        background-color: #f1f5f9;
        cursor: not-allowed;
        border-color: #e2e8f0;
    }

    .page-item svg {
        width: 0.875rem;
        height: 0.875rem;
        stroke-width: 2.5;
    }

    @media (max-width: 640px) {
        .table-footer {
            flex-direction: column !important;
            align-items: center !important;
        }
    }
</style>
<?php /**PATH D:\New\New\admin-panel\resources\views/common/pagination.blade.php ENDPATH**/ ?>