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

<?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 FAQs</h1>
        <a href="<?php echo e(route('admin.faqs.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 FAQ
        </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 w-24">Order</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">Question</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">Answer Preview</th>
                        <th class="px-5 py-4 border-b-2 border-slate-100/80 bg-slate-50 text-center text-xs font-bold text-slate-500 uppercase tracking-wider">Status</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 = $faqs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $faq): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-slate-50/50 transition duration-150 group">
                        <td class="px-5 py-5 bg-transparent text-sm">
                            <span class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-slate-100 text-slate-600 font-bold border border-slate-200">
                                <?php echo e($faq->sort_order); ?>

                            </span>
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm">
                            <p class="text-slate-900 font-bold max-w-xs truncate" title="<?php echo e($faq->question); ?>"><?php echo e($faq->question); ?></p>
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm">
                            <p class="text-slate-500 truncate max-w-sm" title="<?php echo e($faq->answer); ?>"><?php echo e($faq->answer); ?></p>
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm text-center">
                            <form action="<?php echo e(route('admin.faqs.toggle', $faq)); ?>" method="POST" class="inline">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PATCH'); ?>
                                <button type="submit" class="inline-block px-3 py-1 text-xs font-bold rounded-full border transition-colors <?php echo e($faq->is_active ? 'bg-emerald-50 text-emerald-600 border-emerald-200 hover:bg-emerald-100' : 'bg-slate-50 text-slate-500 border-slate-200 hover:bg-slate-100'); ?>">
                                    <?php echo e($faq->is_active ? 'Active' : 'Hidden'); ?>

                                </button>
                            </form>
                        </td>
                        <td class="px-5 py-5 bg-transparent text-sm text-right">
                            <div class="flex items-center justify-end gap-3 opacity-100 lg:opacity-0 group-hover:opacity-100 transition-opacity">
                                <a href="<?php echo e(route('admin.faqs.edit', $faq)); ?>" 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.faqs.destroy', $faq)); ?>" class="inline" onsubmit="return confirm('Are you sure you want to delete this FAQ?');">
                                    <?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="5" 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="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
                                <p class="text-lg font-medium text-slate-900 mb-1">No FAQs yet</p>
                                <p class="text-sm">Get started by answering popular questions.</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/faqs/index.blade.php ENDPATH**/ ?>