<?php $__env->startSection('title', 'Bookings Management'); ?>

<?php $__env->startSection('content'); ?>
<div class="mb-6 flex items-center justify-between">
    <div>
        <h1 class="text-3xl font-display font-bold text-gray-900">Bookings Management</h1>
        <p class="text-gray-600 mt-1">View and manage all hotel bookings</p>
    </div>
</div>

<!-- Filters -->
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
    <form method="GET" action="<?php echo e(route('admin.bookings')); ?>" class="flex flex-wrap gap-4">
        <div class="flex-1 min-w-[200px]">
            <label for="search" class="block text-sm font-medium text-gray-700 mb-2">Search</label>
            <input type="text" id="search" name="search" value="<?php echo e(request('search')); ?>" placeholder="Name, email, phone..." class="form-input">
        </div>
        <div class="w-48">
            <label for="status" class="block text-sm font-medium text-gray-700 mb-2">Status</label>
            <select id="status" name="status" class="form-input">
                <option value="all" <?php echo e(request('status') == 'all' ? 'selected' : ''); ?>>All Status</option>
                <option value="pending" <?php echo e(request('status') == 'pending' ? 'selected' : ''); ?>>Pending</option>
                <option value="confirmed" <?php echo e(request('status') == 'confirmed' ? 'selected' : ''); ?>>Confirmed</option>
                <option value="checked_in" <?php echo e(request('status') == 'checked_in' ? 'selected' : ''); ?>>Checked In</option>
                <option value="checked_out" <?php echo e(request('status') == 'checked_out' ? 'selected' : ''); ?>>Checked Out</option>
                <option value="cancelled" <?php echo e(request('status') == 'cancelled' ? 'selected' : ''); ?>>Cancelled</option>
            </select>
        </div>
        <div class="flex items-end gap-2">
            <button type="submit" class="btn btn-primary">Filter</button>
            <a href="<?php echo e(route('admin.bookings')); ?>" class="btn btn-outline">Reset</a>
        </div>
    </form>
</div>

<!-- Bookings Table -->
<div class="bg-white rounded-xl shadow-sm">
    <?php if($bookings->count() > 0): ?>
    <div class="overflow-x-auto">
        <table class="w-full">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Guest Information</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Room</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Dates</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Guests</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
                </tr>
            </thead>
            <tbody class="bg-white divide-y divide-gray-200">
                <?php $__currentLoopData = $bookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr class="hover:bg-gray-50">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
                        #<?php echo e($booking->id); ?>

                    </td>
                    <td class="px-6 py-4">
                        <div>
                            <div class="text-sm font-medium text-gray-900"><?php echo e($booking->guest_name); ?></div>
                            <div class="text-sm text-gray-500"><?php echo e($booking->guest_email); ?></div>
                            <div class="text-sm text-gray-500"><?php echo e($booking->guest_phone); ?></div>
                        </div>
                    </td>
                    <td class="px-6 py-4">
                        <div class="text-sm text-gray-900"><?php echo e($booking->room->name); ?></div>
                        <div class="text-sm text-gray-500">NPR <?php echo e(number_format($booking->room->price_per_night)); ?>/night</div>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap">
                        <div class="text-sm text-gray-900"><?php echo e($booking->check_in->format('M d, Y')); ?></div>
                        <div class="text-sm text-gray-500">to <?php echo e($booking->check_out->format('M d, Y')); ?></div>
                        <div class="text-xs text-gray-400"><?php echo e($booking->check_in->diffInDays($booking->check_out)); ?> nights</div>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                        <?php echo e($booking->adults); ?> Adults
                        <?php if($booking->children > 0): ?>
                        <br><?php echo e($booking->children); ?> Children
                        <?php endif; ?>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap">
                        <?php
                            $statusColors = [
                                'pending' => 'bg-yellow-100 text-yellow-800',
                                'confirmed' => 'bg-green-100 text-green-800',
                                'checked_in' => 'bg-blue-100 text-blue-800',
                                'checked_out' => 'bg-gray-100 text-gray-800',
                                'cancelled' => 'bg-red-100 text-red-800',
                            ];
                        ?>
                        <span class="px-2 py-1 text-xs font-semibold rounded-full <?php echo e($statusColors[$booking->status] ?? 'bg-gray-100 text-gray-800'); ?>">
                            <?php echo e(ucfirst(str_replace('_', ' ', $booking->status))); ?>

                        </span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                        <a href="<?php echo e(route('admin.bookings.show', $booking->id)); ?>" class="text-primary-600 hover:text-primary-900 font-medium">View Details</a>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>

    <!-- Pagination -->
    <div class="px-6 py-4 border-t border-gray-200">
        <?php echo e($bookings->links()); ?>

    </div>
    <?php else: ?>
    <div class="px-6 py-12 text-center">
        <svg class="w-16 h-16 mx-auto text-gray-400 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
        </svg>
        <p class="text-gray-500 text-lg">No bookings found</p>
        <p class="text-gray-400 text-sm mt-1">Try adjusting your filters</p>
    </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/sumankc/Desktop/ Websites/Hotel Bardan Boutique/resources/views/admin/bookings/index.blade.php ENDPATH**/ ?>