/* ========================================
   FORMATION DOCUMENTS - DESIGN MODERNE
   ======================================== */

/* Interface principale */
.documents-modern-interface {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Section génération */
.generation-section {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Cards de type de document - Design minimaliste */
.doc-type-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.doc-type-card:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.doc-type-card.all:hover {
    border-color: #6c757d;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.15);
}

/* Icône du type de document */
.doc-type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.doc-type-icon.certificat {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #0a6332;
}

.doc-type-icon.attestation {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: #084298;
}

.doc-type-icon.all {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
    color: #6c757d;
}

/* Contenu de la card */
.doc-type-content {
    flex-grow: 1;
}

.doc-type-title {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    margin-bottom: 0.25rem;
}

.doc-type-count {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Action (flèche) */
.doc-type-action {
    color: #6c757d;
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.doc-type-card:hover .doc-type-action {
    transform: translateX(4px);
    color: #0d6efd;
}

/* Section visualisation */
.viewing-section {
    padding-top: 1.5rem;
}

/* Bouton de visualisation des documents */
.btn-view-documents {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-view-documents:hover {
    background: #e9ecef;
    border-color: #0d6efd;
    color: #0d6efd;
}

/* ========================================
   OFFCANVAS - VIEWER DE DOCUMENTS
   ======================================== */

.documents-viewer-layout {
    display: flex;
    height: 100%;
    min-height: calc(100vh - 120px);
}

/* Sidebar des documents */
.documents-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.documents-sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.documents-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Groupe de documents */
.document-group {
    margin-bottom: 1rem;
}

.document-group-header {
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Item de document */
.document-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
}

.document-item:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    transform: translateX(4px);
}

.document-item.active {
    background: #e7f3ff;
    border-color: #0d6efd;
}

.document-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3cd;
    border-radius: 8px;
    color: #dc3545;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.document-item-content {
    flex-grow: 1;
    min-width: 0;
}

.document-item-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-item-meta {
    color: #6c757d;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Zone de visualisation */
.documents-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.documents-viewer-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    z-index: 10;
}

.viewer-header-info {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #212529;
}

.viewer-header-actions {
    display: flex;
    align-items: center;
}

.documents-viewer-content {
    flex: 1;
    position: relative;
    background: #525252;
}

/* Canvas PDF */
#pdf-canvas-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #525252;
}

#pdf-canvas {
    display: block;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Scrollbar pour le canvas */
#pdf-canvas-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#pdf-canvas-container::-webkit-scrollbar-track {
    background: #424242;
}

#pdf-canvas-container::-webkit-scrollbar-thumb {
    background: #757575;
    border-radius: 6px;
}

#pdf-canvas-container::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* État vide du viewer */
.viewer-empty-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#pdf-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* État vide de la liste */
.empty-documents-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

/* Scrollbar personnalisée */
.documents-list::-webkit-scrollbar {
    width: 6px;
}

.documents-list::-webkit-scrollbar-track {
    background: transparent;
}

.documents-list::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.documents-list::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .documents-modern-interface {
        padding: 1rem;
    }

    .doc-type-card {
        padding: 1rem;
    }

    .doc-type-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .documents-viewer-layout {
        flex-direction: column;
    }

    .documents-sidebar {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .documents-viewer-content {
        min-height: 50vh;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.documents-modern-interface {
    animation: fadeIn 0.4s ease;
}

/* ========================================
   UTILITAIRES
   ======================================== */

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Badge personnalisé */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* Alerte personnalisée */
.alert {
    border-radius: 10px;
    border: none;
}
