<div class="offcanvas offcanvas-end" id="offcanvasAddKecamatan" aria-labelledby="offcanvasAddKecamatanLabel">
    <div class="offcanvas-header border-bottom">
        <h5 id="offcanvasAddKecamatanLabel" class="offcanvas-title">Tambah Kecamatan</h5>
        <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
    </div>
    
    <div class="offcanvas-body mx-0 flex-grow-0 p-6 h-100">
        <form class="add-new-kecamatan pt-0" id="addNewKecamatanForm" action="{{ route('kecamatan.store') }}" method="POST">
            @csrf
            
            <div class="mb-4">
                <label class="form-label" for="add-kec-provinsi">Provinsi</label>
                <select id="add-kec-provinsi" class="select2 form-select" data-placeholder="Pilih Provinsi">
                    <option value="">Pilih Provinsi</option>
                    @foreach($provinsi as $prov)
                        <option value="{{ $prov->id }}">{{ $prov->nama }}</option>
                    @endforeach
                </select>
            </div>

            <div class="mb-6 form-control-validation">
                <label class="form-label" for="add-kec-kabupaten">Kabupaten/Kota<span class="text-danger">*</span></label>
                <select id="add-kec-kabupaten" name="kabupaten_kota_id" class="select2 form-select" data-placeholder="Pilih Kabupaten/Kota" disabled>
                    <option value="">Pilih Kabupaten/Kota</option>
                </select>
            </div>

            <div class="mb-6 form-control-validation">
                <label class="form-label" for="add-kec-code">Kode Kecamatan<span class="text-danger">*</span></label>
                <input type="text" class="form-control" id="add-kec-code" placeholder="110101" name="kode" maxlength="6" inputmode="numeric" pattern="[0-9]*" oninput="this.value = this.value.replace(/[^0-9]/g, '')" />
            </div>

            <div class="mb-6 form-control-validation">
                <label class="form-label" for="add-kec-name">Nama Kecamatan<span class="text-danger">*</span></label>
                <input type="text" class="form-control" id="add-kec-name" placeholder="Contoh: Kec. Tapaktuan" name="nama" />
            </div>

            <div class="mb-6 form-control-validation">
                <label class="form-label" for="add-kec-path">Path (Koordinat)</label>
                <textarea class="form-control" id="add-kec-path" placeholder="[3.21, 97.21]" name="path" rows="3"></textarea>
            </div>

            <div class="mt-8">
                <button type="submit" class="btn btn-primary me-3 data-submit">Submit</button>
                <button type="reset" class="btn btn-label-danger" data-bs-dismiss="offcanvas">Cancel</button>
            </div>
        </form>
    </div>
</div>