<div class="container-fluid">
  <div class="container-fluid">
    <div class="card">
      <div class="card-body">
        <h5 class="card-title fw-semibold mb-4">Edit Video</h5>
        <div class="card">
          <div class="card-body">
            <form method="POST" enctype="multipart/form-data">
              <input type="hidden" name="id" value="<?= $video['id'] ?>">

              <div class="row">
                <!-- <div class="col-sm-12">
                  <div class="mb-3">
                      <div class="form-group">
                        <label for="type">Select Type:</label>
                        <select name="type" id="type" class="form-control">
                            <option value="view" <?php echo $video['type'] == 'view' ? 'selected' : ''; ?>>View</option>
                            <option value="like" <?php echo $video['type'] == 'like' ? 'selected' : ''; ?>>Like</option>
                            <option value="subscribe" <?php echo $video['type'] == 'subscribe' ? 'selected' : ''; ?>>Subscribe</option>
                        </select>
                      </div> 
                  </div>
                </div> -->
                <div class="col-sm-12">
                    <div class="mb-3">
                        <label for="link" class="form-label">Video Link</label>
                        <input type="url" name="link" required class="form-control" id="link" value="<?= $video['link'] ?>">
                    </div>
                </div>
                
                <div class="col-sm-12">
                    <div class="mb-3">
                        <label for="target" class="form-label">Target Count</label>
                        <input type="number" name="target" required class="form-control" id="target" min="1" value="<?= $video['target'] ?>">
                    </div>
                </div>


                <div class="col-sm-12">
                  <div class="mb-3">
                      <label for="thumbnail" class="form-label">Thumbnail</label>
                      <input type="file" name="thumbnail" class="form-control" id="thumbnail">
                      <?php if (!empty($video['thumbnail'])): ?>
                          <img src="<?= $video['thumbnail'] ?>" alt="Thumbnail" class="mt-2" style="max-width: 150px;">
                      <?php endif; ?>
                  </div>
              </div>

              </div>

              <button type="submit" class="btn btn-primary">Update</button>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
