/* ========================================
   CSS - MORTS POUR LA FRANCE PREMIÈRE GUERRE MONDIALE
   Version nettoyée et organisée
======================================== */

/* ========================================
   0. LICENCE SIMPLE
======================================== */

.license-simple {
  text-align: center;
  padding: 1rem;
  margin: 2rem auto;
  max-width: 800px;
  font-size: 0.9rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 8px;
}

.license-simple a {
  color: #6b7280;
  text-decoration: underline;
}

.license-simple a:hover {
  color: #374151;
}

/* ========================================
   1. LAYOUT PRINCIPAL
======================================== */

.morts-france-section {
  background: #f8fafc;
  padding: 3rem 0;
  min-height: 70vh;
}

.morts-france-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========================================
   2. SECTION INTRODUCTION
======================================== */

.intro-section {
  text-align: center;
  margin-bottom: 2rem;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.intro-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 1rem;
}

.intro-text {
  font-size: 1.1rem;
  color: #4a5568;
  line-height: 1.6;
}

.intro-text strong {
  color: #a76107;
  font-weight: 700;
}

/* ========================================
   3. FORMULAIRE DE RECHERCHE
======================================== */

.search-wrapper-14-18 {
  max-width: 1100px;
  margin: 0 auto 2rem;
}

.form-14-18 {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Lignes du formulaire */
.form-line {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  align-items: stretch;
  justify-content: center;
}

.identite-line {
  justify-content: center;
}

.dates-line {
  justify-content: center;
}

.options-line {
  justify-content: center;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.buttons-line {
  justify-content: center;
  gap: 12px;
  border-top: 1px solid #eee;
  padding-top: 16px;
  margin-top: 16px;
}

/* Groupes de dates */
.date-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-label {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  min-width: 80px;
  white-space: nowrap;
}

/* Conteneur nom avec bouton réglages */
.nom-container {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 200px;
  width: 200px;
}

/* Bouton réglages */
.btn-settings {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 3px;
  color: #666;
  transition: all 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-settings:hover {
  background: #f0f0f0;
  color: #a66107;
}

.btn-settings.active {
  color: #a66107;
  background: #FFF3E0;
}

.btn-settings.active::after {
  content: '●';
  font-size: 8px;
  color: #a66107;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* Popup recherche étendue */
.extended-search-popup {
  position: absolute;
  top: -45px;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #a66107;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
  animation: slideDown 0.2s ease-out;
}

.extended-search-popup.active {
  display: block;
}

.extended-search-popup label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #333;
  user-select: none;
}

.extended-search-popup input[type="checkbox"] {
  margin: 0;
}

/* Champs de formulaire */
.input-field {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input-field.input-nom {
  flex: 1;
  width: 100%;
}

.input-field.input-prenom {
  flex: 0 0 200px;
  width: 200px;
}

.input-field.input-small {
  flex: 0.5;
  max-width: 150px;
}

.input-field:focus {
  outline: none;
  border-color: #a66107;
  box-shadow: 0 0 0 2px rgba(167, 97, 7, 0.1);
}

.year-field {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

/* Boutons principaux */
.btn-rechercher {
  padding: 10px 24px;
  background: #a66107;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-rechercher:hover {
  background: #ca790f;
}

.btn-reset {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset:hover {
  background: #f5f5f5;
}

.btn-plus-options {
  padding: 6px 12px;
  border: 1px solid #a66107;
  background: white;
  color: #a66107;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-plus-options:hover {
  background: #a66107;
  color: white;
}

/* Lignes de filtres */
.filters-line,
.military-filters-line,
.autocomplete-filters-line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
  justify-content: center;
}

.military-filters-line,
.autocomplete-filters-line {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.autocomplete-filters-line .autocomplete-container {
  flex: 1;
  min-width: 250px;
  max-width: 280px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.filter-label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  font-weight: bold;
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  min-width: 140px;
  max-width: 180px;
  width: 180px;
}

.filter-select:focus {
  outline: none;
  border-color: #a66107;
}

.checkbox-item {
  margin-left: auto;
}

.checkbox-label {
  cursor: pointer;
  font-size: 13px;
  color: #666;
  user-select: none;
}

/* Autocomplétion */
.autocomplete-container {
  position: relative;
  flex: 1;
  max-width: 260px;
}

.autocomplete-container .input-field {
  width: 100%;
  font-size: 13px;
  padding: 6px 10px;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: white;
  border: 1px solid #a66107;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.suggestions-dropdown.active {
  display: block;
}

.suggestion-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-item:hover {
  background: #FFF3E0;
}

.suggestion-item .count {
  float: right;
  color: #999;
  font-size: 11px;
}

/* Filtre contributions */
.contributions-line {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  border-top: 1px solid #eee;
}

.contributions-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.contributions-filter-group .group-label {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  min-width: 80px;
  white-space: nowrap;
  margin-right: 10px;
}

.contributions-checkboxes {
  display: flex;
  gap: 20px;
  align-items: center;
}

.checkbox-label-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  user-select: none;
  transition: color 0.2s;
}

.checkbox-label-inline:hover {
  color: #a66107;
}

.checkbox-label-inline input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

.checkbox-label-inline span {
  font-weight: 500;
}

.contributions-help {
  color: #666;
  font-size: 12px;
  font-style: italic;
  margin-left: 15px;
}

/* Compteur */
.counter-line {
  text-align: center;
  margin: 1rem 0;
  color: #666;
  font-size: 14px;
}

.counter-line strong {
  color: #a66107;
  font-weight: 600;
}

/* ========================================
   4. SECTION RÉSULTATS
======================================== */

.results-wrapper {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0;
}

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #FFF3E0;
  border-radius: 4px 4px 0 0;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  border-bottom: none;
}

.results-count {
  color: #666;
}

.results-count strong {
  color: #a66107;
  font-weight: 600;
}

.per-page-select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  margin-left: 4px;
}

.results-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 6px 12px;
  border: 1px solid #a66107;
  background: white;
  color: #a66107;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.btn-action:hover {
  background: #a66107;
  color: white;
}

/* Tableau de résultats */
#results-table {
  background: white;
  border: 1px solid #e0e0e0;
  border-top: none;
  padding: 0;
  margin-top: 0;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

/* Largeurs des colonnes */
.results-table th:nth-child(1),
.results-table td:nth-child(1) { width: 15%; }

.results-table th:nth-child(2),
.results-table td:nth-child(2) { width: 20%; }

.results-table th:nth-child(3),
.results-table td:nth-child(3) { width: 20%; }

.results-table th:nth-child(4),
.results-table td:nth-child(4) { width: 20%; }

.results-table th:nth-child(5),
.results-table td:nth-child(5) { width: 8%; }

.results-table th:nth-child(6),
.results-table td:nth-child(6) { width: 8%; }

.results-table th:nth-child(7),
.results-table td:nth-child(7) { 
  width: 8%; 
  text-align: center;
}

.results-table th:nth-child(8),
.results-table td:nth-child(8) { width: 9%; }

/* En-têtes du tableau */
.results-table th {
  background: #f5f5f5;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
  color: #333;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.results-table th:hover {
  background: #ebebeb;
}

.results-table th.sortable::after {
  content: '↕';
  position: absolute;
  right: 8px;
  opacity: 0.3;
  font-size: 12px;
}

.results-table th.sorted-asc::after {
  content: '↑';
  opacity: 1;
  color: #a66107;
}

.results-table th.sorted-desc::after {
  content: '↓';
  opacity: 1;
  color: #a66107;
}

.results-table th:last-child {
  cursor: default;
}

.results-table th:last-child:hover {
  background: #f5f5f5;
}

/* Cellules du tableau */
.results-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  color: #555;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-table td:nth-child(3),
.results-table td:nth-child(4) {
  white-space: normal;
  word-break: break-word;
}

.results-table td small {
  display: block;
  color: #888;
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lignes alternées */
.results-table tbody tr:nth-child(odd) {
  background: #ffffff !important;
}

.results-table tbody tr:nth-child(even) {
  background: #f8f9fa !important;
}

/* Permettre la sélection de texte */
.results-table tbody tr {
  user-select: text;
}

.results-table tbody tr td {
  cursor: text;
}

.results-table tbody tr td:last-child {
  cursor: default;
}

/* Colonnes spéciales */
.col-nom {
  font-weight: 600;
  color: #333;
}

.col-grade {
  font-style: italic;
  color: #666;
}

.col-unite {
  font-size: 13px;
  color: #666;
}

.col-contributions {
  vertical-align: middle;
  padding: 8px 4px;
}

/* Badges contributions */
.contrib-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  height: 100%;
}

.badge-contrib {
  display: inline-flex;
  font-size: 14px;
  cursor: help;
  transition: transform 0.2s;
  line-height: 1;
}

.badge-contrib:hover {
  transform: scale(1.2);
}

.no-contrib {
  color: #ccc;
  font-size: 14px;
}

/* Liens et boutons dans le tableau */
.link-fiche {
  color: #a66107;
  text-decoration: none;
  font-size: 12px;
}

.link-fiche:hover {
  text-decoration: underline;
}

.btn-details {
  padding: 4px 8px;
  background: #a66107;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-details:hover {
  background: #ca790f;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  min-width: 32px;
}

.pagination button:hover:not(:disabled) {
  background: #f5f5f5;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.active {
  background: #a66107;
  color: white;
  border-color: #a66107;
  font-weight: 600;
}

.pagination-dots {
  padding: 8px 4px;
  color: #999;
  cursor: default;
}

/* Loader */
.loader {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #a66107;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

/* ========================================
   5. SECTIONS INFORMATIVES
======================================== */

.info-section,
.stats-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-top: 3rem;
}

.info-section h3,
.stats-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Section info - Pleine largeur */
.info-section .info-content {
  max-width: 100% !important;
  width: 100%;
  margin: 0;
  padding: 0;
}

.info-section .info-content h4 {
  color: #a66107;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  text-align: left;
}

.info-section .info-content h4:first-child {
  margin-top: 0;
}

.info-section .info-content ul {
  max-width: 100% !important;
  width: 100%;
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
  text-align: left;
  list-style-position: outside;
}

.info-section .info-content li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: #4a5568;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
}

.info-section .info-content li strong {
  color: #2d3748;
  font-weight: 600;
}

.info-section .info-content p {
  max-width: 100% !important;
  text-align: left;
  margin: 0 0 1rem 0;
}

/* Grille de statistiques */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #a66107, #ca790f);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(166, 97, 7, 0.15);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card[title] {
  cursor: help;
}

