<?php $__env->startSection('title', 'Notifications'); ?>
<?php $__env->startSection('page-title', 'Notifications'); ?>

<?php $__env->startSection('content'); ?>
    <div class="space-y-6">
        <div class="rounded-3xl border border-gray-200 bg-white p-6 shadow-sm">
            <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
                <div>
                    <h2 class="text-2xl font-bold text-gray-900">All Notifications</h2>
                    <p class="mt-1 text-sm text-gray-500">Lead updates, blog review events, assignments, and workflow alerts all appear here.</p>
                </div>

                <form method="POST" action="<?php echo e(route('notifications.read-all')); ?>">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="inline-flex items-center justify-center rounded-full bg-gray-900 px-5 py-2.5 text-sm font-semibold text-white transition hover:bg-black">
                        Mark all as read
                    </button>
                </form>
            </div>
        </div>

        <div class="space-y-4">
            <?php $__empty_1 = true; $__currentLoopData = $notifications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notification): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="rounded-3xl border <?php echo e($notification->read_at ? 'border-gray-200 bg-white' : 'border-blue-200 bg-blue-50/50'); ?> p-5 shadow-sm">
                    <div class="flex flex-col gap-4 md:flex-row md:items-start md:justify-between">
                        <div class="flex min-w-0 items-start gap-4">
                            <span class="mt-1 inline-flex h-3.5 w-3.5 flex-shrink-0 rounded-full <?php echo e($notification->read_at ? 'bg-gray-300' : 'bg-blue-500 shadow-[0_0_0_8px_rgba(59,130,246,0.12)]'); ?>"></span>
                            <div class="min-w-0">
                                <div class="flex flex-wrap items-center gap-2">
                                    <h3 class="text-base font-semibold text-gray-900"><?php echo e($notification->title); ?></h3>
                                    <?php if(!$notification->read_at): ?>
                                        <span class="inline-flex items-center rounded-full bg-blue-600 px-2.5 py-1 text-[11px] font-bold uppercase tracking-[0.18em] text-white">Unread</span>
                                    <?php endif; ?>
                                </div>
                                <p class="mt-2 text-sm leading-6 text-gray-600"><?php echo e($notification->message); ?></p>
                                <div class="mt-3 flex flex-wrap items-center gap-3 text-xs text-gray-400">
                                    <span><?php echo e($notification->created_at->format('d M Y, h:i A')); ?></span>
                                    <span><?php echo e($notification->created_at->diffForHumans()); ?></span>
                                    <span class="rounded-full bg-gray-100 px-2.5 py-1 font-medium text-gray-500"><?php echo e(str($notification->type)->replace('_', ' ')->title()); ?></span>
                                </div>
                            </div>
                        </div>

                        <div class="flex flex-wrap items-center gap-2 md:justify-end">
                            <?php if(!$notification->read_at): ?>
                                <form method="POST" action="<?php echo e(route('notifications.read', $notification)); ?>">
                                    <?php echo csrf_field(); ?>
                                    <button type="submit" class="inline-flex items-center justify-center rounded-full border border-gray-200 px-4 py-2 text-sm font-semibold text-gray-700 transition hover:border-blue-200 hover:text-blue-600">
                                        Mark read
                                    </button>
                                </form>
                            <?php endif; ?>

                            <?php if($notification->action_url): ?>
                                <form method="POST" action="<?php echo e(route('notifications.read', $notification)); ?>">
                                    <?php echo csrf_field(); ?>
                                    <input type="hidden" name="redirect_to" value="<?php echo e($notification->action_url); ?>">
                                    <button type="submit" class="inline-flex items-center justify-center rounded-full bg-blue-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-blue-700">
                                        Open
                                    </button>
                                </form>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="rounded-3xl border border-dashed border-gray-300 bg-white px-6 py-14 text-center shadow-sm">
                    <h3 class="text-lg font-semibold text-gray-900">No notifications yet</h3>
                    <p class="mt-2 text-sm text-gray-500">When leads are assigned, blog articles are reviewed, or statuses change, they will appear here.</p>
                </div>
            <?php endif; ?>
        </div>

        <div>
            <?php echo e($notifications->links()); ?>

        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make(auth()->user()->isEmployee() ? 'employee.layouts.app' : 'admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\gps-migration\resources\views\notifications\index.blade.php ENDPATH**/ ?>