<!-- Edit User Modal -->
<div class="modal fade" id="editUserModal" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <form method="POST" id="editUserForm">
                @csrf
                @method('PUT')
                <div class="modal-header">
                    <h5 class="modal-title"><i class="fas fa-edit me-2"></i>Edit User</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body">
                    <div class="mb-3">
                        <label class="form-label">Username <span class="text-danger">*</span></label>
                        <input type="text" name="username" id="editUsername" class="form-control" required>
                        <div class="form-text">Username tidak boleh mengandung spasi</div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Password</label>
                        <div class="input-group">
                            <input type="password" name="password" id="editPassword" class="form-control">
                            <button type="button" class="btn btn-outline-secondary" onclick="togglePassword('editPassword', this)">
                                <i class="fas fa-eye"></i>
                            </button>
                        </div>
                        <div class="form-text">Kosongkan jika tidak ingin mengubah password</div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Role <span class="text-danger">*</span></label>
                        <select name="role_id" class="form-select" id="editRoleSelect" required>
                            <option value="">Pilih Role</option>
                            @foreach($roles as $role)
                                <option value="{{ $role->id_role }}">{{ ucfirst($role->nama_role) }}</option>
                            @endforeach
                        </select>
                    </div>
                    
                    <!-- Siswa Dropdown -->
                    <div class="mb-3" id="editSiswaSelect" style="display: none;">
                        <label class="form-label">Siswa <span class="text-danger">*</span></label>
                        <select name="id_siswa" id="editSiswaSelectInput" class="form-select">
                            <option value="">Pilih Siswa</option>
                        </select>
                    </div>
                    
                    <!-- Pembimbing Magang Dropdown -->
                    <div class="mb-3" id="editPembimbingMagangSelect" style="display: none;">
                        <label class="form-label">Pembimbing Magang <span class="text-danger">*</span></label>
                        <select name="id_pembimbing_magang" id="editPembimbingMagangSelectInput" class="form-select">
                            <option value="">Pilih Pembimbing Magang</option>
                        </select>
                    </div>
                    
                    <!-- Pembimbing Sekolah Dropdown -->
                    <div class="mb-3" id="editPembimbingSekolahSelect" style="display: none;">
                        <label class="form-label">Pembimbing Sekolah <span class="text-danger">*</span></label>
                        <select name="id_pembimbing_sekolah" id="editPembimbingSekolahSelectInput" class="form-select">
                            <option value="">Pilih Pembimbing Sekolah</option>
                        </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-warning">Update</button>
                </div>
            </form>
        </div>
    </div>
</div>