/* ══════════════════════════════════════════════════════════════
   STYLES DOCUMENTS - ENS N'DJAMÉNA
   Version optimisée et consolidée
   ══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   VARIABLES GLOBALES
   ───────────────────────────────────────────── */

:root {
    /* Couleurs de fond */
    --doc-bg-light: #ffffff;
    --doc-bg-dark: #d1edee;
    
    /* Couleurs de texte */
    --doc-text-light: #000000;
    --doc-text-dark: #1dca3d;
    --doc-text-muted-light: #6b7280;
    --doc-text-muted-dark: #0d1015;
    
    /* Bordures */
    --doc-border-light: #e5e7eb;
    --doc-border-dark: #334155;
    
    /* Survol */
    --doc-hover-light: rgba(79, 70, 229, 0.05);
    --doc-hover-dark: rgba(210, 19, 19, 0.05);
    
    /* Couleurs d'accent */
    --doc-primary: #4f46e5;
    --doc-primary-hover: #4338ca;
    --doc-accent-hover: #dc2626;
    
    /* Filtres sticky */
    --doc-filters-top: 80px;
}

/* ─────────────────────────────────────────────
   PAGE CONTAINER
   ───────────────────────────────────────────── */

.documents-page {
    min-height: 80vh;
}

/* ─────────────────────────────────────────────
   EN-TÊTE
   ───────────────────────────────────────────── */

.documents-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--doc-primary);
}

.documents-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--doc-text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    transition: color 0.2s ease;
}

.documents-title:hover {
    color: var(--doc-accent-hover);
}

.documents-title i {
    color: var(--doc-primary);
}

