<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card shadow-sm border-0 mt-4">
            <div class="card-header bg-white pb-0 border-bottom-0 pt-4">
                <h4 class="fw-bold text-primary mb-0"><i class="fa-solid fa-pen-to-square me-2"></i>تعديل المهمة</h4>
            </div>
            <div class="card-body">
                <form action="<?= BASE_URL ?>/todo/update" method="POST">
                    <?= csrf_field() ?>
                    <input type="hidden" name="task_id" value="<?= $task->id ?>">
                    
                    <div class="mb-3">
                        <label class="form-label fw-bold">عنوان المهمة</label>
                        <input type="text" name="title" class="form-control" value="<?= htmlspecialchars($task->title) ?>" required>
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label fw-bold">التصنيف</label>
                        <input type="text" name="category" class="form-control" value="<?= htmlspecialchars($task->category) ?>" required>
                    </div>
                    
                    <div class="mb-4">
                        <label class="form-label fw-bold">تاريخ التنفيذ</label>
                        <input type="date" name="target_date" class="form-control" value="<?= htmlspecialchars($task->target_date) ?>" required>
                    </div>
                    
                    <div class="d-flex justify-content-between">
                        <a href="<?= BASE_URL ?>/todo/index?date=<?= htmlspecialchars($task->target_date) ?>" class="btn btn-outline-secondary">إلغاء والعودة</a>
                        <button type="submit" class="btn btn-primary px-4">حفظ التعديلات</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
