/**************************************************************
 * navigation.css
 * Page navigation / exploration
 **************************************************************/

/* =========================
   CARTE
   ========================= */

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* =========================
   TOOLBAR
   ========================= */

.map-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1200;

  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  background: rgba(25, 36, 52, 0.95);
  color: #f4f7fb;

  border: 1px solid rgba(91, 103, 128, 0.6);
  border-radius: 14px;

  padding: 10px 14px;
  font-weight: 700;

  cursor: pointer;

  backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);

  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: #2b3a52;
  transform: translateY(-1px);
}

.toolbar-btn.active {
  background: linear-gradient(135deg, #7c4dff, #9c6dff);
  border-color: transparent;
}

.toolbar-icon {
  font-size: 15px;
}

/* =========================
   PANNEAUX
   ========================= */

.map-panel {
  position: absolute;
  top: 70px;
  left: 16px;
  z-index: 1200;

  width: 320px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;

  padding: 16px;

  background: rgba(18, 28, 42, 0.96);
  color: #f4f7fb;

  border: 1px solid rgba(93, 107, 133, 0.4);
  border-radius: 16px;

  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
}

.map-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
}

/* Légende à droite */

#legendPanel {
  left: auto;
  right: 16px;
}

/* =========================
   LISTES
   ========================= */

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-btn,
.overlay-toggle-btn,
.favorite-btn {
  display: flex;
  align-items: center;
  gap: 8px;

  width: 100%;

  background: #344055;
  border: 1px solid #4d5d78;
  border-radius: 10px;

  padding: 10px;
  color: white;

  font-size: 14px;
  font-weight: 600;
  text-align: left;

  cursor: pointer;

  transition: all 0.2s ease;
}

.layer-btn:hover,
.overlay-toggle-btn:hover,
.favorite-btn:hover {
  background: #3f4d66;
  transform: translateY(-1px);
}

.layer-btn.active,
.overlay-toggle-btn.active,
.favorite-btn.active {
  background: linear-gradient(135deg, #7c4dff, #9c6dff);
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(124,77,255,0.3);
}

/* =========================
   FORM COMPARER
   ========================= */

.field.compact {
  margin-bottom: 10px;
}

.field.compact label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.field.compact select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;

  background: #344055;
  color: white;
  border: 1px solid #4b5a74;
}

/* =========================
   BOUTONS GÉNÉRIQUES
   ========================= */

.btn {
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;

  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: #8b5cf6;
  color: white;
}

.btn-secondary {
  background: #344055;
  color: white;
  border: 1px solid #4d5d78;
}

.compare-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* =========================
   ÉTAT ACTIF
   ========================= */

.active-state-panel {
  position: absolute;
  bottom: 100px;
  right: 70px; /* évite la superposition avec zoom */
  z-index: 1200;

  background: rgba(18, 28, 42, 0.95);
  color: #f4f7fb;

  border: 1px solid rgba(93, 107, 133, 0.4);
  border-radius: 12px;

  padding: 10px;

  min-width: 220px;
  max-width: 280px;

  box-shadow: 0 10px 24px rgba(0,0,0,0.3);

  font-size: 13px;
  line-height: 1.4;
}

#activeBaseLabel,
#activeOverlaysLabel {
  color: #cdb8ff;
  font-weight: 700;
}

/* =========================
   ZOOM LEAFLET
   ========================= */

.leaflet-bottom.leaflet-right {
  margin-bottom: 16px;
  margin-right: 16px;
}

.leaflet-control-zoom a {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;

  background: rgba(18, 28, 42, 0.95) !important;
  color: white !important;

  border: 1px solid #4d5d78 !important;
  border-radius: 10px !important;

  transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
  background: #8b5cf6 !important;
}

.leaflet-control-zoom-in {
  margin-bottom: 6px;
}

/* =========================
   SCROLLBAR
   ========================= */

.map-panel::-webkit-scrollbar {
  width: 8px;
}

.map-panel::-webkit-scrollbar-thumb {
  background: #8b5cf6;
  border-radius: 6px;
}

/* =========================
   SWIPE
   ========================= */

.leaflet-sbs-range {
  z-index: 1000;
  cursor: ew-resize;
}

.leaflet-sbs-divider {
  z-index: 1001;
  width: 2px;
  background: rgba(255,255,255,0.9);
}

/* =========================
   SPLIT
   ========================= */

.split-compare-container {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 900;
}

.split-map {
  width: 100%;
  height: 100%;
}

/* =========================
   UTILITAIRE
   ========================= */

.hidden {
  display: none !important;
}