/* Zones incendiées / interdites : design liquid-glass aligné sur plf-nodepoints-ctl */

/* Conteneur div.leaflet-bar */
.leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  opacity: 1 !important;
  padding: 0 !important;
}

/* Mode clair */
body:not([data-theme="dark"]) .leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl {
  background: rgba(70, 107, 50, 0.50) !important;
  background-color: rgba(70, 107, 50, 0.50) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #ffffff !important;
}
body:not([data-theme="dark"]) .leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl:hover {
  background: rgba(90, 130, 60, 0.70) !important;
}

/* Mode sombre */
body[data-theme="dark"] .leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl {
  background: rgba(0, 0, 0, 0.28) !important;
  background-color: rgba(65, 26, 18, 0.35) !important;
  border: 1px solid rgba(200, 80, 40, 0.38) !important;
  color: #ffffff !important;
}
body[data-theme="dark"] .leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl:hover {
  background-color: rgba(85, 40, 25, 0.50) !important;
}

/* Bouton : transparent, icône rendue via ::after (mask SVG blanc) */
.leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl .plf-zones-btn {
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  position: relative !important;
  background-image: none !important;
  background-size: 0 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  background: transparent !important;
  line-height: 0 !important;
}

.leaflet-top.leaflet-right .leaflet-bar.plf-zones-ctl .plf-zones-btn::after {
  content: '\00a0';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  border: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 24px 24px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 24px 24px;
  pointer-events: none;
}

/* État actif : bordure verte comme plf-nodepoints-ctl */
.plf-zones-ctl.is-active {
  border-color: rgba(50, 122, 53, 0.55) !important;
}

/* ============================================================
   Etiquettes permanentes d'identification des zones
   ============================================================ */
.leaflet-tooltip.plf-zone-tag {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 10px;
  border: 1px solid;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.leaflet-tooltip.plf-zone-tag::before {
  display: none; /* pas de fleche */
}
.plf-zone-tag--inc {
  color: #c94f00;
  border-color: rgba(217, 83, 0, 0.60);
}
.plf-zone-tag--int {
  color: #990048;
  border-color: rgba(153, 0, 72, 0.60);
}
body[data-theme="dark"] .leaflet-tooltip.plf-zone-tag {
  background: rgba(30, 20, 16, 0.80);
}
body[data-theme="dark"] .plf-zone-tag--inc {
  color: #ffb37a;
}
body[data-theme="dark"] .plf-zone-tag--int {
  color: #ff9ac4;
}

/* ============================================================
   Modal d'info zone (clic sur un polygone)
   ============================================================ */
.plf-zone-modal {
  position: fixed;
  left: 50%;
  bottom: 10rem;
  transform: translateX(-50%);
  z-index: 4000; /* au-dessus des panes/controls Leaflet (max ~1000) */
  min-width: 220px;
  max-width: 320px;
  max-height: 40%;
  overflow-y: auto;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e4d20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(50, 122, 53, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.20);
}
.plf-zone-modal--hidden {
  display: none;
}
.plf-zone-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.plf-zone-modal__src {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.65;
}
.plf-zone-modal__close {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  color: inherit;
}
.plf-zone-modal__body a {
  color: #1e4d20;
  font-weight: 600;
}

/* Mode sombre */
body[data-theme="dark"] .plf-zone-modal {
  color: #f0e6e6;
  background: rgba(50, 22, 15, 0.85);
  border: 1px solid rgba(200, 80, 40, 0.38);
}
body[data-theme="dark"] .plf-zone-modal__body a {
  color: #ffb48a;
}
