<?php $__empty_1 = true; $__currentLoopData = $courses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr class="<?php echo e($i % 2 === 0 ? 'bg-white' : 'bg-gray-50/50'); ?> hover:bg-indigo-50/30 transition">

    
    <td class="px-4 py-3 text-gray-400 text-xs font-medium">
        <?php echo e($courses->firstItem() + $i); ?>

    </td>

    
    <td class="px-4 py-3">
        <div class="flex items-center gap-2">
            <?php if($course->featured_image): ?>
                <img src="<?php echo e(asset('storage/' . $course->featured_image)); ?>"
                     alt="<?php echo e($course->title); ?>"
                     class="w-8 h-8 rounded-lg object-cover flex-shrink-0">
            <?php else: ?>
                <span class="w-8 h-8 bg-indigo-100 rounded-lg flex items-center justify-center flex-shrink-0">
                    <i class="fas fa-book text-indigo-500 text-xs"></i>
                </span>
            <?php endif; ?>
            <div>
                <p class="font-semibold text-gray-800 text-sm leading-tight"><?php echo e($course->title); ?></p>
                <p class="text-gray-400 text-xs mt-0.5 line-clamp-1"><?php echo e(Str::limit($course->description, 60)); ?></p>
            </div>
        </div>
    </td>

    
    <td class="px-4 py-3">
        <?php if($course->category): ?>
            <span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-700">
                <?php if($course->category->icon): ?>
                    <i class="<?php echo e($course->category->icon); ?> text-xs"></i>
                <?php endif; ?>
                <?php echo e($course->category->name); ?>

            </span>
        <?php else: ?>
            <span class="text-gray-300 text-xs">—</span>
        <?php endif; ?>
    </td>

    
    <td class="px-4 py-3">
        <?php
            $statusMap = [
                'published' => ['bg-green-100 text-green-700', 'fa-circle-check'],
                'draft'     => ['bg-amber-100 text-amber-700', 'fa-pencil'],
                'archived'  => ['bg-gray-100 text-gray-500',  'fa-archive'],
            ];
            [$statusClass, $statusIcon] = $statusMap[$course->status] ?? ['bg-gray-100 text-gray-500', 'fa-circle'];
        ?>
        <span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium <?php echo e($statusClass); ?>">
            <i class="fas <?php echo e($statusIcon); ?> text-xs"></i>
            <?php echo e(ucfirst($course->status)); ?>

        </span>
    </td>

    
    <td class="px-4 py-3">
        <?php if($course->isFree()): ?>
            <span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700">
                <i class="fas fa-gift text-xs"></i> Free
            </span>
        <?php else: ?>
            <span class="text-gray-700 text-xs font-medium">
                <?php echo e($course->currency); ?> <?php echo e(number_format($course->fee_amount)); ?>

            </span>
        <?php endif; ?>
    </td>

    
    <td class="px-4 py-3">
        <span class="inline-flex items-center gap-1 text-xs font-medium text-rose-700">
            <i class="fas fa-users text-rose-400"></i>
            <?php echo e(number_format($course->enrollments_count)); ?>

        </span>
    </td>

    
    <td class="px-4 py-3">
        <span class="inline-flex items-center gap-1 text-xs font-medium text-teal-700">
            <i class="fas fa-list-ul text-teal-400"></i>
            <?php echo e(number_format($course->topics_count)); ?>

        </span>
    </td>

    
    <td class="px-4 py-3">
        <div class="flex items-center gap-1">
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('view self-paced courses')): ?>
            <a href="<?php echo e(route('self-paced.dashboard.courses.show', $course)); ?>"
               title="Manage Course"
               class="inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-semibold transition">
                <i class="fas fa-cog text-xs"></i> Manage
            </a>
            <?php endif; ?>
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit self-paced courses')): ?>
            <a href="<?php echo e(route('self-paced.dashboard.courses.edit', $course)); ?>"
               title="Edit"
               class="w-7 h-7 flex items-center justify-center rounded-lg bg-amber-50 hover:bg-amber-100 text-amber-600 transition">
                <i class="fas fa-pencil text-xs"></i>
            </a>
            <?php endif; ?>
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete self-paced courses')): ?>
            <button type="button"
                    title="Delete"
                    onclick="confirmDelete(<?php echo e($course->id); ?>, '<?php echo e(addslashes($course->title)); ?>')"
                    class="w-7 h-7 flex items-center justify-center rounded-lg bg-red-50 hover:bg-red-100 text-red-600 transition">
                <i class="fas fa-trash text-xs"></i>
            </button>
            <form id="delete-form-<?php echo e($course->id); ?>"
                  action="<?php echo e(route('self-paced.dashboard.courses.destroy', $course)); ?>"
                  method="POST" class="hidden">
                <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
            </form>
            <?php endif; ?>
        </div>
    </td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
    <td colspan="8" class="px-6 py-16 text-center">
        <i class="fas fa-book-open text-5xl text-gray-200 mb-4 block"></i>
        <p class="text-gray-400 font-medium">No courses found</p>
        <p class="text-gray-300 text-sm mt-1">Try adjusting your search or filters.</p>
    </td>
</tr>
<?php endif; ?>
<?php /**PATH /home/www/sshia.org/sshia/resources/views/self-paced/dashboard/courses/partials/table.blade.php ENDPATH**/ ?>