<?php
require_once "header.php";
?>

<style>
  .voucher-hero {
    background: linear-gradient(135deg, var(--sc-dark) 0%, #1a2c42 100%);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
  }
  .voucher-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
  }
  .voucher-hero p {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto 25px;
  }
  
  .voucher-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
  }
  .voucher-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--sc-dark);
    margin-bottom: 30px;
    border-left: 5px solid var(--sc-green);
    padding-left: 15px;
  }

  .voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }

  .voucher-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
  }
  .voucher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: #d1d5db;
  }

  .voucher-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(239,68,68,0.35);
    letter-spacing: 0.5px;
  }

  .voucher-category {
    font-size: 12px;
    font-weight: 700;
    color: var(--sc-green);
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-top: 10px;
  }

  .voucher-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 15px;
    line-height: 1.4;
    flex-grow: 1;
  }

  .voucher-price-box {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .voucher-discount-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    color: #c2410c;
    font-size: 1.1rem;
    font-weight: 900;
    padding: 6px 16px;
    border-radius: 8px;
  }
  .voucher-discount-tag svg {
    flex-shrink: 0;
  }
  .voucher-price-note {
    font-size: 12px;
    color: #9ca3af;
  }

  .voucher-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #f8fafc;
    border: 2px solid var(--sc-green);
    color: var(--sc-green);
    padding: 10px 0;
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
  }
  .voucher-btn:hover {
    background: var(--sc-green);
    color: #fff;
  }
</style>

<div class="voucher-hero">
  <h1>Top Certification Vouchers</h1>
  <p>Buy top certification vouchers at unbeatable prices online. Step into your future with SureCertificate, your gateway to certification success!</p>
</div>

<section class="voucher-section">
  <div class="voucher-section-title">CompTIA Vouchers</div>
  <div class="voucher-grid">
    <?php
    $comptia = [
      ['title' => 'CompTIA PenTest+ Voucher', 'cat' => 'CompTIA'],
      ['title' => 'CompTIA Cloud Essentials+ Voucher', 'cat' => 'CompTIA'],
      ['title' => 'CompTIA A+ Core 2 Voucher', 'cat' => 'CompTIA'],
      ['title' => 'CompTIA Security+ Voucher', 'cat' => 'CompTIA'],
      ['title' => 'CompTIA Network+ Voucher', 'cat' => 'CompTIA'],
      ['title' => 'CompTIA CySA+ Voucher', 'cat' => 'CompTIA'],
    ];
    foreach($comptia as $v):
    ?>
    <div class="voucher-card">
      <div class="voucher-badge">🔥 50% OFF</div>
      <div class="voucher-category"><?php echo $v['cat']; ?></div>
      <div class="voucher-title"><?php echo $v['title']; ?></div>
      <div class="voucher-price-box">
        <div class="voucher-discount-tag">
          <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg>
          Save 50%
        </div>
        <span class="voucher-price-note">Contact for price</span>
      </div>
      <button class="voucher-btn open-popup-btn" data-course="<?php echo htmlspecialchars($v['title']); ?>">Get Voucher</button>
    </div>
    <?php endforeach; ?>
  </div>
</section>

<section class="voucher-section">
  <div class="voucher-section-title">AWS Vouchers</div>
  <div class="voucher-grid">
    <?php
    $aws = [
      ['title' => 'AWS Data Engineer Associate', 'cat' => 'AWS'],
      ['title' => 'AWS Cloud Practitioner', 'cat' => 'AWS'],
      ['title' => 'AWS Sysops Administrator Associate', 'cat' => 'AWS'],
      ['title' => 'AWS Solutions Architect Associate', 'cat' => 'AWS'],
    ];
    foreach($aws as $v):
    ?>
    <div class="voucher-card">
      <div class="voucher-badge">🔥 50% OFF</div>
      <div class="voucher-category"><?php echo $v['cat']; ?></div>
      <div class="voucher-title"><?php echo $v['title']; ?></div>
      <div class="voucher-price-box">
        <div class="voucher-discount-tag">
          <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg>
          Save 50%
        </div>
        <span class="voucher-price-note">Contact for price</span>
      </div>
      <button class="voucher-btn open-popup-btn" data-course="<?php echo htmlspecialchars($v['title']); ?>">Get Voucher</button>
    </div>
    <?php endforeach; ?>
  </div>
</section>

<section class="voucher-section" style="margin-bottom: 80px;">
  <div class="voucher-section-title">Cisco Vouchers</div>
  <div class="voucher-grid">
    <?php
    $cisco = [
      ['title' => 'CISCO CCNA Voucher 200-301', 'cat' => 'Cisco'],
      ['title' => 'CISCO CCNP ENCOR Voucher 350-401', 'cat' => 'Cisco'],
      ['title' => 'CISCO CCNP SCOR 350-701 Voucher', 'cat' => 'Cisco'],
      ['title' => 'CISCO CCNP DCCOR 350-601 Voucher', 'cat' => 'Cisco'],
    ];
    foreach($cisco as $v):
    ?>
    <div class="voucher-card">
      <div class="voucher-badge">🔥 50% OFF</div>
      <div class="voucher-category"><?php echo $v['cat']; ?></div>
      <div class="voucher-title"><?php echo $v['title']; ?></div>
      <div class="voucher-price-box">
        <div class="voucher-discount-tag">
          <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg>
          Save 50%
        </div>
        <span class="voucher-price-note">Contact for price</span>
      </div>
      <button class="voucher-btn open-popup-btn" data-course="<?php echo htmlspecialchars($v['title']); ?>">Get Voucher</button>
    </div>
    <?php endforeach; ?>
  </div>
</section>

<script>
document.addEventListener("DOMContentLoaded", function() {
  var popupBtns = document.querySelectorAll('.open-popup-btn');
  popupBtns.forEach(function(btn) {
    btn.addEventListener('click', function(e) {
      e.preventDefault();
      var courseName = btn.getAttribute('data-course');
      var popup = document.getElementById("sc-lead-popup");
      var courseInput = document.getElementById('popCourse');
      
      if(courseInput && courseName) {
        courseInput.value = courseName + " Voucher";
      }
      
      if(popup) {
        popup.style.display = "flex";
      }
    });
  });
});
</script>

<?php require_once "footer.php"; ?>
