<!-- Testimonials Tab -->
<div class="tab-pane fade" id="testimonials" role="tabpanel">
  <div class="row g-4">
    <!-- Basic Info -->
    <div class="col-md-12">
      <div class="card border shadow-sm">
        <div class="card-header bg-white">
          <h6 class="mb-0">
            <i class="fas fa-info-circle me-2"></i>Basic Information
          </h6>
        </div>
        <div class="card-body">
          <div class="row g-3">
            <div class="col-md-6">
              <label class="form-label fw-medium">Heading</label>
              <input
                type="text"
                class="form-control"
                id="testimonialsHeading"
                value="<%= data.testimonials?.heading || '' %>"
                placeholder="e.g., Student Reviews & Testimonials"
              />
            </div>
            <div class="col-md-6">
              <label class="form-label fw-medium">Subheading</label>
              <input
                type="text"
                class="form-control"
                id="testimonialsSubheading"
                value="<%= data.testimonials?.subheading || '' %>"
                placeholder="e.g., What Our Students Say"
              />
            </div>
            <div class="col-md-6">
              <label class="form-label fw-medium">Video URL</label>
              <input
                type="text"
                class="form-control"
                id="testimonialsVideoUrl"
                value="<%= data.testimonials?.videoUrl || '' %>"
                placeholder="https://www.youtube.com/watch?v=..."
              />
            </div>
            <div class="col-md-6">
              <label class="form-label fw-medium">Video Thumbnail</label>
              <div class="input-group mb-2">
                <input
                  type="text"
                  class="form-control"
                  id="testimonialsVideoThumbnail"
                  value="<%= data.testimonials?.videoThumbnail || '' %>"
                />
                <button
                  type="button"
                  class="btn btn-outline-primary btn-upload-image"
                  data-target-input="testimonialsVideoThumbnail"
                  data-image-type="home"
                >
                  <i class="fas fa-upload me-1"></i>Upload
                </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- Testimonial Items -->
    <div class="col-md-12">
      <div class="card border shadow-sm">
        <div class="card-header bg-white">
          <h6 class="mb-0">
            <i class="fas fa-comments me-2"></i>Testimonials
          </h6>
        </div>
        <div class="card-body">
          <% (data.testimonials?.items || []).forEach(function(item, index) { %>
          <div class="card mb-3 bg-light border">
            <div class="card-body">
              <h6 class="card-title fw-bold mb-3">Testimonial <%= index + 1 %></h6>
              <div class="row g-3">
                <div class="col-md-6">
                  <label class="form-label fw-medium">Name</label>
                  <input
                    type="text"
                    class="form-control"
                    id="testimonialsName_<%= index %>"
                    value="<%= item.name || '' %>"
                    placeholder="e.g., Sohel Tanvir"
                  />
                </div>
                <div class="col-md-6">
                  <label class="form-label fw-medium">Role</label>
                  <input
                    type="text"
                    class="form-control"
                    id="testimonialsRole_<%= index %>"
                    value="<%= item.role || '' %>"
                    placeholder="e.g., Student"
                  />
                </div>
                <div class="col-md-6">
                  <label class="form-label fw-medium">Country</label>
                  <input
                    type="text"
                    class="form-control"
                    id="testimonialsCountry_<%= index %>"
                    value="<%= item.country || '' %>"
                    placeholder="e.g., Canada"
                  />
                </div>
                <div class="col-md-6">
                  <label class="form-label fw-medium">Rating</label>
                  <input
                    type="number"
                    class="form-control"
                    id="testimonialsRating_<%= index %>"
                    value="<%= item.rating || 5 %>"
                    min="1"
                    max="5"
                  />
                </div>
                <div class="col-md-12">
                  <label class="form-label fw-medium">Comment</label>
                  <textarea
                    class="form-control"
                    id="testimonialsComment_<%= index %>"
                    rows="3"
                    placeholder="Enter testimonial comment"
                  ><%= item.comment || '' %></textarea>
                </div>
                <div class="col-md-12">
                  <label class="form-label fw-medium">Avatar</label>
                  <div class="input-group mb-2">
                    <input
                      type="text"
                      class="form-control"
                      id="testimonialsAvatar_<%= index %>"
                      value="<%= item.avatar || '' %>"
                    />
                    <button
                      type="button"
                      class="btn btn-outline-primary btn-upload-image"
                      data-target-input="testimonialsAvatar_<%= index %>"
                      data-image-type="home"
                    >
                      <i class="fas fa-upload me-1"></i>Upload
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <% }); %>
        </div>
      </div>
    </div>
  </div>
</div>
