<?php
// app/view/admin/pedagogie/inscription_module/view/modal.php
?>

<div id="detailModal" class="modal-overlay">
    <div class="modal-content" style="max-width: 900px;">
        <div class="modal-header">
            <h2><i class="fas fa-user-graduate" style="color: #27ae60;"></i> Détails de l'Inscription</h2>
            <button type="button" class="modal-close" onclick="closeDetailModal()">&times;</button>
        </div>
        <div class="modal-body">
            <div id="detailContent">
                <div class="loading active">
                    <div class="spinner"></div>
                    <p style="margin-top: 10px;">Chargement des détails...</p>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-secondary" onclick="closeDetailModal()">
                <i class="fas fa-times"></i> Fermer
            </button>
        </div>
    </div>
</div>

<style>
.detail-section { padding: 5px 0; }
.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    margin-bottom: 20px;
}
.detail-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}
.detail-title { flex: 1; }
.detail-title h2 { margin: 0 0 8px 0; font-size: 22px; color: #2c3e50; }
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-meta .badge { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-primary { background: #cce5ff; color: #004085; }
.badge-secondary { background: #e9ecef; color: #495057; }
.badge-success { background: #d4edda; color: #155724; }
.badge-info { background: #d1ecf1; color: #0c5460; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.detail-item .label { font-size: 11px; font-weight: 600; color: #7f8c8d; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-item .value { font-size: 15px; font-weight: 500; color: #2c3e50; word-break: break-word; }
.detail-item.full-width { grid-column: 1 / -1; }

.detail-students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.detail-students-table th,
.detail-students-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}
.detail-students-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
}
.detail-students-table tr:hover { background: #f0f2f5; }

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-header { flex-direction: column; text-align: center; }
    .detail-meta { justify-content: center; }
}
@media (max-width: 480px) {
    .modal-content { max-width: 95% !important; margin: 10px; }
    .modal-body { padding: 15px; }
}
</style>