<?php $__env->startSection('title', 'Hadith Categories'); ?>

<?php $__env->startSection('content'); ?>
<div class="page-content">
    <div class="container-fluid">
        <!-- Page Title -->
        <div class="row">
            <div class="col-12">
                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                    <h4 class="mb-sm-0">Hadith Categories</h4>
                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="<?php echo e(route('home')); ?>">Home</a></li>
                            <li class="breadcrumb-item"><a href="<?php echo e(route('hadith.index')); ?>">Hadiths</a></li>
                            <li class="breadcrumb-item active">Categories</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="card border-0 shadow-sm">
                    <div class="card-header bg-transparent border-bottom">
                        <div class="d-flex justify-content-between align-items-center">
                            <h5 class="card-title mb-0">
                                <i class="ri-bookmark-line text-primary me-2"></i> All Categories
                                <span class="badge bg-soft-primary text-primary ms-2"><?php echo e($categories->count()); ?></span>
                            </h5>
                            <a href="<?php echo e(route('hadith-categories.create')); ?>" class="btn btn-primary btn-sm">
                                <i class="ri-add-line me-1"></i> Add Category
                            </a>
                        </div>
                    </div>
                    <div class="card-body">
                        <?php if(session('success')): ?>
                            <div class="alert alert-success alert-dismissible fade show" role="alert">
                                <i class="ri-check-line me-2"></i><?php echo e(session('success')); ?>

                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                            </div>
                        <?php endif; ?>

                        <?php if(session('error')): ?>
                            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                                <i class="ri-error-warning-line me-2"></i><?php echo e(session('error')); ?>

                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                            </div>
                        <?php endif; ?>

                        <div class="table-responsive">
                            <table class="table table-hover align-middle mb-0">
                                <thead class="table-light">
                                    <tr>
                                        <th style="width: 60px;">ID</th>
                                        <th>Name</th>
                                        <th>Description</th>
                                        <th>Hadiths Count</th>
                                        <th>Created At</th>
                                        <th style="width: 120px;">Actions</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__empty_1 = true; $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr class="table-row-hover">
                                        <td>
                                            <span class="badge bg-primary rounded-pill"><?php echo e($category->id); ?></span>
                                        </td>
                                        <td>
                                            <strong class="text-dark"><?php echo e($category->name); ?></strong>
                                        </td>
                                        <td>
                                            <span class="text-muted"><?php echo e($category->description ?? 'N/A'); ?></span>
                                        </td>
                                        <td>
                                            <span class="badge bg-soft-info text-info"><?php echo e($category->hadiths_count); ?></span>
                                        </td>
                                        <td>
                                            <span class="text-muted">
                                                <i class="ri-calendar-line me-1"></i><?php echo e($category->created_at->format('d M, Y')); ?>

                                            </span>
                                        </td>
                                        <td>
                                            <div class="d-flex gap-2">
                                                <a href="<?php echo e(route('hadith-categories.edit', $category->id)); ?>" class="btn btn-sm btn-primary rounded-pill" title="Edit">
                                                    <i class="ri-edit-line"></i>
                                                </a>
                                                <form action="<?php echo e(route('hadith-categories.destroy', $category->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this category?');">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-sm btn-danger rounded-pill" title="Delete">
                                                        <i class="ri-delete-bin-line"></i>
                                                    </button>
                                                </form>
                                            </div>
                                        </td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="6" class="text-center py-5">
                                            <div class="text-muted">
                                                <i class="ri-inbox-line fs-1 d-block mb-2"></i>
                                                No categories found
                                            </div>
                                        </td>
                                    </tr>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $__env->startPush('styles'); ?>
<style>
    .table-row-hover:hover {
        background-color: #f8f9fa;
        transition: background-color 0.2s ease;
    }
</style>
<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/macbookpro/Downloads/mulikat/resources/views/dashboard/hadith-category/index.blade.php ENDPATH**/ ?>