
<?php ($completed = collect($completedLessonIds ?? [])); ?>
<div class="rounded-2xl border border-stone-200/80 bg-white shadow-sm">
    <div class="border-b border-stone-100 px-4 py-3">
        <p class="text-xs font-semibold uppercase tracking-wide text-stone-500">Course content</p>
        <p class="mt-0.5 text-sm font-semibold text-stone-900"><?php echo e($course->title); ?></p>
    </div>
    <div class="max-h-[min(70vh,32rem)] overflow-y-auto">
        <?php if($course->rootLessons->isNotEmpty()): ?>
            <div class="border-b border-stone-100">
                <p class="bg-stone-50 px-4 py-2 text-xs font-semibold text-stone-600">Lessons</p>
                <ol class="divide-y divide-stone-100">
                    <?php $__currentLoopData = $course->rootLessons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $les): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php ($isCurrent = isset($currentLesson) && $currentLesson && $currentLesson->is($les)); ?>
                        <?php ($done = $completed->contains($les->id)); ?>
                        <li>
                            <?php if($canAccess): ?>
                                <a href="<?php echo e(route('learn.lesson', [$tenant, $les])); ?>"
                                    class="flex items-start gap-2 px-3 py-2.5 text-sm transition <?php echo e($isCurrent ? 'bg-teal-50 text-teal-950' : 'text-stone-800 hover:bg-stone-50'); ?>">
                                    <span class="mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border <?php echo e($done ? 'border-teal-500 bg-teal-500 text-white' : ($isCurrent ? 'border-teal-400 bg-white' : 'border-stone-300 bg-white text-stone-400')); ?>">
                                        <?php if($done): ?>
                                            <svg class="h-3 w-3" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/></svg>
                                        <?php else: ?>
                                            <span class="h-1.5 w-1.5 rounded-full bg-current opacity-40"></span>
                                        <?php endif; ?>
                                    </span>
                                    <span class="min-w-0 leading-snug <?php echo e($isCurrent ? 'font-semibold' : ''); ?>"><?php echo e($les->title); ?></span>
                                </a>
                            <?php else: ?>
                                <span class="flex items-start gap-2 px-3 py-2.5 text-sm text-stone-400">
                                    <span class="mt-0.5 h-5 w-5 shrink-0 rounded-full border border-stone-200"></span>
                                    <?php echo e($les->title); ?>

                                </span>
                            <?php endif; ?>
                        </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ol>
            </div>
        <?php endif; ?>

        <?php $__currentLoopData = $course->modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="border-b border-stone-100 last:border-b-0">
                <p class="bg-stone-50 px-4 py-2 text-xs font-semibold text-stone-600"><?php echo e($module->title); ?></p>
                <ol class="divide-y divide-stone-100">
                    <?php $__currentLoopData = $module->lessons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $les): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php ($isCurrent = isset($currentLesson) && $currentLesson && $currentLesson->is($les)); ?>
                        <?php ($done = $completed->contains($les->id)); ?>
                        <li>
                            <?php if($canAccess): ?>
                                <a href="<?php echo e(route('learn.lesson', [$tenant, $les])); ?>"
                                    class="flex items-start gap-2 px-3 py-2.5 text-sm transition <?php echo e($isCurrent ? 'bg-teal-50 text-teal-950' : 'text-stone-800 hover:bg-stone-50'); ?>">
                                    <span class="mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border <?php echo e($done ? 'border-teal-500 bg-teal-500 text-white' : ($isCurrent ? 'border-teal-400 bg-white' : 'border-stone-300 bg-white text-stone-400')); ?>">
                                        <?php if($done): ?>
                                            <svg class="h-3 w-3" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/></svg>
                                        <?php else: ?>
                                            <span class="h-1.5 w-1.5 rounded-full bg-current opacity-40"></span>
                                        <?php endif; ?>
                                    </span>
                                    <span class="min-w-0 leading-snug <?php echo e($isCurrent ? 'font-semibold' : ''); ?>"><?php echo e($les->title); ?></span>
                                </a>
                            <?php else: ?>
                                <span class="flex items-start gap-2 px-3 py-2.5 text-sm text-stone-400">
                                    <span class="mt-0.5 h-5 w-5 shrink-0 rounded-full border border-stone-200"></span>
                                    <?php echo e($les->title); ?>

                                </span>
                            <?php endif; ?>
                        </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ol>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</div>
<?php /**PATH /Users/nurudinwahablartey/Projects/lms/resources/views/learn/partials/curriculum-tree.blade.php ENDPATH**/ ?>