<div class="row g-3">
  <?php if (!empty($items)) { ?>
    <div class="col-12">
      <div class="card border-0 custom-simple-card" style="border-radius: 12px; background-color: #ffffff;">
        <div class="card-body p-4">
          <div class="row g-3">
            
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label class="text-secondary small fw-medium mb-1">Customer Name</label>
                <input type="text" value="<?= $items['customer_name'] ?>" class="form-control bg-light border-0 px-2.5 rounded-2" style="height: 38px; font-size: 13px; color: #334155;" readonly>
              </div>
            </div>
            
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label class="text-secondary small fw-medium mb-1">Customer Number</label>
                <input type="text" value="<?= $items['customer_number'] ?>" class="form-control bg-light border-0 px-2.5 rounded-2" style="height: 38px; font-size: 13px; color: #334155;" readonly>
              </div>
            </div>
            
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label class="text-secondary small fw-medium mb-1">Customer Email</label>
                <input type="text" value="<?= $items['customer_email'] ?>" class="form-control bg-light border-0 px-2.5 rounded-2" style="height: 38px; font-size: 13px; color: #334155;" readonly>
              </div>
            </div>
            
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label class="text-secondary small fw-medium mb-1">Brand Name</label>
                <input type="text" value="<?= @$items['brand_name'] ?>" class="form-control bg-light border-0 px-2.5 rounded-2" style="height: 38px; font-size: 13px; color: #334155;" readonly>
              </div>
            </div>
            
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label class="text-secondary small fw-medium mb-1">Customer Address</label>
                <textarea readonly class="form-control bg-light border-0 px-2.5 rounded-2" style="font-size: 13px; color: #334155; padding: 8px 12px;" rows="2"><?= $items['customer_address'] ?></textarea>
              </div>
            </div>
            
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label class="text-secondary small fw-medium mb-1">Description</label>
                <textarea readonly class="form-control bg-light border-0 px-2.5 rounded-2" style="font-size: 13px; color: #334155; padding: 8px 12px;" rows="2"><?= $items['customer_description'] ?></textarea>
              </div>
            </div>
            
            <div class="col-12 mt-2">
              <label class="text-secondary small fw-medium mb-1">Your Invoice URL</label>
              <div class="input-group input-group-custom" style="max-width: 100%;">
                <input type="text" class="form-control text-to-cliboard bg-light border-0 px-2.5" readonly value="<?= base_url('invoice/' . $items['ids']) ?>" style="font-size: 12px; color: #475569; height: 34px;">
                
                <span class="input-group-text my-copy-btn cursor-pointer bg-light border-0 text-muted px-3" style="border-left: 1px solid #e2e8f0 !important;">
                  <i class="fas fa-copy" style="font-size: 13px;"></i>
                </span>
              </div>
              <?php $content = urlencode(base_url('invoice/' . $items['ids'])); ?>
            </div>

          </div>
        </div>
      </div>
    </div>
  <?php } else {
    echo show_empty_item();
  } ?>
</div>

<style>
    /* সিম্পল বর্ডার গাইডলাইন (কোনো ভারী শ্যাডো নেই) */
    .custom-simple-card {
        border: 1px solid #e2e8f0 !important;
    }
    
    /* ইনভয়েস লিংক ইনপুট গ্রুপ মডিফিকেশন */
    .input-group-custom {
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        overflow: hidden;
        background-color: #f8fafc;
    }
    .input-group-custom .my-copy-btn:hover {
        color: #3b82f6 !important;
    }
    .cursor-pointer {
        cursor: pointer;
    }
</style>

<script type="text/javascript">
  // আনবাইল্ড করে ক্লিক ইভেন্ট ফিক্স এবং শুধু কপি বাটনে ক্লিক এসাইন করা হয়েছে
  $(".my-copy-btn").unbind('click').click(function() {
    let vl = $(this).prev('.text-to-cliboard').val();
    let params = {
      'type': 'text',
      'value': vl,
    };
    copyToClipBoard(params, 'toast', 'Invoice Link Copied Successfully');
  });
</script>