<!-- Modal Create/Edit Demande Document -->
<div class="modal-overlay" id="formModal">
    <div class="modal-content">
        <div class="modal-header">
            <h2 id="modalTitle">Nouvelle Demande de Document</h2>
            <button type="button" class="modal-close" onclick="closeModal()">&times;</button>
        </div>
        <div class="modal-body">
            <form id="demandeForm">
                <input type="hidden" id="demandeId" value="">

                <div class="form-group">
                    <label for="professeur_id">Professeur <span class="required">*</span></label>
                    <select id="professeur_id" name="professeur_id" required>
                        <option value="">Sélectionner un professeur</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="libelle">Libellé <span class="required">*</span></label>
                    <input type="text" id="libelle" name="libelle"
                           placeholder="Ex: Demande de congé annuel 2026" required>
                </div>

                <div class="form-group">
                    <label for="type_document_id">Type de Document <span class="required">*</span></label>
                    <select id="type_document_id" name="type_document_id" required>
                        <option value="">Sélectionner un type de document</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="etat_demande_document_id">État <span class="required">*</span></label>
                    <select id="etat_demande_document_id" name="etat_demande_document_id" required>
                        <option value="">Sélectionner un état</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="date_soumission">Date de Soumission</label>
                    <input type="date" id="date_soumission" name="date_soumission">
                </div>

                <div class="form-group">
                    <label for="date_reponse">Date de Réponse</label>
                    <input type="date" id="date_reponse" name="date_reponse">
                </div>

                <div class="form-group">
                    <label for="description">Description</label>
                    <textarea id="description" name="description"
                              rows="4" placeholder="Description détaillée de la demande..."></textarea>
                </div>

                <div class="form-actions">
                    <button type="button" class="btn btn-secondary" onclick="closeModal()">
                        <i class="fas fa-times"></i> Annuler
                    </button>
                    <button type="button" class="btn btn-primary" onclick="saveDemande()">
                        <i class="fas fa-save"></i> Enregistrer
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
