/**
 * public/css/style.css
 * Feuille de style principale pour l'application HOUDA FROM THE CLOUD.
 */

/* Styles généraux */
body {
    font-size: 0.9rem;
    padding-top: 70px; /* Espace pour la navbar fixe */
    background-color: #f8f9fa; /* Léger fond gris */
    color: #212529; /* Couleur de texte par défaut */
}

h1 {
    font-size: 1.5rem; /* Taille H1 ajustée */
    color: #343a40;
    font-weight: 500;
}

/* Liens */
a {
    color: #0d6efd;
    text-decoration: none;
}
a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* Barre de Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.navbar-brand img {
    height: 40px;
    border-radius: 20px; /* Assurer l'arrondi */
    vertical-align: middle; /* Meilleur alignement */
}
.navbar-brand {
    font-weight: 500;
}

/* Table DataTables */
.table th,
.table td {
    padding: 0.5rem 0.5rem;
    vertical-align: middle;
    border-color: #dee2e6; /* Couleur de bordure standard */
}

.table th {
    background-color: #e9ecef; /* Fond léger pour les en-têtes */
    font-weight: 600; /* Police un peu plus grasse */
    white-space: nowrap; /* Empêcher retour à la ligne par défaut */
}

.table-hover tbody tr:hover {
    background-color: #f1f1f1; /* Couleur de survol */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.03); /* Zébrures légères */
}

.table-sm th,
.table-sm td {
    padding: 0.4rem; /* Padding réduit pour table-sm */
}

/* Indicateur de chargement DataTables */
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px; /* Un peu plus large */
    margin-left: -125px;
    margin-top: -26px;
    text-align: center;
    padding: 1em 0;
    background-color: rgba(255, 255, 255, 0.9); /* Fond semi-transparent */
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1056; /* Au-dessus de la modale */
    font-size: 1rem;
    color: #333;
}
.dataTables_wrapper .dataTables_processing .spinner-border {
    width: 1.2rem;
    height: 1.2rem;
}

/* Tooltips Bootstrap */
.tooltip-inner {
    max-width: 400px;
    padding: 0.4rem 0.8rem;
    background-color: #343a40; /* Fond sombre */
    color: #fff;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    text-align: left !important;
}
.tooltip.bs-tooltip-top .tooltip-arrow::before { border-top-color: #343a40; }
.tooltip.bs-tooltip-end .tooltip-arrow::before { border-right-color: #343a40; }
.tooltip.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: #343a40; }
.tooltip.bs-tooltip-start .tooltip-arrow::before { border-left-color: #343a40; }


/* Ligne en cours de traitement */
tr.processing-row {
    background-color: #fff3cd !important; /* Jaune pâle Bootstrap */
    transition: background-color 0.5s ease-in-out;
    opacity: 0.8; /* Léger effet d'atténuation */
}

/* --- Styles spécifiques aux colonnes --- */

/* Colonne Source */
#documentsTable td:nth-child(2) { /* Cibler la 2ème colonne (Source) */
    text-align: center;
}
#documentsTable .source-btn {
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-width: 1px;
    white-space: nowrap; /* Empêcher retour à la ligne */
}
#documentsTable .source-text {
    font-size: 0.75rem;
    font-weight: bold;
    color: #6c757d;
    display: inline-block;
    padding: 0.15rem 0.3rem;
}
/* Icône lien externe dans source */
#documentsTable .source-link .fa-external-link-alt {
    font-size: 10px;
    position: relative !important;
    left: 2px;
    bottom: 3px;
    vertical-align: baseline;
    color: #0d6efd;
}


/* Colonnes Date Pub et Titre Document */
#documentsTable td.col-date-pub,
#documentsTable td.col-doc-title {
    font-size: 0.9em; /* 90% de la taille parente */
}
#documentsTable td.col-doc-title span[title] {
    font-size: inherit; /* Assurer l'héritage */
}

/* Colonne Statut */
#documentsTable td .badge {
    display: block;
    width: 100%;
    border-radius: 0; /* Coins carrés */
    padding: 5px;
    text-align: center;
    font-size: 0.85em;
    font-weight: 500;
    white-space: normal;
}
/* Assurer couleurs texte pour badges (normalement géré par Bootstrap) */
#documentsTable td .badge.bg-warning { color: #000 !important; }
#documentsTable td .badge.bg-success,
#documentsTable td .badge.bg-danger { color: #fff !important; }