.stat-card[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
  font-weight: normal;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #a76107;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.stat-card:has(#stat-plus-jeune) .stat-number,
.stat-card:has(#stat-plus-age) .stat-number {
  font-size: 1.2rem;
  line-height: 1.3;
}

.stat-card:has(#stat-lieu-meurtrier) .stat-number {
  font-size: 1.5rem;
  word-break: break-word;
}

#stat-plus-jeune,
#stat-plus-age {
  font-size: 1rem !important;
}

#stat-plus-jeune span,
#stat-plus-age span {
  display: block;
  margin-top: 4px;
}

.stat-label {
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
}

.stat-detail {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

/* ========================================
   6. SECTION FAQ SEO
======================================== */

.faq-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-top: 3rem;
}

.faq-section.seo-section {
  margin-top: 3rem !important;
}

.faq-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 1.5rem;
  text-align: center;
}

.faq-section details {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.faq-section details:hover {
  border-color: #a66107;
  box-shadow: 0 2px 4px rgba(166, 97, 7, 0.1);
}

.faq-section summary {
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.faq-section summary::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s;
  color: #a66107;
}

.faq-section details[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.faq-section summary:hover {
  color: #a66107;
}

.faq-section details[open] summary {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  color: #a66107;
}

.faq-section details p {
  line-height: 1.7;
  color: #4a5568;
}

/* ========================================
   7. SECTION CONTENU SEO
======================================== */

.seo-content {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(to bottom, #ffffff, #f9f9f9);
  border-radius: 12px;
  line-height: 1.8;
  border: 1px solid #e2e8f0;
}

.seo-content h4 {
  color: #a66107;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.seo-content p {
  margin-bottom: 1rem;
  color: #4a5568;
  text-align: justify;
}

.seo-content strong {
  color: #2d3748;
  font-weight: 600;
}

.keywords-cloud {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  color: #718096;
  line-height: 1.8;
  font-size: 0.9rem;
}

.keywords-cloud small {
  display: block;
  line-height: 1.8;
}

/* ========================================
   8. MODAL ET CONTRIBUTIONS (Upload)
======================================== */

.modal-footer .btn-action {
  padding: 8px 16px;
  background: #a66107;
  color: white !important;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
}

.modal-footer .btn-action:hover,
.modal-footer a.btn-action:hover {
  background: #ca790f;
  color: white !important;
  text-decoration: none;
}

.modal-footer a.btn-action:visited {
  color: white !important;
}

.modal-footer .btn-reset {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  color: #333 !important;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-footer .btn-reset:hover {
  background: #f5f5f5;
  color: #333 !important;
}

/* Upload de fichiers */
.file-item-container {
  margin-bottom: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.file-description-individual {
  margin-top: 10px;
}

.file-description-individual textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  resize: vertical;
}

.add-more-container {
  text-align: center;
  padding: 20px;
  border: 2px dashed #a66107;
  border-radius: 8px;
  background: #fff;
  margin-top: 15px;
}

.btn-add-more {
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-add-more:hover {
  background: #218838;
}

.add-more-container small {
  display: block;
  margin-top: 8px;
  color: #666;
}

/* Barre de progression */
.btn-submit {
  position: relative;
  overflow: hidden;
  transition: none;
}

.btn-submit .progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #28a745, #34ce57);
  width: 0%;
  transition: width 0.3s ease;
  z-index: 1;
}

.btn-submit .btn-text {
  position: relative;
  z-index: 2;
  display: inline-block;
}

/* ========================================
   9. ANIMATIONS
======================================== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { 
    transform: rotate(360deg); 
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ========================================
   10. RESPONSIVE
======================================== */

@media (max-width: 768px) {

  .intro-section {
    display: none !important;
  }
  .hero-subtitle,
  .hero-content p {
    display: none !important;
  }
  
  /* Optionnel : réduire aussi la taille du titre principal */
  .hero h1 {
    font-size: 1.5rem;
  }
  
  /* Optionnel : réduire le padding du hero */
  .hero {
    padding: 1.5rem 1rem;
  }
  /* Container principal */
  .morts-france-container {
    padding: 0 0.5rem;
  }
  
  /* Formulaire */
  .form-line {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .date-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .group-label {
    min-width: auto;
    font-size: 13px;
  }
  
  .buttons-line {
    flex-direction: column;
    gap: 12px;
  }
  
  .nom-container {
    flex: none;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
  
  .nom-container .input-field.input-nom {
    width: calc(100% - 30px);
    flex: 1;
    min-width: 0;
  }
  
  .input-field.input-prenom,
  .input-field,
  .btn-rechercher {
    width: 100%;
    max-width: none;
    flex: none;
  }
  
  .filters-line,
  .military-filters-line,
  .autocomplete-filters-line {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    justify-content: stretch;
  }
  
  .filter-item {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  
  .filter-select,
  .autocomplete-container {
    width: 100%;
    max-width: none;
  }
  
  .autocomplete-container .input-field {
    width: 100%;
  }
  
  .year-field {
    width: 100%;
  }
  
  .checkbox-item {
    margin-left: 0;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  
  .btn-plus-options,
  .btn-reset {
    width: 100%;
  }
  
  .extended-search-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #a66107;
    z-index: 200;
  }
  
  /* Résultats */
  .results-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .results-actions {
    width: 100%;
  }
  
  /* Pas de scroll horizontal */
  #results-table {
    overflow-x: hidden;
  }
  
  .results-table {
    font-size: 12px;
    width: 100%;
    table-layout: fixed;
  }
  
  .results-table th,
  .results-table td {
    padding: 10px 5px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Masquer Classe, Matricule, Contributions ET Actions sur mobile */
  .results-table th:nth-child(5),  /* Classe */
  .results-table td:nth-child(5),
  .results-table th:nth-child(6),  /* Matricule */
  .results-table td:nth-child(6),
  .results-table th:nth-child(7),  /* Contributions */
  .results-table td:nth-child(7),
  .results-table th:nth-child(8),  /* Actions */
  .results-table td:nth-child(8) {
    display: none !important;
  }
  
  /* Redistribuer l'espace sur les colonnes restantes */
  .results-table th:nth-child(1),  /* Nom */
  .results-table td:nth-child(1) {
    width: 25%;
  }
  
  .results-table th:nth-child(2),  /* Prénom */
  .results-table td:nth-child(2) {
    width: 25%;
  }
  
  .results-table th:nth-child(3),  /* Naissance */
  .results-table td:nth-child(3) {
    width: 25%;
  }
  
  .results-table th:nth-child(4),  /* Décès */
  .results-table td:nth-child(4) {
    width: 25%;
  }
  
  /* Rendre les lignes cliquables sur mobile */
  .results-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .results-table tbody tr:active {
    background: #e0e0e0 !important;
  }
  
  /* Effet visuel au survol (pour les appareils qui le supportent) */
  @media (hover: hover) {
    .results-table tbody tr:hover {
      background: #f0f0f0 !important;
    }
  }
  
  /* Texte optimisé */
  .results-table td {
    font-size: 12px;
    line-height: 1.3;
  }
  
  /* Pour Naissance et Décès, permettre le retour à la ligne */
  .results-table td:nth-child(3),
  .results-table td:nth-child(4) {
    white-space: normal;
    word-break: break-word;
  }
  
  /* Réafficher les lieux maintenant qu'on a plus d'espace */
  .results-table td small {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 2px;
  }
  
  /* Simplifier le tri sur mobile */
  .results-table th.sortable::after {
    font-size: 10px;
    opacity: 0.5;
  }
  
  /* Statistiques */
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  /* Pagination */
  .pagination button {
    padding: 6px 8px;
    font-size: 12px;
    min-width: 28px;
  }
  
  /* Contributions */
  .contributions-line {
    padding: 12px 10px;
  }
  
  .contributions-filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .contributions-checkboxes {
    justify-content: space-around;
    width: 100%;
  }
  
  .contributions-help {
    margin-top: 8px;
    margin-left: 0;
    display: block;
    width: 100%;
    text-align: center;
  }
  
  .contrib-badges {
    flex-direction: column;
    gap: 2px;
  }
  
  .badge-contrib {
    font-size: 14px;
  }
  
  /* Sections informatives */
  .info-section {
    padding: 1.5rem 1rem;
  }
  
  .info-section .info-content ul {
    padding-left: 1rem;
  }
  
  .faq-section {
    padding: 1.5rem 1rem;
  }
  
  .faq-section h3 {
    font-size: 1.25rem;
  }
  
  .faq-section details {
    padding: 0.75rem;
  }
  
  .seo-content {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .intro-section {
    padding: 1.5rem 1rem;
  }
  
  .intro-section h2 {
    font-size: 1.5rem;
  }
  
  .form-14-18 {
    padding: 0.75rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}

/* ========================================
   11. ACCESSIBILITÉ
======================================== */

@media (prefers-reduced-motion: reduce) {
  .stat-card:hover {
    transform: none;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*:focus-visible {
  outline: 2px solid #a66107;
  outline-offset: 2px;
}

/* ========================================
   12. MODE SOMBRE COMPLET
======================================== */

/* Layout principal */
:root.theme-dark .morts-france-section {
  background: #0f0f0f;
}

:root.theme-dark .morts-france-container {
  color: #e0e0e0;
}

/* Section Introduction */
:root.theme-dark .intro-section {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

:root.theme-dark .intro-section h2 {
  color: #f0f0f0;
}

:root.theme-dark .intro-text {
  color: #b0b0b0;
}

:root.theme-dark .intro-text strong {
  color: #ff9d00;
}

/* Formulaire de recherche */
:root.theme-dark .form-14-18 {
  background: #1a1a1a;
  border-color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

:root.theme-dark .form-line {
  border-top-color: #333;
}

:root.theme-dark .group-label,
:root.theme-dark .filter-label {
  color: #e0e0e0;
}

:root.theme-dark .input-field,
:root.theme-dark .filter-select,
:root.theme-dark .year-field {
  background: #2a2a2a;
  border-color: #444;
  color: #fff;
}

:root.theme-dark .input-field:focus,
:root.theme-dark .filter-select:focus,
:root.theme-dark .year-field:focus {
  border-color: #ff9d00;
  box-shadow: 0 0 0 2px rgba(255, 157, 0, 0.2);
}

:root.theme-dark .input-field::placeholder {
  color: #888;
}

/* Boutons */
:root.theme-dark .btn-settings {
  color: #b0b0b0;
}

:root.theme-dark .btn-settings:hover {
  background: #333;
  color: #ff9d00;
}

:root.theme-dark .btn-settings.active {
  color: #ff9d00;
  background: #3a2a00;
}

:root.theme-dark .btn-rechercher {
  background: #ff9d00;
  color: #1a1a1a;
}

:root.theme-dark .btn-rechercher:hover {
  background: #ffb233;
}

:root.theme-dark .btn-reset {
  border-color: #444;
  background: #2a2a2a;
  color: #e0e0e0;
}

:root.theme-dark .btn-reset:hover {
  background: #333;
}

:root.theme-dark .btn-plus-options {
  border-color: #ff9d00;
  background: #1a1a1a;
  color: #ff9d00;
}

:root.theme-dark .btn-plus-options:hover {
  background: #ff9d00;
  color: #1a1a1a;
}

/* Popup recherche étendue */
:root.theme-dark .extended-search-popup {
  background: #2a2a2a;
  border-color: #ff9d00;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

:root.theme-dark .extended-search-popup label {
  color: #e0e0e0;
}

/* Autocomplétion */
:root.theme-dark .suggestions-dropdown {
  background: #2a2a2a;
  border-color: #ff9d00;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

:root.theme-dark .suggestion-item {
  border-bottom-color: #333;
  color: #e0e0e0;
}

:root.theme-dark .suggestion-item:hover {
  background: #3a2a00;
}

:root.theme-dark .suggestion-item .count {
  color: #888;
}

/* Filtre contributions */
:root.theme-dark .contributions-line {
  border-top-color: #333;
}

:root.theme-dark .checkbox-label,
:root.theme-dark .checkbox-label-inline {
  color: #b0b0b0;
}

:root.theme-dark .checkbox-label-inline:hover {
  color: #ff9d00;
}

:root.theme-dark .contributions-help {
  color: #888;
}

/* Compteur */
:root.theme-dark .counter-line {
  color: #b0b0b0;
}

:root.theme-dark .counter-line strong {
  color: #ff9d00;
}

/* Section Résultats */
:root.theme-dark .results-info {
  background: #3a2a00;
  border-color: #444;
}

:root.theme-dark .results-count {
  color: #b0b0b0;
}

:root.theme-dark .results-count strong {
  color: #ff9d00;
}

:root.theme-dark .per-page-select {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

:root.theme-dark .btn-action {
  border-color: #ff9d00;
  background: #1a1a1a;
  color: #ff9d00;
}

:root.theme-dark .btn-action:hover {
  background: #ff9d00;
  color: #1a1a1a;
}

/* Tableau */
:root.theme-dark #results-table {
  background: #1a1a1a;
  border-color: #444;
}

:root.theme-dark .results-table {
  background: #1a1a1a;
}

:root.theme-dark .results-table th {
  background: #2a2a2a;
  color: #f0f0f0;
  border-bottom-color: #444;
}

:root.theme-dark .results-table th:hover {
  background: #333;
}

:root.theme-dark .results-table th.sorted-asc::after,
:root.theme-dark .results-table th.sorted-desc::after {
  color: #ff9d00;
}

:root.theme-dark .results-table td {
  color: #ccc;
  border-bottom-color: #333;
}

:root.theme-dark .results-table td small {
  color: #888;
}

:root.theme-dark .results-table tbody tr:nth-child(odd) {
  background: #1a1a1a !important;
}

:root.theme-dark .results-table tbody tr:nth-child(even) {
  background: #222 !important;
}

:root.theme-dark .col-nom {
  color: #f0f0f0;
}

:root.theme-dark .col-grade,
:root.theme-dark .col-unite {
  color: #b0b0b0;
}

:root.theme-dark .link-fiche {
  color: #ff9d00;
}

:root.theme-dark .btn-details {
  background: #ff9d00;
  color: #1a1a1a;
}

:root.theme-dark .btn-details:hover {
  background: #ffb233;
}

:root.theme-dark .no-contrib {
  color: #555;
}

/* Pagination */
:root.theme-dark .pagination button {
  border-color: #444;
  background: #2a2a2a;
  color: #e0e0e0;
}

:root.theme-dark .pagination button:hover:not(:disabled) {
  background: #333;
}

:root.theme-dark .pagination button:disabled {
  opacity: 0.3;
}

:root.theme-dark .pagination button.active {
  background: #ff9d00;
  color: #1a1a1a;
  border-color: #ff9d00;
}

:root.theme-dark .pagination-dots {
  color: #666;
}

/* Loader */
:root.theme-dark .loader {
  color: #e0e0e0;
}

:root.theme-dark .spinner {
  border-color: #333;
  border-top-color: #ff9d00;
}

/* Sections informatives */
:root.theme-dark .info-section,
:root.theme-dark .stats-section {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

:root.theme-dark .info-section h3,
:root.theme-dark .stats-section h3 {
  color: #f0f0f0;
}

:root.theme-dark .info-section .info-content h4 {
  color: #ff9d00;
}

:root.theme-dark .info-section .info-content li {
  color: #b0b0b0;
}

:root.theme-dark .info-section .info-content li strong {
  color: #f0f0f0;
}

:root.theme-dark .info-section .info-content p {
  color: #b0b0b0;
}

/* Statistiques */
:root.theme-dark .stat-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
  border-color: #444;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

:root.theme-dark .stat-card::before {
  background: linear-gradient(90deg, #ff9d00, #ffb233);
}

:root.theme-dark .stat-card:hover {
  box-shadow: 0 8px 16px rgba(255, 157, 0, 0.2);
}

:root.theme-dark .stat-card[title]:hover::after {
  background: #f0f0f0;
  color: #1a1a1a;
}

:root.theme-dark .stat-number {
  color: #ff9d00;
}

:root.theme-dark .stat-label {
  color: #b0b0b0;
}

:root.theme-dark .stat-detail {
  color: #888;
}

/* FAQ */
:root.theme-dark .faq-section {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

:root.theme-dark .faq-section h3 {
  color: #f0f0f0;
}

:root.theme-dark .faq-section details {
  background: #222;
  border-color: #444;
}

:root.theme-dark .faq-section details:hover {
  border-color: #ff9d00;
  box-shadow: 0 2px 4px rgba(255, 157, 0, 0.2);
}

:root.theme-dark .faq-section summary {
  color: #e0e0e0;
}

:root.theme-dark .faq-section summary::before {
  color: #ff9d00;
}

:root.theme-dark .faq-section summary:hover {
  color: #ff9d00;
}

:root.theme-dark .faq-section details[open] summary {
  border-bottom-color: #444;
  color: #ff9d00;
}

:root.theme-dark .faq-section details p {
  color: #b0b0b0;
}

/* Contenu SEO */
:root.theme-dark .seo-content {
  background: linear-gradient(to bottom, #1a1a1a, #222);
  border-color: #444;
}

:root.theme-dark .seo-content h4 {
  color: #ff9d00;
}

:root.theme-dark .seo-content p {
  color: #b0b0b0;
}

:root.theme-dark .seo-content strong {
  color: #f0f0f0;
}

:root.theme-dark .keywords-cloud {
  border-top-color: #444;
  color: #888;
}

/* ========================================
   MODAL DÉTAILS - MODE SOMBRE
======================================== */

/* Modal background */
:root.theme-dark .modal-14-18 {
  background: rgba(0, 0, 0, 0.8);
}

/* Modal content */
:root.theme-dark .modal-content {
  background: #1a1a1a;
  border: 1px solid #444;
}

/* Modal header */
:root.theme-dark .modal-header {
  background: #2a2a2a;
  border-bottom-color: #444;
}

:root.theme-dark .modal-header h2 {
  color: #f0f0f0;
}

:root.theme-dark .modal-close {
  color: #b0b0b0;
}

:root.theme-dark .modal-close:hover {
  color: #ff9d00;
}

/* Modal body */
:root.theme-dark .modal-body {
  background: #1a1a1a;
  color: #e0e0e0;
}

/* Sections de détails */
:root.theme-dark .detail-section h3 {
  color: #ff9d00;
  border-bottom-color: #444;
}

:root.theme-dark .detail-label {
  color: #888;
}

:root.theme-dark .detail-value {
  color: #e0e0e0;
}

:root.theme-dark .detail-value.empty {
  color: #666;
}

/* Modal footer */
:root.theme-dark .modal-footer {
  background: #222;
  border-top-color: #444;
}

:root.theme-dark .modal-footer .btn-action {
  background: #ff9d00;
  color: #1a1a1a !important;
  border-color: #ff9d00;
}

:root.theme-dark .modal-footer .btn-action:hover {
  background: #ffb233;
  color: #1a1a1a !important;
}

:root.theme-dark .modal-footer .btn-reset {
  border-color: #444;
  background: #2a2a2a;
  color: #e0e0e0 !important;
}

:root.theme-dark .modal-footer .btn-reset:hover {
  background: #333;
  color: #e0e0e0 !important;
}

/* Section contributions dans la modal */
:root.theme-dark .contributions-section {
  background: #222;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

:root.theme-dark .contributions-tabs .tab-button {
  background: #2a2a2a;
  color: #b0b0b0;
  border: 1px solid #444;
}

:root.theme-dark .contributions-tabs .tab-button.active {
  background: #ff9d00;
  color: #1a1a1a;
  border-color: #ff9d00;
}

:root.theme-dark .contributions-tabs .tab-button:hover {
  background: #333;
  color: #e0e0e0;
}

:root.theme-dark .contribution-item {
  background: #2a2a2a;
  border: 1px solid #444;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

:root.theme-dark .contrib-text {
  color: #e0e0e0;
}

:root.theme-dark .contrib-info {
  color: #888;
}

:root.theme-dark .contribution-photo {
  background: #2a2a2a;
  border: 1px solid #444;
  padding: 8px;
  border-radius: 4px;
}

:root.theme-dark .photo-description {
  color: #b0b0b0;
}

/* ========================================
   MODAL CONTRIBUTION - MODE SOMBRE
======================================== */

:root.theme-dark .modal-contribution {
  background: rgba(0, 0, 0, 0.8);
}

:root.theme-dark .modal-contribution-content {
  background: #1a1a1a;
  border: 1px solid #444;
}

:root.theme-dark .modal-contribution-header {
  background: #2a2a2a;
  border-bottom: 2px solid #444;
  color: #f0f0f0;
}

:root.theme-dark .modal-contribution-body {
  color: #e0e0e0;
}

:root.theme-dark .contrib-soldier-info {
  background: #222;
  color: #b0b0b0;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
}

:root.theme-dark .contrib-soldier-info strong {
  color: #ff9d00;
}

:root.theme-dark .type-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #b0b0b0;
}

:root.theme-dark .type-btn:hover {
  background: #333;
  border-color: #ff9d00;
  color: #ff9d00;
}

:root.theme-dark .type-btn.active {
  background: #ff9d00;
  color: #1a1a1a;
  border-color: #ff9d00;
}

:root.theme-dark .upload-area {
  background: #222;
  border: 2px dashed #444;
  color: #b0b0b0;
}

:root.theme-dark .upload-area:hover {
  border-color: #ff9d00;
  background: #2a2a2a;
}

:root.theme-dark .upload-area.dragover {
  background: #3a2a00;
  border-color: #ff9d00;
}

:root.theme-dark .text-editor {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #e0e0e0;
}

:root.theme-dark .text-editor-toolbar button {
  background: #333;
  border: 1px solid #444;
  color: #b0b0b0;
}

:root.theme-dark .text-editor-toolbar button:hover {
  background: #444;
  color: #ff9d00;
}

:root.theme-dark .contributor-info input,
:root.theme-dark .contributor-info textarea {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #e0e0e0;
}

:root.theme-dark .contributor-info label {
  color: #b0b0b0;
}

:root.theme-dark .file-preview-item {
  background: #2a2a2a;
  border: 1px solid #444;
}

:root.theme-dark .btn-submit:disabled {
  background: #333;
  color: #666;
}

:root.theme-dark .btn-cancel {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #b0b0b0;
}

:root.theme-dark .btn-cancel:hover {
  background: #333;
}

/* Upload de fichiers - Mode sombre */
:root.theme-dark .file-item-container {
  background: #222;
  border-color: #444;
}

:root.theme-dark .file-description-individual textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

:root.theme-dark .add-more-container {
  border-color: #ff9d00;
  background: #1a1a1a;
}

:root.theme-dark .btn-add-more {
  background: #28a745;
}

:root.theme-dark .btn-add-more:hover {
  background: #34ce57;
}

:root.theme-dark .add-more-container small {
  color: #888;
}

/* Messages de contribution */
:root.theme-dark .contrib-message.success {
  background: #1a3d1a;
  color: #4ade80;
  border: 1px solid #28a745;
}

:root.theme-dark .contrib-message.error {
  background: #3d1a1a;
  color: #f87171;
  border: 1px solid #dc3545;
}

/* Focus visible en mode sombre */
:root.theme-dark *:focus-visible {
  outline-color: #ff9d00;
}