<?php $__env->startSection('title', 'Manage Portfolio'); ?>

<?php $__env->startSection('content'); ?>
<div class="container mx-auto max-w-6xl">
    <div class="flex justify-between items-center mb-6">
        <h1 class="text-2xl font-bold text-slate-900">Manage Portfolio</h1>
        <a href="<?php echo e(route('admin.portfolio.create')); ?>" class="bg-brand-primary hover:bg-brand-accent text-white font-bold py-2.5 px-5 rounded-lg shadow-md shadow-brand-primary/20 transition flex items-center gap-2 text-sm">
            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path></svg>
            Add New Item
        </a>
    </div>

    <div class="bg-white shadow-sm rounded-xl border border-slate-100 overflow-hidden">
        <div class="overflow-x-auto">
            <table class="min-w-full leading-normal">
                <thead>
                    <tr>
                        <th class="px-5 py-4 border-b-2 border-slate-100/80 bg-slate-50 text-left text-xs font-bold text-slate-500 uppercase tracking-wider">Image</th>
                        <th class="px-5 py-4 border-b-2 border-slate-100/80 bg-slate-50 text-left text-xs font-bold text-slate-500 uppercase tracking-wider">Title</th>
                        <th class="px-5 py-4 border-b-2 border-slate-100/80 bg-slate-50 text-left text-xs font-bold text-slate-500 uppercase tracking-wider">Category</th>
                        <th class="px-5 py-4 border-b-2 border-slate-100/80 bg-slate-50 text-right text-xs font-bold text-slate-500 uppercase tracking-wider">Actions</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-slate-100">
                    <?php $__empty_1 = true; $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-slate-50/50 transition duration-150">
                        <td class="px-5 py-5 bg-transparent text-sm w-24">
                            <img src="<?php echo e(asset($item->image_path)); ?>" alt="<?php echo e($item->title); ?>" class="w-20 h-14 object-cover rounded-md border border-slate-200 shadow-sm" onerror="this.src='https://placehold.co/100x70/e2e8f0/94a3b8?text=Error'">
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm">
                            <p class="text-slate-900 font-bold"><?php echo e($item->title); ?></p>
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm">
                            <span class="inline-block px-3 py-1 text-xs font-bold bg-blue-50 text-blue-600 rounded-full border border-blue-100/50 uppercase tracking-wide"><?php echo e($item->category); ?></span>
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm text-right">
                            <div class="flex items-center justify-end gap-3">
                                <a href="<?php echo e(route('admin.portfolio.edit', $item)); ?>" class="p-2 text-slate-400 hover:text-brand-primary bg-slate-50 hover:bg-brand-light rounded-lg transition" title="Edit">
                                    <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>
                                </a>
                                <form method="POST" action="<?php echo e(route('admin.portfolio.destroy', $item)); ?>" class="inline" onsubmit="return confirm('Are you sure you want to delete this portfolio item?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="p-2 text-slate-400 hover:text-red-500 bg-slate-50 hover:bg-red-50 rounded-lg transition" title="Delete">
                                        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg>
                                    </button>
                                </form>
                            </div>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="4" class="px-5 py-10 text-center text-slate-500 bg-white">
                            <div class="flex flex-col items-center justify-center">
                                <svg class="w-12 h-12 text-slate-300 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>
                                <p class="text-lg font-medium text-slate-900 mb-1">No portfolio items yet</p>
                                <p class="text-sm">Get started by creating a new portfolio project.</p>
                            </div>
                        </td>
                    </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

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