<?php $__env->startSection('title', 'Visa Success Stories'); ?>

<?php $__env->startSection('content'); ?>
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6">
    <div>
        <h2 class="text-xl font-bold text-gray-800">Visa Success Stories</h2>
        <p class="text-sm text-gray-500 mt-0.5">Global pool — shown automatically on Home page and all Country pages. <?php echo e($stories->total()); ?> total.</p>
    </div>
    <a href="<?php echo e(route('admin.visa-stories.create')); ?>" class="inline-flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold px-4 py-2.5 rounded-lg transition">
        + Add Story
    </a>
</div>

<?php if(session('success')): ?>
    <div class="mb-4 rounded-lg bg-green-100 border border-green-300 text-green-700 px-4 py-3 text-sm"><?php echo e(session('success')); ?></div>
<?php endif; ?>

<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
    <?php if($stories->isEmpty()): ?>
        <div class="text-center py-16 text-sm text-gray-500">No visa success stories yet. Add your first one.</div>
    <?php else: ?>
        <table class="min-w-full divide-y divide-gray-100">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-5 py-3 text-left text-xs font-semibold text-gray-500 uppercase">Story</th>
                    <th class="px-5 py-3 text-left text-xs font-semibold text-gray-500 uppercase hidden md:table-cell">University / Country</th>
                    <th class="px-5 py-3 text-left text-xs font-semibold text-gray-500 uppercase hidden md:table-cell">Sort</th>
                    <th class="px-5 py-3 text-left text-xs font-semibold text-gray-500 uppercase hidden md:table-cell">Status</th>
                    <th class="px-5 py-3 text-right text-xs font-semibold text-gray-500 uppercase">Actions</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-gray-100">
                <?php $__currentLoopData = $stories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $story): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td class="px-5 py-4">
                            <div class="flex items-center gap-3">
                                <?php if($story->image_url): ?>
                                    <img src="<?php echo e($story->image_url); ?>" alt="<?php echo e($story->title); ?>" class="w-12 h-12 rounded-lg object-cover flex-shrink-0">
                                <?php else: ?>
                                    <div class="w-12 h-12 rounded-lg bg-gray-100 flex items-center justify-center flex-shrink-0 text-gray-400 text-xl">✦</div>
                                <?php endif; ?>
                                <div>
                                    <p class="text-sm font-semibold text-gray-800"><?php echo e($story->title); ?></p>
                                    <?php if($story->student_name): ?>
                                        <p class="text-xs text-gray-400"><?php echo e($story->student_name); ?><?php echo e($story->program ? ' · ' . $story->program : ''); ?></p>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </td>
                        <td class="px-5 py-4 hidden md:table-cell text-sm text-gray-600">
                            <?php echo e($story->university); ?><?php echo e(($story->university && $story->country_name) ? ' · ' : ''); ?><?php echo e($story->country_name); ?>

                        </td>
                        <td class="px-5 py-4 hidden md:table-cell text-sm text-gray-600"><?php echo e($story->sort_order); ?></td>
                        <td class="px-5 py-4 hidden md:table-cell">
                            <span class="text-xs px-2 py-1 rounded-full <?php echo e($story->is_active ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'); ?>">
                                <?php echo e($story->is_active ? 'Active' : 'Inactive'); ?>

                            </span>
                        </td>
                        <td class="px-5 py-4">
                            <div class="flex justify-end gap-2">
                                <a href="<?php echo e(route('admin.visa-stories.edit', $story)); ?>" class="px-2 py-1 text-xs bg-blue-100 text-blue-700 rounded">Edit</a>
                                <form method="POST" action="<?php echo e(route('admin.visa-stories.destroy', $story)); ?>" onsubmit="return confirm('Delete this story?')">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="px-2 py-1 text-xs bg-red-100 text-red-700 rounded">Delete</button>
                                </form>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
        <div class="px-5 py-4 border-t border-gray-100">
            <?php echo e($stories->links()); ?>

        </div>
    <?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\visa-stories\index.blade.php ENDPATH**/ ?>