<?php
$title = "Donate Today - Wipe Tears Africa (WTA)";
$tagline = "Bringing hope & a future to the African children in Uganda";
$description = "Wipe Tears Africa (WTA) is a nonprofit organization founded in 2010, dedicated to restoring hope and transforming lives in Uganda.";
$keywords = "Wipe Tears Africa, Donate, Uganda NGO, Charity, Education, Children";
$featured_image = "https://www.wipetearsafrica.org/assets/images/wipe-tears-africa-uganda1.jpg";

include "includes/header.php";
include "includes/menu.php";
?>

<!-- PAGE HEADER -->
<section class="header-services"
  style="background: linear-gradient(to bottom, rgba(46,178,23,.75), rgba(46,178,23,.95)),
  url('assets/images/slides/wipe-tears-africa-4.jpg') center/cover no-repeat;">
  <div class="container text-center py-5">
    <h1 class="text-white fw-bold">Donate Today</h1>
    <p class="text-light mt-2">Your support empowers children, youth, and communities in Uganda.</p>
  </div>
</section>

<!-- DONATION CONTENT -->
<section class="home-intro-mid py-5">
  <div class="container">
    <div class="row align-items-center">

      <!-- Image -->
      <div class="col-md-6 mb-4">
        <img src="assets/images/donate-to-help-children-wipe-tears-africa.jpg"
             class="img-fluid rounded shadow-sm"
             alt="Donate to Help Children">
      </div>

      <!-- Text + CTA -->
      <div class="col-md-6">
        <h5 class="tdeco fw-semibold">Make Your Donation Today</h5>
        <h2 class="fw-bold">Your support changes lives</h2>
        <p>
          Your support of <strong>$35 a month</strong> helps provide education,
          meals, school supplies, and hope to vulnerable children in Uganda.
          Every donation, big or small, makes a difference.
        </p>

        <div class="mt-3">
          <button class="btn btn-success me-2 mb-2"
                  data-bs-toggle="modal"
                  data-bs-target="#donationModal">
            <i class="fas fa-donate me-1"></i> Donate with Card (Stripe)
          </button>
          <button class="btn btn-outline-success mb-2"
                  data-bs-toggle="modal"
                  data-bs-target="#donorboxModal">
            <i class="fas fa-hand-holding-heart me-1"></i> Donate via Donorbox
          </button>
        </div>
      </div>

    </div>
  </div>
</section>

