/* ========================================
   UI MODERNE - DOCUMENTS & CERTIFICATS
   ======================================== */

/* Badge de compteur */
.badge-documents-count {
    background: #0dcaf0;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* EN-TÊTE DOCUMENTS */
.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.documents-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2c5aa0;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.documents-actions {
    display: flex;
    gap: 0.5rem;
}

/* GRILLE DE DOCUMENTS */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* CARTE DOCUMENT MODERNE */
.document-card-modern {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.document-card-modern:hover {
    transform: translateY(-4px);
    border-color: #2c5aa0;
    box-shadow: 0 8px 24px rgba(44, 90, 160, 0.15);
}

.document-card-modern.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.2);
}

/* Badge type de document */
.document-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.badge-pdf {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.badge-image {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
    color: white;
}

.badge-word {
    background: linear-gradient(135deg, #2b579a 0%, #1d3f6f 100%);
    color: white;
}

.badge-excel {
    background: linear-gradient(135deg, #217346 0%, #185c37 100%);
    color: white;
}

.badge-certificat {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.badge-default {
    background: #6c757d;
    color: white;
}

/* Icône grande du document */
.document-icon-large {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #2c5aa0;
    transition: all 0.3s ease;
}

.document-card-modern:hover .document-icon-large {
    transform: scale(1.1);
    background: linear-gradient(135deg, #2c5aa0 0%, #1a3a5c 100%);
    color: white;
}

/* Informations du document */
.document-info-modern {
    text-align: center;
}

.document-title-modern {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.meta-item {
    font-size: 11px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meta-item i {
    color: #2c5aa0;
}

.document-description {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Overlay avec actions */
.document-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 90, 160, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.document-card-modern:hover .document-overlay {
    opacity: 1;
}

.document-actions-overlay {
    display: flex;
    gap: 0.75rem;
}

.btn-action-overlay {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #2c5aa0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action-overlay:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-action-danger {
    background: #dc3545;
    color: white;
}

.btn-action-danger:hover {
    background: #c82333;
}

/* Indicateur de sélection */
.selection-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* ========================================
   MODAL APERÇU DOCUMENT
   ======================================== */

.document-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.preview-modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-title i {
    font-size: 28px;
    color: #2c5aa0;
}

.preview-title h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.preview-body {
    flex: 1;
    overflow: auto;
    padding: 2rem;
    background: #f8f9fa;
}

.preview-iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-image-container {
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.preview-unavailable {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.preview-unavailable i {
    color: #dee2e6;
}

.preview-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

/* ========================================
   ÉTAT VIDE MODERNE
   ======================================== */

.empty-state-documents {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #6c757d;
}

.empty-state-documents h4 {
    color: #212529;
    margin-bottom: 0.5rem;
}

/* DROPZONE */
.dropzone {
    margin-top: 2rem;
    padding: 3rem 2rem;
    border: 3px dashed #dee2e6;
    border-radius: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: #2c5aa0;
    background: #e7f3ff;
}

.dropzone-icon {
    font-size: 60px;
    color: #6c757d;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.dropzone:hover .dropzone-icon {
    color: #2c5aa0;
    transform: translateY(-5px);
}

.dropzone-text {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.dropzone-text strong {
    color: #212529;
}

.dropzone-hint {
    margin-top: 1rem;
    font-size: 12px;
    color: #6c757d;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .documents-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .documents-stats {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .documents-actions {
        width: 100%;
        justify-content: center;
    }

    .documents-grid {
        grid-template-columns: 1fr;
    }

    .document-preview-modal {
        padding: 1rem;
    }

    .preview-iframe {
        height: 400px;
    }
}
