/* Conteneur de la table */
.table-container {
  width: calc(100% - 20px);
  margin: 0 auto 40px auto;
  padding: 0 10px;
}

/* Titre */
h1 {
  text-align: center;
  margin: 20px 0 14px;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Filtres */
.filters-presse {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* =========================================================
   HARMONISATION DES FILTRES ET CHAMPS DE RECHERCHE
   ========================================================= */

/* Typographie des étiquettes (labels) */
.filters-presse label,
div.dt-container .dt-length label,
div.dt-container .dt-search label {
  font-weight: bold;
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  color: #1A2530; /* S'accorde avec le fond sombre des listes */
  margin-right: 5px;
}

/* Selects (Filtres presse + "Afficher X entrées") */
.filters-presse select,
div.dt-container .dt-length select {
  background-color: #1A2530 !important; /* Bleu nuit du menu */
  color: #F8F5F0 !important; /* Beige/Doré très clair */
  border: 1px solid rgba(224, 213, 193, 0.4) !important; /* Bordure dorée discrète */
  border-radius: 6px !important;
  padding: 6px 32px 6px 12px !important; /* Espace à droite pour la flèche */
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  
  /* Suppression de la petite flèche noire standard du navigateur */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Ajout d'une flèche SVG sur mesure (couleur dorée) */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0d5c1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 16px !important;
}

/* Champ de recherche libre (DataTables) */
div.dt-container .dt-search input {
  background-color: #1A2530 !important;
  color: #F8F5F0 !important;
  border: 1px solid rgba(224, 213, 193, 0.4) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important; /* Pas besoin de flèche ici */
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Effets au survol et au clic (Focus) */
.filters-presse select:hover,
div.dt-container .dt-length select:hover,
div.dt-container .dt-search input:hover,
.filters-presse select:focus,
div.dt-container .dt-length select:focus,
div.dt-container .dt-search input:focus {
  border-color: #e0d5c1 !important; /* La bordure devient dorée brillante */
  background-color: #2C3E50 !important; /* Le fond s'éclaircit un peu */
  box-shadow: 0 0 8px rgba(224, 213, 193, 0.4) !important; /* Léger halo doré */
}

/* Couleurs du menu déroulant lorsqu'il est ouvert */
.filters-presse select option,
div.dt-container .dt-length select option {
  background-color: #1A2530;
  color: #F8F5F0;
  padding: 5px;
}

/* Table DataTables */
#parutionTable {
  width: 100% !important;
  table-layout: auto;
}

/* Colonnes texte longue */
#parutionTable td:nth-child(3) {
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Boutons PDF + Transcription */
.data-btn {
  display: inline-block;
  margin: 0; /* Retire la marge asymétrique pour garantir un centrage parfait */
  padding: 4px 12px;
  border: 1px solid rgba(224, 213, 193, 0.4);
  background: #1A2530; /* Assorti au menu et aux filtres */
  color: #F8F5F0;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.data-btn:hover {
  background: #e0d5c1; /* Le fond devient doré/beige clair */
  color: #1A2530;      /* Le texte passe en bleu nuit foncé pour bien ressortir */
  border-color: #e0d5c1;
  box-shadow: 0 0 10px rgba(224, 213, 193, 0.6); /* Halo lumineux un peu plus fort */
}

/* =========================================================
   ALIGNEMENT DES COLONNES (Dates et Boutons)
   ========================================================= */
/* Colonne 1 : Date (Aligné à gauche avec un joli retrait) */
table.dataTable thead th:nth-child(1),
table.dataTable tbody td:nth-child(1) {
  text-align: left !important;
  padding-left: 15px !important;
}

/* Colonnes 4, 5, 6 : Boutons d'action (Centrés, en-tête et cellules) */
table.dataTable thead th:nth-child(4),
table.dataTable tbody td:nth-child(4),
table.dataTable thead th:nth-child(5),
table.dataTable tbody td:nth-child(5),
table.dataTable thead th:nth-child(6),
table.dataTable tbody td:nth-child(6) {
  text-align: center !important;
}

/* =========================================================
   LIGNES ALTERNÉES ET SURVOL (HOVER) DES TABLEAUX
   ========================================================= */
table.dataTable tbody tr:nth-child(even) > * {
  background-color: #f2f2f2 !important;
}

table.dataTable tbody tr:hover > * {
  background-color: #e2e8f0 !important; /* Bleu-gris très doux et élégant au survol */
  box-shadow: none !important; /* Écrase le comportement erratique par défaut de DataTables */
}

/* =========================================================
   STYLE DE LA PAGINATION (DATATABLES)
   ========================================================= */
.dt-paging, .dataTables_paginate {
  text-align: right !important;
  margin-top: 25px !important;
  padding-bottom: 25px !important;
  display: flex;
  justify-content: flex-end !important; /* Force l'alignement tout à droite */
  gap: 5px;
}

.dt-paging-button, .paginate_button {
  padding: 6px 14px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(26, 37, 48, 0.4) !important; /* Bordure bien visible (bleu nuit doux) autour de chaque bouton/chiffre */
  color: #1A2530 !important;
  background-color: #f8f9fa !important; /* Fond très légèrement teinté pour leur donner plus de corps */
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Ombre légèrement accentuée */
}

.dt-paging-button:hover, .paginate_button:hover {
  background-color: #2C3E50 !important;
  color: #ffffff !important;
  border: 1px solid #2C3E50 !important;
}

.dt-paging-button.disabled, .paginate_button.disabled {
  color: #aaa !important;
  background-color: #f9f9f9 !important;
  border-color: #e2e2e2 !important; /* Bordure très claire pour les boutons inactifs (ex: Précédent sur la page 1) */
  box-shadow: none;
  cursor: not-allowed !important;
}

/* =========================================================
   CORRECTION EXTRÊME POUR LA PAGE ACTIVE (1, 2, etc.)
   ========================================================= */
html body .dt-paging-button.current,
html body .paginate_button.current,
html body .dt-paging-button.current:hover,
html body .paginate_button.current:hover,
html body .dt-paging-button.current.disabled,
html body .paginate_button.current.disabled {
  background: #1A2530 !important; 
  background-color: #1A2530 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important; /* Force la peinture du texte en blanc quoi qu'il arrive */
  border: 1px solid #1A2530 !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
}

html body .dt-paging-button.current *,
html body .paginate_button.current * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* =========================================================
   STYLES EXTRAITS DE PARUTION.PHP ET CORRESPONDANCE.PHP
   ========================================================= */
#loading-spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #555;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 150px auto 40px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.dt-scroll-headInner {
  margin-left: 0 !important;
  padding-left: 0 !important;
}
table.dataTable thead th:first-child, table.dataTable tbody td:first-child {
  padding-left: 0 !important;
}
table.dataTable {
  margin-left: 0 !important;
  margin-right: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
table.dataTable, table.dataTable th, table.dataTable td {
  box-sizing: border-box !important;
}
.dt-scroll-head {
  position: -webkit-sticky !important;
  position: sticky !important;
  z-index: 97 !important;
  background-color: #ffffff !important;
  box-shadow: 0px 2px 5px rgba(0,0,0,0.05);
  border-bottom: none !important;
}
table.dataTable thead th, table.dataTable thead td { background-color: #ffffff !important; background-clip: padding-box; }
.dt-scroll-head table.dataTable thead th, .dt-scroll-head table.dataTable thead td { border-bottom: 1px solid rgba(0, 0, 0, 0.3) !important; }
.dt-scroll-body table.dataTable thead th, .dt-scroll-body table.dataTable thead td { border-bottom: none !important; }
.table-container > .dt-container { margin-right: -10px !important; }