<!-- STRIPE DONATION MODAL -->
<div class="modal fade" id="donationModal" tabindex="-1" aria-hidden="true">
  <div class="modal-dialog modal-lg modal-dialog-centered">
    <div class="modal-content">

      <div class="modal-header bg-success text-white">
        <h5 class="modal-title">Wipe Tears Africa – Official Donation Portal</h5>
        <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
      </div>

      <div class="modal-body">
        <form action="donation_server.php" method="POST" class="p-3">

          <!-- 1. Donor Identification -->
          <h5 class="text-success fw-bold mb-3">1. Donor Identification</h5>

          <div class="mb-3">
            <label class="form-label fw-semibold">Donor Category</label>
            <select name="donor_category" class="form-select" required>
              <option value="">Select Category</option>
              <option value="individual">Individual Donor</option>
              <option value="corporate">Corporate / Company</option>
              <option value="foundation">Foundation / Development Partner</option>
            </select>
          </div>

          <div class="mb-3">
            <input type="text" name="organization_name" class="form-control" placeholder="Organization / Company Name (if applicable)">
          </div>

          <div class="mb-3">
            <input type="text" name="contact_person" class="form-control" placeholder="Full Name / Authorized Contact Person" required>
          </div>

          <div class="mb-3">
            <input type="email" name="email" class="form-control" placeholder="Email Address" required>
          </div>

          <div class="mb-3">
            <input type="tel" name="phone" class="form-control" placeholder="Phone Number">
          </div>

          <hr>

          <!-- 2. Program Allocation -->
          <h5 class="text-success fw-bold mb-3">2. Program Allocation</h5>
          <div class="mb-3">
            <label class="form-label fw-semibold">Select Program to Support</label>
            <select name="program_area" class="form-select" required>
              <option value="">Choose Program Area</option>
              <option value="education">Child Education & Sponsorship</option>
              <option value="health">Community Health Support</option>
              <option value="girl_child">Girl Child Empowerment</option>
              <option value="skills">Youth & Skills Development</option>
              <option value="general">General Organizational Support</option>
            </select>
          </div>

          <hr>

          <!-- 3. Contribution Details -->
          <h5 class="text-success fw-bold mb-3">3. Contribution Amount (USD)</h5>
          <div class="row g-3 mb-3">
            <div class="col-6 col-md-3">
              <div class="form-check">
                <input class="form-check-input" type="radio" name="amount" value="100" required>
                <label class="form-check-label">$100</label>
              </div>
            </div>
            <div class="col-6 col-md-3">
              <div class="form-check">
                <input class="form-check-input" type="radio" name="amount" value="250">
                <label class="form-check-label">$250</label>
              </div>
            </div>
            <div class="col-6 col-md-3">
              <div class="form-check">
                <input class="form-check-input" type="radio" name="amount" value="500">
                <label class="form-check-label">$500</label>
              </div>
            </div>
            <div class="col-6 col-md-3">
              <div class="form-check">
                <input class="form-check-input" type="radio" name="amount" value="1000">
                <label class="form-check-label">$1,000</label>
              </div>
            </div>
          </div>

          <div class="mb-3">
            <input type="number" name="custom_amount" class="form-control" placeholder="Other Amount (USD)" min="1">
          </div>

          <div class="mb-3">
            <label class="form-label fw-semibold">Funding Reference (Optional)</label>
            <input type="text" name="reference_code" class="form-control" placeholder="Internal reporting / project tracking">
          </div>

          <div class="mb-3">
            <label class="form-label fw-semibold">Preferred Payment Method</label>
            <select name="payment_method" class="form-select" required>
              <option value="">Select Payment Method</option>
              <option value="stripe">Credit / Debit Card (Stripe)</option>
              <option value="bank_transfer">Bank Transfer</option>
              <option value="mobile_money">Mobile Money (Uganda)</option>
            </select>
          </div>

          <div class="mb-3">
            <textarea name="message" class="form-control" rows="3" placeholder="Additional message or compliance notes"></textarea>
          </div>

          <!-- CTA Buttons -->
          <div class="d-flex flex-column flex-md-row gap-3 mt-3">
            <button type="submit" class="btn btn-success w-100">
              <i class="fas fa-donate me-2"></i> Donate Now
            </button>
            <a href="sponsor-a-child.php" class="btn btn-outline-primary w-100">
              <i class="fas fa-heart me-2"></i> Sponsor a Child
            </a>
          </div>

        </form>
      </div>
    </div>
  </div>
</div>

<!-- DONORBOX MODAL -->
<div class="modal fade" id="donorboxModal" tabindex="-1" aria-hidden="true">
  <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
    <div class="modal-content">
      <div class="modal-header bg-success text-white">
        <h5 class="modal-title">Donate via Donorbox</h5>
        <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
      </div>
      <div class="modal-body text-center">
        <iframe
          src="https://donorbox.org/embed/education-sponsorship-895447"
          name="donorbox"
          allowpaymentrequest="allowpaymentrequest"
          frameborder="0"
          scrolling="no"
          allow="payment"
          style="width:100%; max-width:500px; min-width:280px; height:900px; border:none;">
        </iframe>
      </div>
    </div>
  </div>
</div>

<!-- Custom CSS -->
<style>
.card {
  border-radius: 1rem;
}
.card-header h4 {
  font-weight: 700;
  font-size: 1.4rem;
}
.card-header small {
  font-size: 0.9rem;
}
.form-label.fw-semibold {
  font-weight: 600;
}
.form-check-label {
  cursor: pointer;
  font-weight: 500;
}
.btn i {
  vertical-align: middle;
}
@media (max-width: 767px) {
  .d-flex.flex-md-row {
    flex-direction: column !important;
  }
}
</style>

<?php include "includes/footer.php"; ?>