@foreach($questionGroups as $group)
<div class="card mb-4">
    <div class="card-header">
        <strong>{{ $group->title }}</strong>
    </div>
    <div class="card-body">
        @foreach($group->questions as $question)
        <div class="mb-3">
            <label class="form-label">{{ $question->question_text }}</label>
            <textarea name="answers[{{ $question->id }}][text]" class="form-control" rows="2"></textarea>

            <label class="form-label mt-2">รูปภาพ (ถ้ามี)</label>
            <input type="file" name="answers[{{ $question->id }}][image]" class="form-control" accept="image/*">

            <label class="form-label mt-2">หมายเหตุ (ถ้ามี)</label>
            <textarea name="answers[{{ $question->id }}][comment]" class="form-control" rows="2"></textarea>
        </div>
        @endforeach
    </div>
</div>
@endforeach 