<!-- Forest Modal -->
<div class="modal fade" id="forestModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <div class="modal-header border-0 alert-info p-2">
        <h5 class="modal-title">Register Forest</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
      </div>
      <div class="modal-body">
        <form method="POST" id="forestForm">
            <?= csrf_field(); ?>
            <input type="hidden" name="id" >
            <div class="row">
                <div class="col-md-12 mb-3">
                    <label class="form-label fw-bold mb-0">Forest Name</label>
                    <input type="text" class="form-control" name="name" required>
                </div>
                <div class="col-md-6 mb-3">
                    <label for="siz" class="form-label fw-bold mb-0">Size <small class="text-muted">(Hectares)</small></label>
                    <input type="number" class="form-control" id="siz" name="size" step="any" />
                </div>
                <div class="col-md-6 mb-3">
                    <label class="form-label fw-bold mb-0">Classification</label>
                    <select class="form-select" name="classification" required>
                        <option value="Central Reserve">Central Reserve</option>
                        <option value="Community">Community</option>
                        <option value="Private">Private</option>
                        <option value="National Park">National Park</option>
                        <option value="Other">Other</option>
                    </select>
                </div>
                <div class="col-md-12 mb-3">
                    <label class="form-label fw-bold mb-0">Location</label>
                    <textarea class="form-control" name="location_description"></textarea>
                </div>
                <div class="col-md-6 mb-3">
                    <label class="form-label fw-bold mb-0">Latitude</label>
                    <input type="number" class="form-control" name="geo_lat" step="any" min="0" max="100">
                </div>
                <div class="col-md-6 mb-3">
                    <label class="form-label fw-bold mb-0">Longitude</label>
                    <input type="number" class="form-control" name="geo_long" step="any" min="0" max="100">
                </div>
                <div class="col-md-12 mb-3">
                    <label class="form-label">Draw Forest Boundary</label>
                    <div id="addForestMap" style="height: 400px; max-width:100%; border:1px solid #ccc;"></div>
                    <input type="hidden" name="boundary_file" id="boundaryGeoJson">
                </div><!-- Map -->
                <div class="col-md-12 mb-3">
                    <label class="form-label fw-bold mb-0">Any other info</label>
                    <textarea class="form-control" name="description"></textarea>
                </div>
            </div>

      </div>
      <div class="modal-footer border-0">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-danger sbtn">Save</button>
      </div>
      </form>
    </div>
  </div>
</div>
