/* Background image fixe */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -1;
}

body { 
  background: transparent; 
  padding: 20px; 
  font-family: Arial, sans-serif; 
  position: relative;
}

/* Titre - fond transparent, texte blanc gras */
h1 { 
  text-align: center; 
  margin-bottom: 30px;
  background: transparent;
  color: white;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  padding: 15px;
}

/* Container chargement fichier - transparent */
.file-container {
  background: transparent;
}

/* Boutons - sans transparence */
#settingsBtn, #reloadFileBtn, #directoryBtn {
  opacity: 1;
}

/* Barre de statut */
#statusBar {
  background: rgba(248, 249, 250, 0.9) !important;
}

/* Onglets - opacity 90% */
.nav-tabs {
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 8px 8px 0 0;
}

/* Container recherche - transparent */
.search-container {
  background: transparent;
}

/* Barre de recherche - opacity 60% */
#searchBox {
  opacity: 0.6;
}

/* Bouton clear search */
#clearSearchBtn {
  opacity: 0.8;
}

/* Zone toggle */
#toggleWrapper {
  opacity: 0.6;
}

/* Toggle Colonnes+ - reste opaque */
.form-check.form-switch {
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 10px;
  border-radius: 8px;
}

/* Tags sélectionnés */
#selectedTagsContainer {
  background: transparent;
}

/* Tableau entier - opacity 90% */
.table-wrapper {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  opacity: 80%;
}

#entriesTable {
  opacity: 1;
}

/* Header sticky */
#entriesTable thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 249, 250, 0.9);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#entriesTable thead th {
  background: rgba(248, 249, 250, 0.9);
  border-bottom: 2px solid #dee2e6;
}

/* Carte - sans transparence */
#map {
  background: rgba(255, 255, 255, 1);
}

/* Modal Réglages - sans transparence */
#settingsModal > div {
  background: rgba(255, 255, 255, 1) !important;
}

/* Footer */
footer {
  background: rgba(248, 249, 250, 0.9) !important;
}

.tag { 
  display:inline-block; 
  background:#0d6efd; 
  color:white; 
  border-radius:12px; 
  padding:2px 8px; 
  margin:2px; 
  cursor:pointer; 
  font-size:0.85rem; 
}

.tag.selected { 
  background:#ffc107; 
  color:black; 
}

.entry-row { 
  cursor:pointer; 
  transition:background 0.2s; 
}

.entry-row:hover { 
  background:#f1f1f1; 
}

.entry-row.updated {
  animation: highlight 1s ease;
}

@keyframes highlight {
  0% { background-color: #ffffcc; }
  100% { background-color: transparent; }
}

.thumbnail { 
  width:80px; 
  height:80px; 
  object-fit:cover; 
  margin:5px; 
  border-radius:6px; 
  cursor:pointer; 
  transition:transform 0.2s; 
}

.thumbnail:hover { 
  transform:scale(1.05); 
}

#lightbox { 
  position:fixed; 
  top:0; 
  left:0; 
  width:100%; 
  height:100%; 
  background:rgba(0,0,0,0.9); 
  display:none; 
  justify-content:center; 
  align-items:center; 
  z-index:1000; 
  flex-direction:column; 
}

#lightbox img { 
  max-width:90%; 
  max-height:80%; 
  margin-bottom:10px; 
  border-radius:6px; 
}

#lightbox span { 
  position:absolute; 
  top:20px; 
  right:30px; 
  font-size:2rem; 
  color:white; 
  cursor:pointer; 
}

#lightbox .nav { 
  font-size:2rem; 
  color:white; 
  cursor:pointer; 
  position:absolute; 
  top:50%; 
  transform:translateY(-50%); 
  user-select:none; 
}

#lightbox .prev { 
  left:20px; 
}

#lightbox .next { 
  right:20px; 
}

th { 
  cursor:pointer; 
  user-select:none; 
}

.map-btn { 
  margin-right:5px; 
  font-size:1rem; 
  text-decoration:none; 
  padding:2px 6px; 
  border-radius:4px; 
  color:white; 
}

.map-btn.google { 
  background:#4285F4; 
}

.map-btn.geoportail { 
  background:#34A853; 
}

.hidden { 
  display: none; 
}

.form-check.form-switch { 
  min-width:70px; 
}

.label-icon { 
  cursor:pointer; 
  margin-left:5px; 
}

.localisation-link { 
  cursor: pointer; 
  color: #0d6efd; 
  text-decoration: underline; 
}

/* Tabs */
.nav-tabs { 
  border-bottom: 2px solid #dee2e6; 
}

.nav-tabs .nav-link { 
  color: #495057; 
  border: none; 
  padding: 10px 20px; 
  cursor: pointer; 
  background: transparent; 
}

.nav-tabs .nav-link.active { 
  color: #0d6efd; 
  border-bottom: 3px solid #0d6efd; 
  font-weight: bold; 
}

.nav-tabs .nav-link:hover { 
  color: #0d6efd; 
}

.tab-content { 
  display: none; 
  margin-top: 20px; 
}

.tab-content.active { 
  display: block; 
}

/* Map */
#map { 
  height: 600px; 
  border-radius: 8px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

.leaflet-popup-content { 
  min-width: 200px; 
}

.leaflet-popup-content img { 
  width: 100%; 
  max-height: 150px; 
  object-fit: cover; 
  border-radius: 4px; 
  margin-bottom: 8px; 
}

.leaflet-popup-content h6 { 
  margin: 0 0 5px 0; 
  font-weight: bold; 
}

.leaflet-popup-content p { 
  margin: 3px 0; 
  font-size: 0.9rem; 
}

.leaflet-popup-content .popup-tags { 
  margin-top: 8px; 
}

.leaflet-popup-content .popup-tags .tag { 
  font-size: 0.75rem; 
  padding: 1px 6px; 
}

/* Table scrolling and column sizing */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  max-height: calc(100vh - 280px);
  position: relative;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

#entriesTable {
  table-layout: fixed;
  width: auto;
  min-width: 100%;
  margin-bottom: 0;
}

#entriesTable thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 249, 250, 0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#entriesTable thead th {
  background: rgba(248, 249, 250, 0.95);
  border-bottom: 2px solid #dee2e6;
}

/* Core columns - fixed widths */
#entriesTable th[data-col="expand"],
#entriesTable td:nth-child(1) {
  width: 50px;
  min-width: 50px;
}

#entriesTable th[data-col="ref"],
#entriesTable td:nth-child(2) {
  width: 120px;
  min-width: 120px;
}

#entriesTable th[data-col="nom"],
#entriesTable td:nth-child(3) {
  width: 150px;
  min-width: 150px;
}

#entriesTable th[data-col="localisation"],
#entriesTable td:nth-child(4) {
  width: 200px;
  min-width: 200px;
}

#entriesTable th[data-col="lat"],
#entriesTable td:nth-child(5) {
  width: 100px;
  min-width: 100px;
}

#entriesTable th[data-col="lon"],
#entriesTable td:nth-child(6) {
  width: 100px;
  min-width: 100px;
}

#entriesTable th[data-col="tags"],
#entriesTable td:nth-child(7) {
  width: 200px;
  min-width: 200px;
}

#entriesTable th[data-col="map"],
#entriesTable td:nth-child(8) {
  width: 100px;
  min-width: 100px;
}

/* Extra columns */
.extra-col {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Core columns text handling */
#entriesTable th:not(.extra-col),
#entriesTable td:not(.extra-col) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal Réglages */
#settingsModal > div {
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Detail row - only spans core columns */
.detail-row td {
  white-space: normal !important;
  overflow: visible !important;
}