<!-- Modal Registro de Alumnos -->
<div class="modal fade" id="modalRegistroAlumno" tabindex="-1" aria-labelledby="modalRegistroAlumnoLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="modalRegistroAlumnoLabel">
                    <i class="bi bi-person-plus-fill me-2"></i>Registro de Alumno
                </h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
            </div>
            <form id="formRegistroAlumno" class="p-3">
                <div class="row g-3">
                    <div class="col-md-6">
                        <label for="run" class="form-label">RUN</label>
                        <input type="text" class="form-control text-uppercase" id="run" name="run" required maxlength="12" autocomplete="off" style="text-transform:uppercase;">
                        <div class="invalid-feedback" id="runFeedback"></div>
                    </div>
                    <div class="col-md-6">
                        <label for="fecha_nac" class="form-label">Fecha de nacimiento</label>
                        <input type="date" class="form-control" id="fecha_nac" name="fecha_nac" required>
                    </div>
                    <div class="col-md-12">
                        <label for="nombre" class="form-label">Nombre</label>
                        <input type="text" class="form-control text-uppercase" id="nombre" name="nombre" required style="text-transform:uppercase;">
                    </div>
                    <div class="col-md-6">
                        <label for="ap_paterno" class="form-label">Apellido paterno</label>
                        <input type="text" class="form-control text-uppercase" id="ap_paterno" name="ap_paterno" required style="text-transform:uppercase;">
                    </div>
                    <div class="col-md-6">
                        <label for="ap_materno" class="form-label">Apellido materno</label>
                        <input type="text" class="form-control text-uppercase" id="ap_materno" name="ap_materno" required style="text-transform:uppercase;">
                    </div>
                    <div class="col-md-6">
                        <label for="modal_anio_escolar" class="form-label">Año Escolar</label>
                        <select class="form-select" id="modal_anio_escolar" name="anio_escolar" required>
                            <?php
                            $current_year = date('Y');
                            for ($i = -1; $i <= 2; $i++) {
                                $year = $current_year + $i;
                                $selected = ($i == 1) ? 'selected' : '';
                                echo "<option value=\"{$year}\" {$selected}>{$year}</option>";
                            }
                            ?>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label for="modal_tipo_ensenanza" class="form-label">Tipo de enseñanza</label>
                        <select class="form-select" id="modal_tipo_ensenanza" name="tipo_ensenanza" required>
                            <option value="">Selecciona...</option>
                            <option value="1">Educación Parvularia</option>
                            <option value="2">Educación Básica</option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label for="modal_grado" class="form-label">Grado</label>
                        <select class="form-select" id="modal_grado" name="grado_id" required>
                            <option value="">Selecciona...</option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label for="curso" class="form-label">Curso (A, B o C)</label>
                        <input type="text" class="form-control text-uppercase" id="curso" name="curso" pattern="[ABCabc]" maxlength="1" required value="A" style="text-transform:uppercase;">
                    </div>
                </div>
                <div class="modal-footer mt-4">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
                        <i class="bi bi-x-circle me-2"></i>Cancelar
                    </button>
                    <button type="submit" class="btn btn-primary">
                        <i class="bi bi-check-circle me-2"></i>Registrar
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>