<?php $__env->startSection('main-content'); ?>
    <?php
        use Illuminate\Support\Str;
    ?>

    <style>
        .custom-card {
            background: #fff;
            border: none;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(31, 48, 68, .08);
        }

        .custom-card .card-header {
            background: #1F3044;
            color: #fff;
            padding: 22px 30px;
            border: none;
        }

        .custom-card .card-header h3 {
            margin: 0;
            font-size: 28px;
            font-weight: 700;
        }

        .total-badge {
            background: #fff;
            color: #1F3044;
            padding: 10px 18px;
            border-radius: 30px;
            font-weight: 700;
            font-size: 15px;
        }

        .table {
            margin: 0;
        }

        .table thead th {
            background: #F5F7FA;
            color: #1F3044;
            font-weight: 700;
            border: none;
            padding: 18px;
            text-transform: uppercase;
            font-size: 14px;
            letter-spacing: .5px;
        }

        .table tbody td {
            padding: 22px 18px;
            vertical-align: middle;
            border-color: #edf1f5;
        }

        .table tbody tr {
            transition: .3s;
        }

        .table tbody tr:hover {
            background: #F8FAFD;
        }

        .name-box {
            font-size: 18px;
            font-weight: 700;
            color: #1F3044;
        }

        .email-text {
            color: #6c757d;
            font-size: 15px;
        }

        .subject-badge {
            background: #1F3044;
            color: #fff;
            padding: 8px 18px;
            border-radius: 30px;
            font-size: 13px;
            font-weight: 600;
        }

        .message-box {
            color: #555;
            line-height: 1.7;
        }

        .date {
            font-size: 18px;
            font-weight: 700;
            color: #1F3044;
        }

        .time {
            color: #888;
            font-size: 14px;
        }

        .action-btn {
            width: 46px;
            height: 46px;
            border: none;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            transition: .3s;
        }

        .delete-btn {
            background: #dc3545;
        }

        .delete-btn:hover {
            background: #bb2d3b;
            transform: translateY(-3px);
        }

        .empty-box {
            padding: 70px;
            text-align: center;
            color: #777;
        }

        .empty-box i {
            font-size: 55px;
            margin-bottom: 15px;
            color: #1F3044;
        }
    </style>

    <div class="card custom-card w-100%">

        <div class="card-header d-flex justify-content-between align-items-center">

            <h3>

                <i class="fas fa-envelope me-2"></i>

                Contact Messages

            </h3>

            <span class="total-badge">

                Total :
                <?php echo e($contacts->count()); ?>


            </span>

        </div>
        <div class="card-body p-0" style="width:100%;">

            <?php if(session('success')): ?>
                <div class="alert alert-success m-4">
                    <?php echo e(session('success')); ?>

                </div>
            <?php endif; ?>

            <div class="table-responsive" style="width:100%; overflow-x:auto;">

                <table class="table align-middle mb-0" style="width:100%; min-width:1400px;">

                    <thead>

                        <tr>

                            <th width="60">#</th>

                            <th>Name</th>

                            <th>Email</th>

                            <th width="180">Subject</th>

                            <th>Message</th>

                            <th width="170">Date</th>

                            <th width="100" class="text-center">Action</th>

                        </tr>

                    </thead>

                    <tbody>

                        <?php $__empty_1 = true; $__currentLoopData = $contacts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contact): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>

                                <td>
                                    <strong><?php echo e($loop->iteration); ?></strong>
                                </td>

                                <td>
                                    <div class="name-box">
                                        <?php echo e($contact->name); ?>

                                    </div>
                                </td>

                                <td>
                                    <span class="email-text">
                                        <?php echo e($contact->email); ?>

                                    </span>
                                </td>

                                <td>
                                    <span class="subject-badge">
                                        <?php echo e($contact->subject); ?>

                                    </span>
                                </td>

                                <td>
                                    <div class="message-box">
                                        <?php echo e(Str::limit($contact->message, 100)); ?>

                                    </div>
                                </td>

                                <td>
                                    <div class="date">
                                        <?php echo e($contact->created_at->format('d M Y')); ?>

                                    </div>

                                    <div class="time">
                                        <?php echo e($contact->created_at->format('h:i A')); ?>

                                    </div>
                                </td>

                                <td class="text-center">

                                    <form action="<?php echo e(route('contacts.destroy', $contact->id)); ?>" method="POST"
                                        onsubmit="return confirm('Delete this message?')">

                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>

                                        <button class="action-btn delete-btn">
                                            <i class="fas fa-trash"></i>
                                        </button>

                                    </form>

                                </td>

                            </tr>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

                            <tr>

                                <td colspan="7">

                                    <div class="empty-box">

                                        <i class="fas fa-envelope-open-text"></i>

                                        <h4>No Contact Messages Found</h4>

                                    </div>

                                </td>

                            </tr>
                        <?php endif; ?>

                    </tbody>

                </table>

            </div>

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

<?php echo $__env->make('dashboard.main', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\LAPOP CLINIC\Desktop\New folder (2)\Aljubail_web\resources\views/dashboard/contact/show.blade.php ENDPATH**/ ?>