@extends('layouts.admin')

@section('content')
<div class="container-fluid">
    <div class="card">
        <div class="card-header">
            <h4 class="card-title">Create New Delivery Zone</h4>
        </div>
        <div class="card-body">
            <form action="{{ route('admin.delivery.zones.store') }}" method="POST">
                @csrf
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">Name</label>
                            <input type="text" name="name" class="form-control" required 
                                   value="{{ old('name') }}" placeholder="Zone name">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">City</label>
                            <input type="text" name="city" class="form-control" required 
                                   value="{{ old('city') }}" placeholder="City">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">State</label>
                            <input type="text" name="state" class="form-control" required 
                                   value="{{ old('state') }}" placeholder="State">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">Country</label>
                            <input type="text" name="country" class="form-control" required 
                                   value="{{ old('country') }}" placeholder="Country">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">Zipcode</label>
                            <input type="text" name="zipcode" class="form-control" 
                                   value="{{ old('zipcode') }}" placeholder="Zipcode">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">Delivery Fee</label>
                            <input type="number" name="delivery_fee" class="form-control" required 
                                   value="{{ old('delivery_fee') }}" step="0.01" min="0">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">Min Order Amount</label>
                            <input type="number" name="min_order_amount" class="form-control" required 
                                   value="{{ old('min_order_amount') }}" step="0.01" min="0">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">Free Delivery Amount</label>
                            <input type="number" name="free_delivery_amount" class="form-control" 
                                   value="{{ old('free_delivery_amount') }}" step="0.01" min="0">
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="mb-3">
                            <div class="form-check">
                                <input type="checkbox" name="is_active" class="form-check-input" 
                                       value="1" {{ old('is_active') ? 'checked' : '' }}>
                                <label class="form-check-label">Active</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="text-end">
                    <a href="{{ route('admin.delivery.zones.index') }}" class="btn btn-secondary">Cancel</a>
                    <button type="submit" class="btn btn-primary">Create Zone</button>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection
