

<?php $__env->startSection('title', 'Reservation Details'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-8">
            <!-- Reservation Details -->
            <div class="card mb-4">
                <div class="card-header">
                    <div class="d-flex justify-content-between align-items-center">
                        <h5 class="mb-0">Reservation Details</h5>
                        <div class="btn-group" role="group">
                            <a href="<?php echo e(route('equipment-reservations.edit', $equipmentReservation)); ?>" class="btn btn-outline-primary btn-sm">
                                <i class="bi bi-pencil"></i> Edit
                            </a>
                            <a href="<?php echo e(route('equipment-reservations.index')); ?>" class="btn btn-outline-secondary btn-sm">
                                <i class="bi bi-arrow-left"></i> Back
                            </a>
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <h6 class="text-primary mb-3">Equipment Information</h6>
                            <div class="d-flex align-items-center mb-3">
                                <div class="avatar-sm bg-info text-white rounded-circle d-flex align-items-center justify-content-center me-3">
                                    <i class="bi bi-gear-wide-connected"></i>
                                </div>
                                <div>
                                    <h5 class="mb-1"><?php echo e($equipmentReservation->equipment->name); ?></h5>
                                    <span class="badge bg-info"><?php echo e($equipmentReservation->equipment->type_name); ?></span>
                                </div>
                            </div>
                            
                            <?php if($equipmentReservation->equipment->description): ?>
                                <p class="text-muted"><?php echo e($equipmentReservation->equipment->description); ?></p>
                            <?php endif; ?>
                            
                            <ul class="list-unstyled">
                                <li class="mb-2">
                                    <i class="bi bi-clock text-primary"></i>
                                    <strong>Operating Hours:</strong> 
                                    <?php echo e($equipmentReservation->equipment->start_time->format('H:i')); ?> - <?php echo e($equipmentReservation->equipment->end_time->format('H:i')); ?>

                                </li>
                                <li class="mb-2">
                                    <i class="bi bi-calendar text-primary"></i>
                                    <strong>Slot Duration:</strong> <?php echo e($equipmentReservation->equipment->slot_duration); ?> minutes
                                </li>
                            </ul>
                        </div>
                        
                        <div class="col-md-6">
                            <h6 class="text-primary mb-3">Reservation Information</h6>
                            <div class="row">
                                <div class="col-12 mb-3">
                                    <div class="card bg-light">
                                        <div class="card-body text-center">
                                            <h4 class="mb-1"><?php echo e($equipmentReservation->formatted_date); ?></h4>
                                            <h5 class="text-primary mb-2"><?php echo e($equipmentReservation->formatted_time_range); ?></h5>
                                            <p class="mb-0"><?php echo e($equipmentReservation->formatted_duration); ?></p>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="col-12">
                                    <div class="d-flex justify-content-between align-items-center mb-2">
                                        <span><strong>Status:</strong></span>
                                        <span class="badge <?php echo e($equipmentReservation->status_badge_class); ?>">
                                            <?php echo e($equipmentReservation->status_name); ?>

                                        </span>
                                    </div>
                                    
                                    <div class="d-flex justify-content-between align-items-center mb-2">
                                        <span><strong>Created:</strong></span>
                                        <span><?php echo e($equipmentReservation->created_at->format('M d, Y H:i')); ?></span>
                                    </div>
                                    
                                    <div class="d-flex justify-content-between align-items-center mb-2">
                                        <span><strong>Updated:</strong></span>
                                        <span><?php echo e($equipmentReservation->updated_at->format('M d, Y H:i')); ?></span>
                                    </div>
                                    
                                    <div class="d-flex justify-content-between align-items-center">
                                        <span><strong>Timeline:</strong></span>
                                        <span class="badge bg-<?php echo e($equipmentReservation->is_today ? 'warning' : ($equipmentReservation->is_future ? 'success' : 'secondary')); ?>">
                                            <?php echo e($equipmentReservation->is_today ? 'Today' : ($equipmentReservation->is_future ? 'Upcoming' : 'Past')); ?>

                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <?php if($equipmentReservation->notes): ?>
                        <hr>
                        <div>
                            <h6 class="text-primary mb-2">Notes</h6>
                            <div class="bg-light p-3 rounded">
                                <?php echo e($equipmentReservation->notes); ?>

                            </div>
                        </div>
                    <?php endif; ?>
                </div>
            </div>

            <!-- User Information -->
            <div class="card">
                <div class="card-header">
                    <h6 class="mb-0">User Information</h6>
                </div>
                <div class="card-body">
                    <div class="d-flex align-items-center">
                        <div class="avatar-lg bg-primary text-white rounded-circle d-flex align-items-center justify-content-center me-4">
                            <?php echo e(substr($equipmentReservation->user->name, 0, 1)); ?>

                        </div>
                        <div>
                            <h5 class="mb-1"><?php echo e($equipmentReservation->user->name); ?></h5>
                            <p class="text-muted mb-2"><?php echo e($equipmentReservation->user->email); ?></p>
                            <?php if($equipmentReservation->user->phone): ?>
                                <p class="text-muted mb-0">
                                    <i class="bi bi-telephone"></i> <?php echo e($equipmentReservation->user->phone); ?>

                                </p>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="col-md-4">
            <!-- Quick Actions -->
            <div class="card mb-4">
                <div class="card-header">
                    <h6 class="mb-0">Quick Actions</h6>
                </div>
                <div class="card-body">
                    <div class="d-grid gap-2">
                        <?php if($equipmentReservation->status === 'confirmed' && !$equipmentReservation->is_past): ?>
                            <form action="<?php echo e(route('equipment-reservations.cancel', $equipmentReservation)); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <button type="submit" class="btn btn-outline-warning" 
                                        onclick="return confirm('Are you sure you want to cancel this reservation?')">
                                    <i class="bi bi-x-circle"></i> Cancel Reservation
                                </button>
                            </form>
                        <?php endif; ?>
                        
                        <?php if($equipmentReservation->status === 'confirmed' && !$equipmentReservation->is_future): ?>
                            <form action="<?php echo e(route('equipment-reservations.complete', $equipmentReservation)); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <button type="submit" class="btn btn-outline-success">
                                    <i class="bi bi-check-circle"></i> Mark as Completed
                                </button>
                            </form>
                        <?php endif; ?>
                        
                        <?php if(!$equipmentReservation->is_past): ?>
                            <form action="<?php echo e(route('equipment-reservations.destroy', $equipmentReservation)); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="btn btn-outline-danger" 
                                        onclick="return confirm('Are you sure you want to delete this reservation?')">
                                    <i class="bi bi-trash"></i> Delete Reservation
                                </button>
                            </form>
                        <?php endif; ?>
                        
                        
                    </div>
                </div>
            </div>

            <!-- Status Timeline -->
            <div class="card mb-4">
                <div class="card-header">
                    <h6 class="mb-0">Status Timeline</h6>
                </div>
                <div class="card-body">
                    <div class="timeline">
                        <div class="timeline-item">
                            <div class="timeline-marker bg-success"></div>
                            <div class="timeline-content">
                                <h6 class="mb-1">Reservation Created</h6>
                                <small class="text-muted"><?php echo e($equipmentReservation->created_at->format('M d, Y H:i')); ?></small>
                            </div>
                        </div>
                        
                        <?php if($equipmentReservation->status !== 'confirmed'): ?>
                            <div class="timeline-item">
                                <div class="timeline-marker bg-<?php echo e($equipmentReservation->status === 'cancelled' ? 'danger' : 'info'); ?>"></div>
                                <div class="timeline-content">
                                    <h6 class="mb-1">Reservation <?php echo e(ucfirst($equipmentReservation->status)); ?></h6>
                                    <small class="text-muted"><?php echo e($equipmentReservation->updated_at->format('M d, Y H:i')); ?></small>
                                </div>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <!-- Equipment Quick Info -->
            <div class="card">
                <div class="card-header">
                    <h6 class="mb-0">Equipment Quick Info</h6>
                </div>
                <div class="card-body">
                    <ul class="list-unstyled mb-0">
                        <li class="mb-2">
                            <i class="bi bi-tag text-primary"></i>
                            <strong>Type:</strong> <?php echo e($equipmentReservation->equipment->type_name); ?>

                        </li>
                        <li class="mb-2">
                            <i class="bi bi-clock text-primary"></i>
                            <strong>Operating Hours:</strong><br>
                            <?php echo e($equipmentReservation->equipment->start_time->format('H:i')); ?> - <?php echo e($equipmentReservation->equipment->end_time->format('H:i')); ?>

                        </li>
                        <li class="mb-2">
                            <i class="bi bi-calendar text-primary"></i>
                            <strong>Slot Duration:</strong> <?php echo e($equipmentReservation->equipment->slot_duration); ?> minutes
                        </li>
                        <li class="mb-2">
                            <i class="bi bi-sort-numeric-down text-primary"></i>
                            <strong>Sort Order:</strong> <?php echo e($equipmentReservation->equipment->sort_order); ?>

                        </li>
                        <li class="mb-2">
                            <i class="bi bi-toggle-<?php echo e($equipmentReservation->equipment->is_active ? 'on' : 'off'); ?> text-primary"></i>
                            <strong>Status:</strong> 
                            <?php echo e($equipmentReservation->equipment->is_active ? 'Active' : 'Inactive'); ?>

                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-content {
    padding-left: 10px;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}
</style>
<?php $__env->stopSection(); ?> 
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\solen-north-coast\resources\views/equipment_reservations/show.blade.php ENDPATH**/ ?>