<?php require __DIR__ . '/../layouts/header.php'; $lang=current_lang(); ?>
<div class="container" style="max-width:900px">
  <h4 class="mb-3"><i class="fa-solid fa-clipboard-check me-2"></i><?= e($lang==='ar'?'نموذج التحكيم':'Review Form') ?></h4>

  <?php if (!empty($err)): ?><div class="alert alert-danger"><?= e((string)$err) ?></div><?php endif; ?>

  <div class="card border-0 shadow-sm">
    <div class="card-body">
      <form method="post" action="<?= e(base_path('reviewer/submit')) ?>" enctype="multipart/form-data" class="row g-3">
        <input type="hidden" name="_csrf" value="<?= e(csrf_token()) ?>">
        <input type="hidden" name="assignment_id" value="<?= e((string)$row['id']) ?>">

        <div class="col-md-4">
          <label class="form-label"><?= e($lang==='ar'?'التقييم (1-5)':'Score (1-5)') ?></label>
          <input class="form-control" type="number" min="1" max="5" name="score" value="4" required>
        </div>
        <div class="col-md-8">
          <label class="form-label"><?= e($lang==='ar'?'التوصية':'Recommendation') ?></label>
          <select class="form-select" name="recommendation" required>
            <option value="accept">accept</option>
            <option value="minor_revision">minor_revision</option>
            <option value="major_revision">major_revision</option>
            <option value="reject">reject</option>
          </select>
        </div>

        <div class="col-md-6">
          <label class="form-label"><?= e($lang==='ar'?'ملاحظات للمؤلف':'Comments to Author') ?></label>
          <textarea class="form-control" name="comments_to_author" rows="5"></textarea>
        </div>
        <div class="col-md-6">
          <label class="form-label"><?= e($lang==='ar'?'ملاحظات للإدارة':'Comments to Editor') ?></label>
          <textarea class="form-control" name="comments_to_editor" rows="5"></textarea>
        </div>

        <div class="col-12">
          <label class="form-label"><?= e($lang==='ar'?'ملف مرفق للتحكيم (اختياري)':'Review file (optional)') ?></label>
          <input class="form-control" type="file" name="review_file">
        </div>

        <div class="col-12 d-flex gap-2">
          <button class="btn btn-primary btn-rounded"><i class="fa-solid fa-paper-plane me-2"></i><?= e($lang==='ar'?'إرسال التحكيم':'Submit Review') ?></button>
          <a class="btn btn-outline-secondary btn-rounded" href="<?= e(base_path('reviewer')) ?>"><?= e($lang==='ar'?'رجوع':'Back') ?></a>
        </div>
      </form>
    </div>
  </div>
</div>
<?php require __DIR__ . '/../layouts/footer.php'; ?>
