/* ================================
   GLOBAL
=============================== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

#map {
  height: 100%;
  width: 100%;
}

/* ================================
   BOUTON D’IMPORT GPX
=============================== */
#gpx-import-btn {
  position: absolute;
  top: 70px; /* juste sous le layer control */
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 2px solid #cccccc; /* bordure grise */
  background-color: #ffffff;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  z-index: 800;
}

#gpx-import-btn svg {
  width: 25px;
  height: 25px;
}

/* ================================
   FILTER PANEL (DESKTOP)
=============================== */
#filter-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1100;
}

.filter-btn {
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: var(--color);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 1;
}

.filter-btn.active {
  transform: scale(1.05);
}

.filter-btn:not(.active) {
  opacity: 0.4;
}

/* ================================
   POPUP GLOBALE (LEAFLET)
=============================== */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
}

.leaflet-popup-tip {
  display: none !important;
}

.leaflet-popup-close-button {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  color: #333 !important;
  border-radius: 50%;
  width: 32px;
  height: 32px;  
  border: none;
}

.leaflet-popup-close-button:hover {
  background: #f0f0f0 !important;
}

/* ================================
   POPUP CARD
=============================== */
.popup-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: sans-serif;
  max-width: 260px;
  max-height: 600px;      
  overflow-y: auto;
  scrollbar-color: #ccc #f9f9f9;
}

.popup-card::-webkit-scrollbar {
  width: 6px;
}

.popup-card::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.popup-card h3 {
  margin: 0 0 6px 0;
  font-size: 1.1em;
  color: #333;
  text-align: center;
}

.popup-card h3 a {
  color: #1E88E5;
  text-decoration: none;
}

.popup-card h3 a:hover {
  text-decoration: underline;
}

.popup-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin: 6px 0;
}

.popup-card p.description {
  font-size: 0.9em;
  color: #555;
  margin: 5px 0;
  text-align: center;
}

.popup-card p.uid {
  font-size: 0.8em;
  color: #888;
  text-align: center;
  margin: 5px 0;
}

.popup-card h4 {
  margin: 5px 0;        /* espace vertical autour du titre */
  padding: 5px 0;       /* petit padding interne haut/bas */
  font-size: 1em;
  font-weight: bold;
  color: #333;
  border-top: 1px solid #eee;  /* fine ligne pour séparer du contenu au-dessus */
}


/* ================================
   BOUTONS
=============================== */
.popup-card button.copy-coords-btn,
.popup-card button.submit-comment-btn {
  width: 100%;
  padding: 6px;
  margin-top: 5px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  color: white;
  transition: transform 0.1s, opacity 0.2s;
}

.popup-card button.copy-coords-btn {
  background-color: #1E88E5;
}

.popup-card button.submit-comment-btn {
  background-color: #00BFA5;
}

.popup-card button.copy-coords-btn:hover,
.popup-card button.submit-comment-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

/* ================================
   COMMENTAIRES
=============================== */
.popup-card .comments-container {
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.85em;
  border-top: 1px solid #eee;
  margin-top: 5px;
  width: 100%;
  text-align: left;
}

.popup-card .comment {
  margin-bottom: 4px;
}

.popup-card textarea.comment-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 5px;
  font-size: 0.85em;
  border-radius: 4px;
  border: 1px solid #ccc;
  resize: none; /* 🔹 non extensible */
}

/* ================================
   LAYER BUTTONS
=============================== */
.layer-btn.active {
  background: #ddd;
}

/* ================================
   MOBILE
=============================== */
@media (max-width: 600px) {
  #hamburger {
    display: block;
  }

  #filter-panel {
    display: none;
  }

  #gpx-import-btn {
    top: 70px;
    right: 10px;
    font-size: 14px;
    padding: 5px 8px;
  }

  #gpx-import-btn svg {
    width: 28px;
    height: 28px;
  }

  .popup-card {
    max-width: 90vw;
    max-height: 60vh;
  }
}
