<?php $__env->startSection('title', 'Event Registrations'); ?>
<?php $__env->startSection('page-title', 'Event Registrations'); ?>

<?php $__env->startSection('content'); ?>
<form method="GET" action="<?php echo e(route('admin.event-registrations.index')); ?>"
      class="bg-white rounded-xl border border-gray-100 shadow-sm p-4 mb-4">
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">
        <input type="text" name="search" value="<?php echo e(request('search')); ?>"
               placeholder="Name, phone or email..."
               class="px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 col-span-1 sm:col-span-2 lg:col-span-2" />

        <select name="event_id" class="px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
            <option value="">All Events</option>
            <?php $__currentLoopData = $events; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $event): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($event->id); ?>" <?php echo e((string) request('event_id') === (string) $event->id ? 'selected' : ''); ?>>
                    <?php echo e($event->title); ?>

                </option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>

        <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold px-4 py-2 rounded-lg transition">
            Filter
        </button>
    </div>
</form>

<div class="bg-white rounded-xl border border-gray-100 shadow-sm overflow-hidden">
    <div class="px-5 py-3 border-b border-gray-100">
        <span class="text-sm text-gray-500 font-medium"><?php echo e($registrations->total()); ?> submissions found</span>
    </div>

    <?php if($registrations->isEmpty()): ?>
        <div class="text-center py-16 text-gray-400">
            <p class="text-sm">No event submissions yet.</p>
        </div>
    <?php else: ?>
        <div class="overflow-x-auto">
            <table class="min-w-full divide-y divide-gray-100">
                <thead class="bg-gray-50 text-xs text-gray-500 uppercase tracking-wide">
                    <tr>
                        <th class="px-5 py-3 text-left">Event</th>
                        <th class="px-5 py-3 text-left">Applicant</th>
                        <th class="px-5 py-3 text-left hidden lg:table-cell">Academic</th>
                        <th class="px-5 py-3 text-left hidden xl:table-cell">Source</th>
                        <th class="px-5 py-3 text-left hidden xl:table-cell">Date</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-gray-50">
                    <?php $__currentLoopData = $registrations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr class="hover:bg-gray-50 transition">
                            <td class="px-5 py-4">
                                <p class="text-sm font-semibold text-gray-800"><?php echo e($item->event?->title ?: '-'); ?></p>
                                <p class="text-xs text-gray-400">#<?php echo e($item->id); ?></p>
                            </td>
                            <td class="px-5 py-4">
                                <p class="font-semibold text-gray-800 text-sm"><?php echo e($item->full_name); ?></p>
                                <p class="text-xs text-gray-500"><?php echo e($item->phone); ?></p>
                                <p class="text-xs text-blue-500"><?php echo e($item->email); ?></p>
                            </td>
                            <td class="px-5 py-4 hidden lg:table-cell">
                                <p class="text-sm text-gray-700"><?php echo e($item->last_qualification); ?></p>
                                <p class="text-xs text-gray-500">CGPA: <?php echo e($item->undergraduate_result ?: '-'); ?></p>
                                <p class="text-xs text-gray-500">IELTS: <?php echo e($item->ielts_status ?: '-'); ?></p>
                            </td>
                            <td class="px-5 py-4 hidden xl:table-cell">
                                <p class="text-sm text-gray-700"><?php echo e($item->utm_source ?: ($item->source ?: 'direct')); ?></p>
                                <p class="text-xs text-gray-500"><?php echo e($item->utm_campaign ?: '-'); ?></p>
                            </td>
                            <td class="px-5 py-4 hidden xl:table-cell text-xs text-gray-400">
                                <?php echo e($item->created_at->format('d M Y')); ?><br/>
                                <span class="text-gray-300"><?php echo e($item->created_at->format('h:i A')); ?></span>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>

        <?php if($registrations->hasPages()): ?>
            <div class="px-5 py-4 border-t border-gray-100"><?php echo e($registrations->links()); ?></div>
        <?php endif; ?>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\gps-migration\resources\views\admin\event-registrations\index.blade.php ENDPATH**/ ?>