<!-- Detail Modal -->
<div id="detailModal" class="modal-overlay">
    <div class="modal-content" style="max-width: 850px;">
        <div class="modal-header">
            <h2><i class="fas fa-user-circle"></i> Détails de l'Employé</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>
            <button type="button" class="btn btn-warning" id="editFromDetailBtn" onclick="editFromDetail()">
                <i class="fas fa-edit"></i> Modifier
            </button>
        </div>
    </div>
</div>

<!-- Additional styles for detail modal -->
<style>
    .detail-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-top: 15px;
    }
    .detail-section-block {
        background: #f8f9fa;
        border-radius: 10px;
        padding: 15px 20px;
    }
    .detail-section-block h3 {
        font-size: 16px;
        color: #2c3e50;
        margin: 0 0 15px 0;
        padding-bottom: 10px;
        border-bottom: 2px solid #e0e0e0;
    }
    .detail-section-block h3 i {
        margin-right: 8px;
        color: var(--primary-color, #2c3e50);
    }
    .detail-section-block .detail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 20px;
    }
    .detail-section-block .detail-item {
        display: flex;
        flex-direction: column;
        padding: 5px 0;
        border-bottom: 1px solid #eee;
    }
    .detail-section-block .detail-item:last-child {
        border-bottom: none;
    }
    .detail-section-block .detail-item .label {
        font-size: 11px;
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .detail-section-block .detail-item .value {
        font-size: 14px;
        color: #333;
        margin-top: 2px;
    }
    .detail-section-block .detail-item .value.empty {
        color: #aaa;
        font-style: italic;
    }

    @media (max-width: 768px) {
        .detail-grid-2 {
            grid-template-columns: 1fr;
        }
        .detail-section-block .detail-grid {
            grid-template-columns: 1fr;
        }
    }
</style>