/* Colonnes Fichier Original / Traité */
.file-info-layout {
    width: 100%;
    display: flex;
    flex-direction: column; /* Empiler les lignes icône+taille */
    min-height: 40px;
    justify-content: center; /* Centrer verticalement si une seule ligne */
}
/* Style pour chaque ligne (icône + taille) à l'intérieur du layout */
.file-info-layout > div {
   display: flex;
   align-items: center;
   margin-bottom: 0.25rem; /* Espacer les lignes empilées */
}
/* Supprimer la marge du bas pour le dernier élément */
.file-info-layout > div:last-child {
    margin-bottom: 0 !important;
}

/* Colonne(s) pour les icônes */
.file-icon-col {
    flex-shrink: 0; /* Empêche la colonne de l'icône de rétrécir */
    margin-right: 0.5rem; /* me-2 */
}

/* Wrapper d'icône (style de base) */
.file-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;  /* Votre largeur personnalisée */
    height: 40px;
    border-radius: 0.35rem;
    font-size: 1.5rem; /* Votre taille d'icône personnalisée */
    color: #fff;
    background-color: #adb5bd;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.file-icon-link {
    display: inline-block;
    vertical-align: middle;
    line-height: 0;
}
.file-icon-link:hover .file-icon-wrapper {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Couleurs spécifiques par type */
.file-icon-pdf { /* PDF Optimisé (ou traité standard) */
    background-color: #f8d7da; /* Rouge pastel */
    color: #721c24;
    border-color: #f5c6cb;
}
.file-icon-html {
    background-color: #cce5ff; /* Bleu pastel */
    color: #004085;
    border-color: #b8daff;
}
.file-icon-default {
    background-color: #e2e3e5; /* Gris clair pastel */
    color: #383d41;
    border-color: #d6d8db;
}
.file-icon-pdf-light { /* PDF Converti (non optimisé) */
    background-color: #fdfdfe; /* Fond presque blanc */
    color: #dc3545; /* Icône rouge (danger Bootstrap) */
    border: 1px dashed #f5c6cb; /* Bordure pointillée rouge clair */
    opacity: 0.85;
}
.file-icon-link:hover .file-icon-pdf-light {
     opacity: 1;
     border-style: solid;
}

/* Colonne pour la taille du fichier */
.file-size-col {
    flex-grow: 1; /* Prend l'espace restant */
    font-size: 0.85em;
    color: #6c757d;
    white-space: nowrap;
    text-align: left;
    /* margin-left: 0.5rem; /* ms-2 ajouté dans le JS */
}

/* Responsive pour taille fichier */
@media (max-width: 767px) {
    .file-info-layout .file-size-col .fa-database {
        display: none; /* Cacher icône DB sur mobile */
    }
     .file-info-layout .file-size-col {
        min-width: 45px;
    }
}

/* Colonne Actions */
#documentsTable td.col-actions {
    width: auto !important;
    min-width: 90px;
    max-width: 130px !important;
}
.action-buttons .btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: center;
}
.action-buttons .btn:last-child {
    margin-bottom: 0;
}
.action-buttons .btn .spinner-border-sm {
    width: 0.8rem;
    height: 0.8rem;
    border-width: 0.15em;
    margin-right: 0.5rem;
}
.action-buttons .btn .fa-fw {
    vertical-align: baseline;
    line-height: 1;
    margin-right: 0.25rem;
}
.action-buttons .btn .action-label {
    display: inline-block;
    font-size: 0.9em;
    line-height: 1;
}
.file-icon-pdf-light {
  background-color: #fdfdfe;
  color: #229507;
  
/* Styles pour la Modale */
#modal-status-messages {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.85em;
    border: 1px solid #eee;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}
#modal-status-messages p {
    margin-bottom: 0.25rem !important;
    word-break: break-word;
}
#modal-process-error-message {
    font-size: 0.9em;
}
#modal-process-progress-bar {
    font-size: 0.9rem;
    font-weight: 500;
}
/* Style pour le footer de la modale (caché par défaut via JS) */
.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 0.75rem;
}

/* Styles pour les Toasts */
.toast-container {
    z-index: 1100 !important; /* Assurer au-dessus de tout */
}
.toast {
    font-size: 0.9rem;
}
.toast .toast-body .fa-fw {
    vertical-align: -0.1em; /* Ajuster alignement icône */
}

/* Pied de page */
.footer {
    font-size: 0.85rem;
    background-color: #e9ecef; /* Fond léger assorti aux en-têtes */
}