<?php $__env->startSection('title', 'Modules — pick a 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">
        Modules belong to a <strong>course</strong>. Pick a course below to list or create modules. Short courses can skip modules and use
        <a href="<?php echo e(route('coach.lessons.index', $tenant)); ?>" class="font-medium text-teal-800 hover:underline">course-level lessons</a> instead.
    </p>

    <?php $__empty_1 = true; $__currentLoopData = $programs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $program): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <section class="mb-8">
            <h2 class="text-lg font-semibold text-stone-900"><?php echo e($program->title); ?></h2>
            <?php if($program->summary): ?>
                <p class="mt-1 text-sm text-stone-600"><?php echo e($program->summary); ?></p>
            <?php endif; ?>
            <ul class="mt-3 divide-y divide-stone-200 rounded-2xl border border-stone-200 bg-white shadow-sm">
                <?php $__currentLoopData = $program->courses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="flex flex-wrap items-center justify-between gap-3 px-4 py-3">
                        <span class="font-medium text-stone-900"><?php echo e($course->title); ?></span>
                        <a href="<?php echo e(route('coach.modules.index', ['tenant' => $tenant, 'course_id' => $course->id])); ?>"
                            class="text-sm font-medium text-teal-700 hover:underline">Open modules</a>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </section>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <?php if($standaloneCourses->isEmpty()): ?>
            <p class="text-sm text-stone-600">No courses yet. Create a <a href="<?php echo e(route('coach.programs.index', $tenant)); ?>" class="text-teal-800 hover:underline">program</a> or 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 endif; ?>

    <?php if($standaloneCourses->isNotEmpty()): ?>
        <section class="mb-8">
            <h2 class="text-lg font-semibold text-stone-900">Single courses</h2>
            <p class="mt-1 text-sm text-stone-600">Not in a program — you can still add modules if you want sections.</p>
            <ul class="mt-3 divide-y divide-stone-200 rounded-2xl border border-stone-200 bg-white shadow-sm">
                <?php $__currentLoopData = $standaloneCourses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="flex flex-wrap items-center justify-between gap-3 px-4 py-3">
                        <span class="font-medium text-stone-900"><?php echo e($course->title); ?></span>
                        <a href="<?php echo e(route('coach.modules.index', ['tenant' => $tenant, 'course_id' => $course->id])); ?>"
                            class="text-sm font-medium text-teal-700 hover:underline">Open modules</a>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </section>
    <?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/modules/hub.blade.php ENDPATH**/ ?>