<?php $__env->startSection('title', 'Lessons — pick a module or course'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('coach.partials.header', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <p class="mb-6 max-w-2xl text-sm text-stone-600">
        Lessons live either <strong>inside a module</strong> or <strong>directly on a course</strong> (no module). Open the list you want to edit.
    </p>

    <?php $__currentLoopData = $programs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $program): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <section class="mb-8">
            <h2 class="text-lg font-semibold text-stone-900"><?php echo e($program->title); ?></h2>
            <ul class="mt-3 space-y-4">
                <?php $__currentLoopData = $program->courses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="rounded-2xl border border-stone-200 bg-white p-4 shadow-sm">
                        <div class="flex flex-wrap items-center justify-between gap-2">
                            <span class="font-medium text-stone-900"><?php echo e($course->title); ?></span>
                            <a href="<?php echo e(route('coach.lessons.index', ['tenant' => $tenant, 'course_id' => $course->id])); ?>"
                                class="text-sm font-medium text-teal-700 hover:underline">Course-level lessons</a>
                        </div>
                        <?php if($course->modules->isNotEmpty()): ?>
                            <ul class="mt-3 border-t border-stone-100 pt-3 text-sm">
                                <?php $__currentLoopData = $course->modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li class="flex flex-wrap items-center justify-between gap-2 py-1">
                                        <span class="text-stone-700"><?php echo e($module->title); ?></span>
                                        <a href="<?php echo e(route('coach.lessons.index', ['tenant' => $tenant, 'module_id' => $module->id])); ?>"
                                            class="text-teal-700 hover:underline">Lessons in module</a>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        <?php endif; ?>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </section>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

    <?php if($standaloneCourses->isNotEmpty()): ?>
        <section class="mb-8">
            <h2 class="text-lg font-semibold text-stone-900">Single courses</h2>
            <ul class="mt-3 space-y-4">
                <?php $__currentLoopData = $standaloneCourses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="rounded-2xl border border-stone-200 bg-white p-4 shadow-sm">
                        <div class="flex flex-wrap items-center justify-between gap-2">
                            <span class="font-medium text-stone-900"><?php echo e($course->title); ?></span>
                            <a href="<?php echo e(route('coach.lessons.index', ['tenant' => $tenant, 'course_id' => $course->id])); ?>"
                                class="text-sm font-medium text-teal-700 hover:underline">Course-level lessons</a>
                        </div>
                        <?php if($course->modules->isNotEmpty()): ?>
                            <ul class="mt-3 border-t border-stone-100 pt-3 text-sm">
                                <?php $__currentLoopData = $course->modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li class="flex flex-wrap items-center justify-between gap-2 py-1">
                                        <span class="text-stone-700"><?php echo e($module->title); ?></span>
                                        <a href="<?php echo e(route('coach.lessons.index', ['tenant' => $tenant, 'module_id' => $module->id])); ?>"
                                            class="text-teal-700 hover:underline">Lessons in module</a>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        <?php endif; ?>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </section>
    <?php endif; ?>

    <?php if($programs->isEmpty() && $standaloneCourses->isEmpty()): ?>
        <p class="text-sm text-stone-600">No courses yet. Start from <a href="<?php echo e(route('coach.programs.index', $tenant)); ?>" class="text-teal-800 hover:underline">Programs</a> or create a <a href="<?php echo e(route('coach.courses.standalone.create', $tenant)); ?>" class="text-teal-800 hover:underline">standalone course</a>.</p>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/nurudinwahablartey/Projects/lms/resources/views/coach/lessons/hub.blade.php ENDPATH**/ ?>