<?php $__env->startSection('title', 'Message Management - NRT SA Admin'); ?>

<?php $__env->startSection('content'); ?>
<div class="p-6">
    <!-- Header -->
    <div class="mb-8">
        <h1 class="text-3xl font-bold text-white mb-2 font-display text-glow">Message Management</h1>
        <p class="text-gray-300 font-body">View and manage contact form messages</p>
    </div>

    <!-- Messages List -->
    <div class="glass-card p-6 rounded-xl">
        <div class="overflow-x-auto">
            <table class="w-full text-left">
                <thead>
                    <tr class="border-b border-gray-700">
                        <th class="py-3 px-4 text-gray-300 font-body">Sender</th>
                        <th class="py-3 px-4 text-gray-300 font-body">Subject</th>
                        <th class="py-3 px-4 text-gray-300 font-body">Date</th>
                        <th class="py-3 px-4 text-gray-300 font-body">Status</th>
                        <th class="py-3 px-4 text-gray-300 font-body">Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="border-b border-gray-800 <?php echo e($message->status === 'new' ? 'bg-blue-50/10' : ''); ?>">
                        <td class="py-3 px-4">
                            <div>
                                <p class="text-white font-body font-semibold"><?php echo e($message->name); ?></p>
                                <p class="text-gray-400 text-sm font-body"><?php echo e($message->email); ?></p>
                                <?php if($message->phone): ?>
                                    <p class="text-gray-400 text-sm font-body"><?php echo e($message->phone); ?></p>
                                <?php endif; ?>
                            </div>
                        </td>
                        <td class="py-3 px-4">
                            <p class="text-gray-300 font-body"><?php echo e($message->subject); ?></p>
                            <p class="text-gray-400 text-sm font-body truncate max-w-xs"><?php echo e(Str::limit($message->message, 50)); ?></p>
                        </td>
                        <td class="py-3 px-4 text-gray-300 font-body"><?php echo e($message->created_at->format('M d, Y H:i')); ?></td>
                        <td class="py-3 px-4">
                            <span class="px-2 py-1 rounded-full text-xs font-body
                                <?php if($message->status === 'new'): ?> bg-blue-100 text-blue-800
                                <?php elseif($message->status === 'read'): ?> bg-green-100 text-green-800
                                <?php else: ?> bg-purple-100 text-purple-800
                                <?php endif; ?>">
                                <?php echo e(ucfirst($message->status)); ?>

                            </span>
                        </td>
                        <td class="py-3 px-4">
                            <div class="flex space-x-2">
                                <a href="<?php echo e(route('admin.messages.show', $message)); ?>" class="text-blue-400 hover:text-blue-300">
                                    <i class="fas fa-eye"></i>
                                </a>
                                <form method="POST" action="<?php echo e(route('admin.messages.destroy', $message)); ?>" class="inline" onsubmit="return confirm('Are you sure you want to delete this message?')">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="text-red-400 hover:text-red-300">
                                        <i class="fas fa-trash"></i>
                                    </button>
                                </form>
                            </div>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="5" class="py-8 text-center text-gray-400 font-body">No messages found</td>
                    </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <?php if($messages->hasPages()): ?>
        <div class="mt-6">
            <?php echo e($messages->links()); ?>

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

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