<?php $__env->startSection('title', 'Queries | Smart Dermatology'); ?>
<?php $__env->startSection('page_title', 'Inbox & Queries'); ?>
<?php $__env->startSection('page_subtitle', 'Track feedback and support requests coming from the user side.'); ?>

<?php $__env->startPush('styles'); ?>
    <style>
        .query-card { border: none; border-radius: 15px; transition: 0.3s; margin-bottom: 20px; border-left: 5px solid #eee; }
        .query-card.unread { border-left-color: var(--brand-pink); }
        .query-card:hover { transform: translateX(5px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-lg-10">
            <?php $__empty_1 = true; $__currentLoopData = $queries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $query): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="card query-card <?php echo e($query->status === 'Unread' ? 'unread' : ''); ?> p-4 bg-white">
                    <div class="d-flex justify-content-between align-items-start gap-3 flex-wrap">
                        <div class="d-flex align-items-center">
                            <img src="https://ui-avatars.com/api/?name=<?php echo e(urlencode($query->name)); ?>&background=F690A6&color=fff" class="rounded-circle me-3" width="50" alt="<?php echo e($query->name); ?>">
                            <div>
                                <h6 class="fw-bold mb-0"><?php echo e($query->name); ?></h6>
                                <small class="text-muted d-block"><?php echo e($query->email); ?></small>
                                <?php if($query->phone): ?>
                                    <small class="text-muted d-block"><?php echo e($query->phone); ?></small>
                                <?php endif; ?>
                                <small class="text-muted">Received: <?php echo e($query->created_at?->diffForHumans()); ?></small>
                            </div>
                        </div>
                        <span class="badge text-white" style="background: var(--brand-pink);"><?php echo e($query->status); ?></span>
                    </div>
                    <div class="mt-3">
                        <p class="text-dark mb-0">"<?php echo e($query->message); ?>"</p>
                    </div>
                    <div class="d-flex justify-content-end gap-2 mt-3 flex-wrap">
                        <a href="<?php echo e(route('admin.queries.show', $query)); ?>" class="btn btn-sm btn-outline-secondary px-3">View</a>
                        <form action="<?php echo e(route('admin.queries.status', $query)); ?>" method="POST">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>
                            <button type="submit" class="btn btn-sm text-white px-3" style="background: var(--brand-pink); border:none;">
                                <?php echo e($query->status === 'Unread' ? 'Mark as Read' : 'Mark as Unread'); ?>

                            </button>
                        </form>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="card query-card p-4 bg-white">
                    <p class="mb-0 text-muted">No user queries have been submitted yet.</p>
                </div>
            <?php endif; ?>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\Doodles Tech\Products\FYP\FYP\skin-analysis\resources\views/admin/pages/queries.blade.php ENDPATH**/ ?>