<?php $item = $row ?? null; ?>
<div class="row g-3">
    <div class="col-md-4">
        <label class="form-label ec-required"><?= e(trans('conference')) ?></label>
        <select name="conference_id" class="form-select rounded-3" required>
            <option value="0">--</option>
            <?php foreach ($conferences as $c): ?>
                <option value="<?= e((string) $c['id']) ?>" <?= ((int) ($item['conference_id'] ?? ($_GET['conference_id'] ?? 0)) === (int) $c['id']) ? 'selected' : '' ?>>
                    <?= e(current_lang() === 'ar' ? (string) $c['title_ar'] : (string) $c['title_en']) ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="col-md-8">
        <label class="form-label"><?= e(trans('event_key')) ?></label>
        <input type="text" name="event_key" class="form-control rounded-3" value="<?= e((string) ($item['event_key'] ?? '')) ?>" placeholder="submission_created, review_assigned, decision_made, revision_uploaded, camera_ready_reminder" required>
    </div>

    <div class="col-md-6">
        <label class="form-label"><?= e(trans('subject_en')) ?></label>
        <input type="text" name="subject_en" class="form-control rounded-3" value="<?= e((string) ($item['subject_en'] ?? '')) ?>" required>
    </div>
    <div class="col-md-6">
        <label class="form-label"><?= e(trans('subject_ar')) ?></label>
        <input type="text" name="subject_ar" class="form-control rounded-3" value="<?= e((string) ($item['subject_ar'] ?? '')) ?>" required>
    </div>

    <div class="col-md-6">
        <label class="form-label"><?= e(trans('body_en')) ?></label>
        <textarea name="body_en" class="form-control rounded-3 richtext" rows="10"><?= e((string) ($item['body_en'] ?? '')) ?></textarea>
    </div>
    <div class="col-md-6">
        <label class="form-label"><?= e(trans('body_ar')) ?></label>
        <textarea name="body_ar" class="form-control rounded-3 richtext" rows="10"><?= e((string) ($item['body_ar'] ?? '')) ?></textarea>
    </div>

    <div class="col-md-12">
        <div class="form-check">
            <input class="form-check-input" type="checkbox" name="is_active" <?= !isset($item) || !empty($item['is_active']) ? 'checked' : '' ?>>
            <label class="form-check-label"><?= e(trans('is_active')) ?></label>
        </div>
    </div>
</div>