.documents-count {
    background: var(--doc-primary);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   BARRE DE FILTRES (STICKY)
   ───────────────────────────────────────────── */

.documents-filters {
    position: sticky;
    top: var(--doc-filters-top);
    z-index: 100;
    background: var(--doc-bg-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.documents-filters .form-label {
    color: var(--doc-text-muted-light);
    font-weight: 500;
}

.filters-active-footer {
    background: #f8f9fa;
}

.active-filters small {
    color: var(--doc-text-muted-light);
}

.active-filters .badge a {
    text-decoration: none;
    font-weight: bold;
}

/* ─────────────────────────────────────────────
   TABLEAU DOCUMENTS
   ───────────────────────────────────────────── */

.documents-table-card {
    background: var(--doc-bg-light);
    overflow: hidden;
}

.table-documents {
    margin-bottom: 0;
}

.table-documents thead {
    background: linear-gradient(135deg, var(--doc-primary), #6366f1);
}

.table-documents thead th {
    color: #be4a4a;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.875rem 1rem;
    border: none;
    white-space: nowrap;
}

.table-documents tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--doc-border-light);
}

.table-documents tbody tr:hover {
    background-color: var(--doc-hover-light);
}

.table-documents tbody tr:last-child {
    border-bottom: none;
}

.table-documents td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    color: var(--doc-text-light);
}

/* Largeurs des colonnes */
.th-categorie, .td-categorie { width: 140px; }
.th-annee, .td-annee { width: 80px; text-align: center; }
.th-titre, .td-titre { min-width: 250px; }
.th-actions, .td-actions { width: 200px; }

/* ─────────────────────────────────────────────
   TITRE DU DOCUMENT
   ───────────────────────────────────────────── */

.doc-titre-link {
    font-weight: 500;
    color: var(--doc-text-light);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    transition: color 0.2s ease;
}

.doc-titre-link:hover {
    color: var(--doc-accent-hover);
}

.doc-reference {
    display: block;
    margin-top: 0.25rem;
    color: var(--doc-text-muted-light);
    font-size: 0.8rem;
}

/* ─────────────────────────────────────────────
   BADGE ANNÉE
   ───────────────────────────────────────────── */

.annee-badge,
.doc-mobile-year {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ─────────────────────────────────────────────
   BADGES CATÉGORIES
   ───────────────────────────────────────────── */

.badge-categorie {
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #ffffff;
}

.badge-loi { background: #6b21a8; }
.badge-arrete { background: #0369a1; }
.badge-decret { background: #b45309; }
.badge-decision { background: #0f766e; }
.badge-note_service { background: #4338ca; }
.badge-circulaire { background: #be123c; }
.badge-reglement { background: #065f46; }
.badge-convention { background: #7c2d12; }
.badge-proces_verbal { background: #374151; }
.badge-rapport { background: #1e3a8a; }

/* ─────────────────────────────────────────────
   BOUTONS ACTIONS
   ───────────────────────────────────────────── */

.td-actions .btn-group {
    white-space: nowrap;
}

.td-actions .btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

.td-actions .btn i {
    font-size: 0.85rem;
}

.td-actions .btn-text {
    margin-left: 0.3rem;
}

/* ─────────────────────────────────────────────
   ÉTAT VIDE
   ───────────────────────────────────────────── */

.empty-state {
    padding: 2rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--doc-text-muted-light);
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--doc-text-muted-light);
    margin-bottom: 1rem;
}

/* ─────────────────────────────────────────────
   VERSION MOBILE
   ───────────────────────────────────────────── */

.documents-mobile-list {
    padding: 0;
}

.document-mobile-card {
    padding: 1rem;
    border-bottom: 1px solid var(--doc-border-light);
    background: var(--doc-bg-light);
}

.document-mobile-card:last-child {
    border-bottom: none;
}

.doc-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.doc-mobile-title {
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.4;
}

.doc-mobile-title a {
    color: var(--doc-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.doc-mobile-title a:hover {
    color: var(--doc-accent-hover);
}

.doc-mobile-ref {
    display: block;
    color: var(--doc-text-muted-light);
    margin-bottom: 0.75rem;
}

.doc-mobile-actions {
    display: flex;
    gap: 0.5rem;
}

.doc-mobile-actions .btn {
    flex: 1;
    text-align: center;
}

/* ─────────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────────── */

.sidebar-sticky {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    overflow: hidden;
    background: var(--doc-bg-light);
}

.sidebar-header {
    background: var(--doc-primary);
    color: #fff;
    padding: 0.75rem 1rem;
}

.sidebar-header h6 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.sidebar-card .list-group-item {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-color: var(--doc-border-light);
    color: var(--doc-text-light);
    background: var(--doc-bg-light);
    transition: background-color 0.2s ease;
}

.sidebar-card .list-group-item:hover {
    background: var(--doc-hover-light);
}

.sidebar-card .list-group-item.active {
    background-color: var(--doc-primary);
    border-color: var(--doc-primary);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    :root {
        --doc-bg-light: var(--doc-bg-dark);
        --doc-text-light: var(--doc-text-dark);
        --doc-text-muted-light: var(--doc-text-muted-dark);
        --doc-border-light: var(--doc-border-dark);
        --doc-hover-light: var(--doc-hover-dark);
    }
    
    .documents-filters,
    .documents-table-card,
    .sidebar-card,
    .document-mobile-card {
        background: var(--doc-bg-dark);
    }
    
    .documents-filters .card-body,
    .filters-active-footer {
        background: var(--doc-bg-dark);
    }
    
    .documents-filters .form-select,
    .documents-filters .form-control {
        background-color: #262640;
        border-color: var(--doc-border-dark);
        color: var(--doc-text-dark);
    }
    
    .documents-filters {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .table-documents tbody tr {
        border-bottom-color: var(--doc-border-dark);
    }
    
    .annee-badge,
    .doc-mobile-year {
        background: #334155;
        color: var(--doc-text-dark);
    }
    
    .doc-titre-link:hover,
    .doc-mobile-title a:hover {
        color: #f87171;
    }
    
    .sidebar-card .list-group-item {
        background: var(--doc-bg-dark);
        border-color: var(--doc-border-dark);
        color: var(--doc-text-dark);
    }
    
    .sidebar-card .list-group-item:hover {
        background: var(--doc-hover-dark);
    }
}

/* Support classe .dark-mode (toggle manuel) */
.dark-mode .documents-filters,
.dark-mode .documents-table-card,
.dark-mode .sidebar-card,
.dark-mode .document-mobile-card {
    background: var(--doc-bg-dark);
}

.dark-mode .documents-filters .card-body,
.dark-mode .filters-active-footer {
    background: var(--doc-bg-dark);
}

.dark-mode .documents-title,
.dark-mode .table-documents td,
.dark-mode .doc-titre-link,
.dark-mode .doc-mobile-title a {
    color: var(--doc-text-dark);
}

.dark-mode .documents-filters .form-label,
.dark-mode .active-filters small,
.dark-mode .doc-reference,
.dark-mode .doc-mobile-ref,
.dark-mode .empty-state i,
.dark-mode .empty-state p {
    color: var(--doc-text-muted-dark);
}

.dark-mode .documents-filters .form-select,
.dark-mode .documents-filters .form-control {
    background-color: #262640;
    border-color: var(--doc-border-dark);
    color: var(--doc-text-dark);
}

.dark-mode .documents-filters {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dark-mode .table-documents tbody tr {
    border-bottom-color: var(--doc-border-dark);
}

.dark-mode .table-documents tbody tr:hover {
    background-color: var(--doc-hover-dark);
}

.dark-mode .annee-badge,
.dark-mode .doc-mobile-year {
    background: #334155;
    color: var(--doc-text-dark);
}

.dark-mode .doc-titre-link:hover,
.dark-mode .doc-mobile-title a:hover {
    color: #f87171;
}

.dark-mode .sidebar-card .list-group-item {
    background: var(--doc-bg-dark);
    border-color: var(--doc-border-dark);
    color: var(--doc-text-dark);
}

.dark-mode .sidebar-card .list-group-item:hover {
    background: var(--doc-hover-dark);
}

/* ═══════════════════════════════════════════════════════════════
   RTL (ARABE)
   ═══════════════════════════════════════════════════════════════ */

[dir="rtl"] .documents-title,
[dir="rtl"] .badge-categorie,
[dir="rtl"] .doc-mobile-header,
[dir="rtl"] .doc-mobile-actions,
[dir="rtl"] .sidebar-header h6 {
    flex-direction: row-reverse;
}

[dir="rtl"] .table-documents {
    text-align: right;
}

[dir="rtl"] .td-annee {
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Large Desktop */
@media (min-width: 1400px) {
    .th-titre, .td-titre {
        min-width: 350px;
    }
}

/* Tablette */
@media (max-width: 992px) {
    .documents-title {
        font-size: 1.25rem;
    }
    
    .td-actions .btn-text,
    .badge-text {
        display: none;
    }
    
    .th-categorie, .td-categorie { width: 120px; }
    .th-actions, .td-actions { width: 120px; }
    
    .sidebar-sticky {
        position: static;
    }
}

/* Tablette portrait */
@media (max-width: 768px) {
    .documents-header {
        text-align: center;
    }
    
    .documents-title {
        justify-content: center;
    }
    
    .documents-filters .row > div {
        margin-bottom: 0.5rem;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .documents-page {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .documents-title {
        font-size: 1.1rem;
    }
    
    .documents-count {
        font-size: 0.75rem;
        padding: 0.15rem 0.4rem;
    }
    
    .documents-filters .card-body {
        padding: 0.75rem;
    }
    
    .document-mobile-card {
        padding: 0.875rem;
    }
    
    .doc-mobile-title {
        font-size: 0.95rem;
    }
    
    .doc-mobile-actions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .badge-categorie {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Très petit écran */
@media (max-width: 360px) {
    .doc-mobile-actions {
        flex-direction: column;
    }
    
    .doc-mobile-actions .btn {
        width: 100%;
    }
}

/* ─────────────────────────────────────────────
   BADGES COMPTEURS
   ───────────────────────────────────────────── */

.sidebar-card .list-group-item .badge {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 28px;
}

.sidebar-card .list-group-item.active .badge {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #fff;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .sidebar-card .list-group-item .badge {
        background: #334155 !important;
        color: var(--doc-text-dark);
    }
    
    .sidebar-card .list-group-item.active .badge {
        background: rgba(255, 255, 255, 0.2) !important;
    }
}

.dark-mode .sidebar-card .list-group-item .badge {
    background: #334155 !important;
    color: var(--doc-text-dark);
}

.dark-mode .sidebar-card .list-group-item.active .badge {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ═══════════════════════════════════════════════════════════════
   LECTEUR DE DOCUMENT - PAGE DÉTAIL
   À ajouter à documents.css
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   EN-TÊTE DÉTAIL
   ───────────────────────────────────────────── */

.document-detail-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--doc-border-light);
}

.document-date {
    color: var(--doc-text-muted-light);
    font-size: 0.9rem;
}

.document-reference {
    color: var(--doc-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.document-detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--doc-text-light);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.document-description {
    font-size: 1rem;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   CONTENEUR DU LECTEUR
   ───────────────────────────────────────────── */

.document-viewer-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #1a1a2e;
}

/* ─────────────────────────────────────────────
   BARRE D'OUTILS DU LECTEUR
   ───────────────────────────────────────────── */

.viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #2d2d44, #1a1a2e);
    color: #fff;
}

.viewer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.viewer-info i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.viewer-filename {
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-filesize {
    opacity: 0.7;
    font-size: 0.85rem;
}

.viewer-actions {
    display: flex;
    gap: 0.5rem;
}

.viewer-actions .btn {
    padding: 0.4rem 0.6rem;
}

/* ─────────────────────────────────────────────
   ZONE DE CONTENU DU LECTEUR
   ───────────────────────────────────────────── */

.viewer-content {
    position: relative;
    background: #f5f5f5;
}

.document-viewer-frame {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border: none;
    display: block;
}

.viewer-fallback-notice {
    padding: 0.5rem 1rem;
    background: #fff3cd;
    color: #856404;
    text-align: center;
}

.viewer-fallback-notice a {
    color: #533f03;
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   FICHIER NON PRÉVISUALISABLE
   ───────────────────────────────────────────── */

.viewer-unsupported {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.unsupported-content {
    text-align: center;
    padding: 2rem;
}

.unsupported-content i {
    font-size: 4rem;
    color: var(--doc-primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.unsupported-content h4 {
    color: var(--doc-text-light);
    margin-bottom: 0.5rem;
}

/* ─────────────────────────────────────────────
   LECTEUR TEXTE
   ───────────────────────────────────────────── */

.text-viewer {
    padding: 1.5rem;
    background: #fff;
    max-height: 70vh;
    overflow-y: auto;
}

.text-viewer pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   CARTE ACTIONS (TÉLÉCHARGER & PARTAGER)
   ───────────────────────────────────────────── */

.document-actions-card {
    background: var(--doc-bg-light);
}

.section-label {
    color: var(--doc-text-muted-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.section-label i {
    margin-right: 0.5rem;
}

/* ─────────────────────────────────────────────
   BOUTON TÉLÉCHARGEMENT
   ───────────────────────────────────────────── */

.btn-download {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.download-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.download-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.download-action {
    font-weight: 600;
    font-size: 1rem;
}

.download-meta {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ─────────────────────────────────────────────
   BOUTONS DE PARTAGE
   ───────────────────────────────────────────── */

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.1rem;
}

.btn-share:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-share.whatsapp { background: #25D366; }
.btn-share.whatsapp:hover { background: #1da851; }

.btn-share.telegram { background: #0088cc; }
.btn-share.telegram:hover { background: #006699; }

.btn-share.email { background: #ea4335; }
.btn-share.email:hover { background: #c5362a; }

.btn-share.facebook { background: #1877f2; }
.btn-share.facebook:hover { background: #0d65d9; }

.btn-share.twitter { background: #1da1f2; }
.btn-share.twitter:hover { background: #0c85d0; }

.btn-share.copy { background: #6c757d; }
.btn-share.copy:hover { background: #545b62; }
.btn-share.copy.copied { background: #28a745; }

/* Champ copie */
.copy-link-field {
    max-width: 350px;
}

.copy-link-field .form-control {
    font-size: 0.8rem;
    background: #f8f9fa;
}

/* ─────────────────────────────────────────────
   INFORMATIONS
   ───────────────────────────────────────────── */

.info-item {
    padding: 0.5rem 0;
}

.info-label {
    display: block;
    font-size: 0.8rem;
    color: var(--doc-text-muted-light);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 500;
    color: var(--doc-text-light);
}

.doc-similar-title {
    font-weight: 500;
    color: var(--doc-text-light);
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE - LECTEUR
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    .document-detail-title {
        color: var(--doc-text-dark);
    }
    
    .document-detail-header {
        border-bottom-color: var(--doc-border-dark);
    }
    
    .document-date {
        color: var(--doc-text-muted-dark);
    }
    
    .viewer-content {
        background: #2d2d44;
    }
    
    .viewer-unsupported {
        background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    }
    
    .unsupported-content h4 {
        color: var(--doc-text-dark);
    }
    
    .text-viewer {
        background: #2d2d44;
        color: var(--doc-text-dark);
    }
    
    .document-actions-card {
        background: var(--doc-bg-dark);
    }
    
    .section-label {
        color: var(--doc-text-muted-dark);
    }
    
    .info-label {
        color: var(--doc-text-muted-dark);
    }
    
    .info-value,
    .doc-similar-title {
        color: var(--doc-text-dark);
    }
    
    .copy-link-field .form-control {
        background: #2d2d44;
        border-color: var(--doc-border-dark);
        color: var(--doc-text-dark);
    }
}

.dark-mode .document-detail-title {
    color: var(--doc-text-dark);
}

.dark-mode .document-detail-header {
    border-bottom-color: var(--doc-border-dark);
}

.dark-mode .document-date {
    color: var(--doc-text-muted-dark);
}

.dark-mode .viewer-content {
    background: #2d2d44;
}

.dark-mode .viewer-unsupported {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
}

.dark-mode .unsupported-content h4 {
    color: var(--doc-text-dark);
}

.dark-mode .text-viewer {
    background: #2d2d44;
    color: var(--doc-text-dark);
}

.dark-mode .document-actions-card {
    background: var(--doc-bg-dark);
}

.dark-mode .section-label {
    color: var(--doc-text-muted-dark);
}

.dark-mode .info-label {
    color: var(--doc-text-muted-dark);
}

.dark-mode .info-value,
.dark-mode .doc-similar-title {
    color: var(--doc-text-dark);
}

.dark-mode .copy-link-field .form-control {
    background: #2d2d44;
    border-color: var(--doc-border-dark);
    color: var(--doc-text-dark);
}

/* ═══════════════════════════════════════════════════════════════
   RTL - LECTEUR
   ═══════════════════════════════════════════════════════════════ */

[dir="rtl"] .viewer-toolbar,
[dir="rtl"] .viewer-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-download {
    flex-direction: row-reverse;
}

[dir="rtl"] .download-info {
    align-items: flex-end;
}

[dir="rtl"] .share-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .section-label i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE - LECTEUR
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .document-detail-title {
        font-size: 1.4rem;
    }
    
    .document-viewer-frame {
        height: 50vh;
        min-height: 350px;
    }
    
    .viewer-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .viewer-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .viewer-filename {
        max-width: 200px;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .btn-share {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .copy-link-field {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .document-detail-title {
        font-size: 1.2rem;
    }
    
    .document-viewer-frame {
        height: 40vh;
        min-height: 300px;
    }
    
    .viewer-unsupported {
        min-height: 250px;
    }
    
    .unsupported-content i {
        font-size: 3rem;
    }
    
    .download-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}