<?php
$page_title = 'My Profile';
require_once __DIR__ . '/header.php';
?>

<div style="display:flex;gap:24px;">
  <!-- Details Card -->
  <div class="card" style="flex:2;">
    <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid #e2e8f0;">
      <div style="display:flex;align-items:center;gap:16px;">
        <div style="width:64px;height:64px;background:#f1f5f9;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.8rem;color:#94a3b8;">
          <img src="https://ui-avatars.com/api/?name=<?= urlencode($dealer['name']) ?>&background=e2e8f0&color=0f172a" style="border-radius:50%;">
        </div>
        <div>
          <h2 style="margin:0 0 4px;font-size:1.4rem;color:#0f172a;"><?= h($dealer['company_name']) ?></h2>
          <span style="font-size:.85rem;color:#64748b;">Dealer Code: DLR-<?= str_pad($dealer['id'], 4, '0', STR_PAD_LEFT) ?> | Since: <?= date('d M Y', strtotime($dealer['created_at'])) ?></span>
        </div>
      </div>
      <button class="btn-outline" style="border-color:#2557d6;color:#2557d6;">Edit Profile</button>
    </div>

    <div style="display:grid;grid-template-columns:150px 1fr;gap:16px;font-size:.9rem;">
      <div style="color:#64748b;font-weight:500;">Contact Person</div>
      <div style="color:#0f172a;font-weight:600;"><?= h($dealer['name']) ?></div>

      <div style="color:#64748b;font-weight:500;">Mobile</div>
      <div style="color:#0f172a;"><?= h($dealer['phone']) ?></div>

      <div style="color:#64748b;font-weight:500;">Email</div>
      <div style="color:#0f172a;"><?= h($dealer['email']) ?></div>

      <div style="color:#64748b;font-weight:500;">GST No.</div>
      <div style="color:#0f172a;"><?= h($dealer['gst_no'] ?? '23ABCDE1234F1Z5') ?></div>

      <div style="color:#64748b;font-weight:500;">Address</div>
      <div style="color:#0f172a;line-height:1.5;"><?= h($dealer['address'] ?? '123, Main Market, Gandhi Nagar, Indore, MP - 452001') ?></div>
    </div>
  </div>

  <!-- KYC Documents -->
  <div class="card" style="flex:1;">
    <h3 style="margin:0 0 20px;font-size:1.1rem;color:#0f172a;">KYC Documents</h3>
    <div style="display:flex;flex-direction:column;gap:16px;">
      
      <div style="display:flex;justify-content:space-between;align-items:center;padding-bottom:12px;border-bottom:1px solid #f1f5f9;">
        <span style="font-size:.9rem;color:#334155;">GST Certificate</span>
        <span class="badge badge-success" style="font-size:.7rem;">Verified</span>
      </div>
      
      <div style="display:flex;justify-content:space-between;align-items:center;padding-bottom:12px;border-bottom:1px solid #f1f5f9;">
        <span style="font-size:.9rem;color:#334155;">PAN Card</span>
        <span class="badge badge-success" style="font-size:.7rem;">Verified</span>
      </div>

      <div style="display:flex;justify-content:space-between;align-items:center;padding-bottom:12px;border-bottom:1px solid #f1f5f9;">
        <span style="font-size:.9rem;color:#334155;">Shop License</span>
        <span class="badge badge-success" style="font-size:.7rem;">Verified</span>
      </div>

      <div style="display:flex;justify-content:space-between;align-items:center;padding-bottom:12px;border-bottom:1px solid #f1f5f9;">
        <span style="font-size:.9rem;color:#334155;">Cancelled Cheque</span>
        <span class="badge badge-success" style="font-size:.7rem;">Verified</span>
      </div>

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

<?php require_once __DIR__ . '/footer.php'; ?>
