<?php require __DIR__ . '/../../layouts/header.php'; $lang=current_lang(); ?>
<?php $r = $row ?? []; $id=(int)($r['id']??0); ?>
<div class="container" style="max-width:900px">
  <div class="d-flex justify-content-between align-items-center mb-3">
    <h4 class="mb-0"><i class="fa-solid fa-image me-2"></i><?= e($lang==='ar'?'شعار المؤتمر':'Conference Logo') ?> #<?= e((string)$id) ?></h4>
    <a class="btn btn-outline-secondary btn-rounded" href="<?= e(base_path('admin/conferences/edit?id='.$id)) ?>"><?= e($lang==='ar'?'رجوع':'Back') ?></a>
  </div>

  <div class="card border-0 shadow-sm">
    <div class="card-body">
      <?php if (!empty($r['logo_path'])): ?>
        <div class="mb-3">
          <img src="<?= e(base_path((string)$r['logo_path'])) ?>" style="max-height:120px;max-width:100%;object-fit:contain">
        </div>
      <?php endif; ?>

      <form method="post" action="<?= e(base_path('admin/conferences/logo/upload')) ?>" enctype="multipart/form-data" class="d-flex gap-2 flex-wrap">
        <input type="hidden" name="_csrf" value="<?= e(csrf_token()) ?>">
        <input type="hidden" name="id" value="<?= e((string)$id) ?>">
        <input class="form-control" type="file" name="logo" required>
        <button class="btn btn-primary btn-rounded"><i class="fa-solid fa-upload me-2"></i><?= e($lang==='ar'?'رفع':'Upload') ?></button>
      </form>
      <div class="text-muted small mt-2">png/jpg/webp/svg</div>
    </div>
  </div>
</div>
<?php require __DIR__ . '/../../layouts/footer.php'; ?>
