<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <div class="flex items-center justify-between">
            <div>
                <h1 class="text-4xl font-black text-slate-900 tracking-tight font-outfit">Manage Access</h1>
                <p class="text-slate-400 font-medium mt-1 italic uppercase tracking-widest text-[10px]">Student: <?php echo e($user->name); ?> (<?php echo e($user->username); ?>)</p>
            </div>
            <a href="<?php echo e(route('admin.users.index')); ?>" class="btn btn-secondary gap-2">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>
                Back to Students
            </a>
        </div>
     <?php $__env->endSlot(); ?>

    <div class="max-w-4xl">
        <div class="bg-white rounded-[2.5rem] border border-slate-100 shadow-xl p-10">
            <form action="<?php echo e(route('admin.users.access.update', $user)); ?>" method="POST" class="space-y-8">
                <?php echo csrf_field(); ?>
                
                <div>
                    <h3 class="text-xl font-black text-slate-800 font-outfit mb-6">Select Paid Notes to Grant Access</h3>
                    
                    <?php if($paid_notes->isEmpty()): ?>
                        <div class="p-8 bg-slate-50 rounded-2xl text-center">
                            <p class="text-slate-400 font-bold italic">No paid notes available in the repository.</p>
                        </div>
                    <?php else: ?>
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                            <?php $__currentLoopData = $paid_notes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $note): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <label class="relative flex items-center p-4 rounded-2xl border border-slate-100 hover:border-indigo-200 hover:bg-indigo-50/30 transition-all cursor-pointer group">
                                    <input type="checkbox" name="notes[]" value="<?php echo e($note->id); ?>" <?php echo e(in_array($note->id, $user_access) ? 'checked' : ''); ?> class="w-5 h-5 text-indigo-600 border-slate-300 rounded focus:ring-indigo-500">
                                    <div class="ml-4">
                                        <p class="text-sm font-bold text-slate-800 group-hover:text-indigo-600 transition-colors"><?php echo e($note->title); ?></p>
                                        <p class="text-[10px] font-black text-slate-400 uppercase tracking-widest"><?php echo e($note->category->name); ?></p>
                                    </div>
                                </label>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    <?php endif; ?>
                </div>

                <div class="pt-8 border-t border-slate-50 flex gap-4">
                    <button type="submit" class="btn btn-indigo flex-grow py-4 text-sm tracking-[0.2em]">
                        Save Access Settings
                    </button>
                    <a href="<?php echo e(route('admin.users.index')); ?>" class="btn btn-secondary px-8 py-4 text-sm tracking-[0.2em]">
                        Cancel
                    </a>
                </div>
            </form>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH /Users/sajnush/Herd/StudyXnote/resources/views/admin/users/access.blade.php ENDPATH**/ ?>