<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>طلب نقل جديد<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>

<div class="card" style="padding:25px;max-width:600px;">
    <form method="POST" action="/transfer-requests">
        <?= csrf_field() ?>

        <div class="form-group">
            <label class="form-label">رقم اللاعب</label>
            <input type="number" name="player_id" class="form-input" value="<?= old('player_id') ?>" required placeholder="أدخل رقم اللاعب">
        </div>

        <div class="form-group">
            <label class="form-label">المجموعة الحالية (النقل منها)</label>
            <select name="from_group_id" class="form-input" required>
                <option value="">— اختر —</option>
                <?php foreach ($groups as $g): ?>
                <option value="<?= (int) $g['id'] ?>"><?= e($g['name_ar']) ?></option>
                <?php endforeach; ?>
            </select>
        </div>

        <div class="form-group">
            <label class="form-label">المجموعة المطلوبة (النقل إليها)</label>
            <select name="to_group_id" class="form-input">
                <option value="">— مغادرة فقط (بدون نقل) —</option>
                <?php foreach ($groups as $g): ?>
                <option value="<?= (int) $g['id'] ?>"><?= e($g['name_ar']) ?></option>
                <?php endforeach; ?>
            </select>
        </div>

        <div class="form-group">
            <label class="form-label">السبب</label>
            <textarea name="reason_ar" class="form-input" rows="3" placeholder="سبب طلب النقل..."><?= old('reason_ar') ?></textarea>
        </div>

        <div style="display:flex;gap:10px;">
            <button type="submit" class="btn btn-primary">تقديم الطلب</button>
            <a href="/transfer-requests" class="btn btn-outline">إلغاء</a>
        </div>
    </form>
</div>
<?php $__template->endSection(); ?>
