<!-- Modal: Edit Kelas -->
<div class="modal fade" id="editKelasModal" tabindex="-1" aria-labelledby="editKelasLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header bg-success bg-opacity-25">
                <h5 class="modal-title text-dark" id="editKelasLabel">Edit Kelas</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <form id="editKelasForm" action="" method="POST">
                @csrf
                @method('PUT')
                <div class="modal-body">
                    <div class="mb-3">
                        <label class="form-label">Nama Kelas</label>
                        <input id="edit_nama" type="text" name="nama" class="form-control" placeholder="otomatis terisi setelah memilih tingkat dan rombel" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Fase</label>
                        <select id="edit_fase" name="fase" class="form-select">
                            <option value="" selected>Pilih Fase</option>
                            <option value="A">A</option>
                            <option value="B">B</option>
                            <option value="C">C</option>
                        </select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Tingkat</label>
                        <select id="edit_tingkat" name="tingkat" class="form-select">
                            <option value="" selected>Pilih Tingkat</option>
                            @for($i=1;$i<=6;$i++)
                                <option value="{{ $i }}">{{ $i }}</option>
                            @endfor
                        </select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Rombel</label>
                        <select id="edit_rombel" name="rombel" class="form-select">
                            <option value="" selected>Pilih Rombel</option>
                            <option value="A">A</option>
                            <option value="B">B</option>
                            <option value="C">C</option>
                        </select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Wali Kelas</label>
                        <select id="edit_walikelas_id" name="walikelas_id" class="form-select">
                            <option value="">-- Pilih Guru --</option>
                            @foreach($availableGurus as $g)
                                <option value="{{ $g->id }}">{{ $g->name }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
                    <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
                </div>
            </form>
        </div>
    </div>
</div>
