<!-- Status Update Modal -->
<div class="modal fade" id="updateStatusModal" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Update Order Status</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <form id="updateStatusForm">
                    <div class="mb-3">
                        <label class="form-label">Order Status</label>
                        <select class="form-select" name="order_status" id="orderStatus">
                            @foreach(App\Models\Order::getStatusList() as $key => $value)
                            <option value="{{ $key }}" {{ isset($order) && $order->order_status == $key ? 'selected' : '' }}>{{ $value }}</option>
                            @endforeach
                        </select>
                        <div class="form-text mt-2">
                            <span class="text-warning">Note:</span> Setting an order to "cancelled" will return items to inventory.
                        </div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Payment Status</label>
                        <select class="form-select" name="payment_status" id="paymentStatus">
                            @foreach(App\Models\Order::getPaymentStatusList() as $key => $value)
                            <option value="{{ $key }}" {{ isset($order) && $order->payment_status == $key ? 'selected' : '' }}>{{ $value }}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Status Notes (Optional)</label>
                        <textarea class="form-control" name="status_notes" id="statusNotes" rows="3" placeholder="Enter any notes about this status change"></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" id="saveStatus">Save changes</button>
            </div>
        </div>
    </div>
</div>