<!-- Visa Countries Tab -->
<div class="tab-pane fade" id="visacountries" 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="visaCountriesHeading"
                value="<%= data.visaCountries?.heading || '' %>"
                placeholder="e.g., Visa & VISAWAY Services To UK"
              />
            </div>
            <div class="col-md-6">
              <label class="form-label fw-medium">Subheading</label>
              <input
                type="text"
                class="form-control"
                id="visaCountriesSubheading"
                value="<%= data.visaCountries?.subheading || '' %>"
                placeholder="e.g., UK. United Kingdom"
              />
            </div>
            <div class="col-md-12">
              <label class="form-label fw-medium">Description</label>
              <textarea
                class="form-control"
                id="visaCountriesDescription"
                rows="3"
                placeholder="Enter description"
              ><%= data.visaCountries?.description || '' %></textarea>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- Countries -->
    <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-globe me-2"></i>Countries
          </h6>
        </div>
        <div class="card-body">
          <% (data.visaCountries?.countries || []).forEach(function(country, index) { %>
          <div class="card mb-3 bg-light border">
            <div class="card-body">
              <h6 class="card-title fw-bold mb-3">Country <%= index + 1 %></h6>
              <div class="row g-3">
                <div class="col-md-6">
                  <label class="form-label fw-medium">Country Name</label>
                  <input
                    type="text"
                    class="form-control"
                    id="visaCountriesName_<%= index %>"
                    value="<%= country.name || '' %>"
                    placeholder="e.g., United Kingdom"
                  />
                </div>
                <div class="col-md-6">
                  <label class="form-label fw-medium">Country Code</label>
                  <input
                    type="text"
                    class="form-control"
                    id="visaCountriesCode_<%= index %>"
                    value="<%= country.code || '' %>"
                    placeholder="e.g., UK"
                  />
                </div>
                <div class="col-md-6">
                  <label class="form-label fw-medium">Flag Image</label>
                  <div class="input-group mb-2">
                    <input
                      type="text"
                      class="form-control"
                      id="visaCountriesFlag_<%= index %>"
                      value="<%= country.flag || '' %>"
                    />
                    <button
                      type="button"
                      class="btn btn-outline-primary btn-upload-image"
                      data-target-input="visaCountriesFlag_<%= index %>"
                      data-image-type="home"
                    >
                      <i class="fas fa-upload me-1"></i>Upload
                    </button>
                  </div>
                </div>
                <div class="col-md-6">
                  <label class="form-label fw-medium">Link</label>
                  <input
                    type="text"
                    class="form-control"
                    id="visaCountriesLink_<%= index %>"
                    value="<%= country.link || '' %>"
                    placeholder="/country-details/uk"
                  />
                </div>
                <div class="col-md-12">
                  <label class="form-label fw-medium">Visa Types (comma-separated)</label>
                  <textarea
                    class="form-control"
                    id="visaCountriesVisaTypes_<%= index %>"
                    rows="2"
                    placeholder="e.g., Student Visa, Work Visa, Tourist Visa"
                  ><%= (country.visaTypes || []).join(', ') %></textarea>
                </div>
              </div>
            </div>
          </div>
          <% }); %>
        </div>
      </div>
    </div>

    <!-- CTA Button -->
    <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-mouse-pointer me-2"></i>CTA Button
          </h6>
        </div>
        <div class="card-body">
          <div class="row g-3">
            <div class="col-md-6">
              <label class="form-label fw-medium">Label</label>
              <input
                type="text"
                class="form-control"
                id="visaCountriesCtaLabel"
                value="<%= data.visaCountries?.ctaButton?.label || '' %>"
                placeholder="e.g., Get Started"
              />
            </div>
            <div class="col-md-6">
              <label class="form-label fw-medium">Link</label>
              <input
                type="text"
                class="form-control"
                id="visaCountriesCtaHref"
                value="<%= data.visaCountries?.ctaButton?.href || '' %>"
                placeholder="/contact"
              />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
