/* ========================================================
   BCC DaiSy Design System - Map Popups & Tooltips
   ======================================================== */

/* Ensure Leaflet popup pane always sits above floating map controls (z-index 1000) */
.leaflet-pane.leaflet-popup-pane {
  z-index: 1100 !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  border: 1px solid #e9eaeb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-family: 'Montserrat', Arial, sans-serif;
}

.leaflet-popup-content {
  min-width: 240px;
  max-height: 260px;
  overflow-y: auto;
  font-family: 'Montserrat', Arial, sans-serif;
  color: #202020;
  line-height: 1.5;
  font-size: 14px;
}

.leaflet-popup-content h1 {
  color: #00491f;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 10px;
  margin-bottom: 8px;
  font-family: 'Montserrat', Arial, sans-serif;
}

.leaflet-popup-content h2 {
  color: #00491f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 6px;
  font-family: 'Montserrat', Arial, sans-serif;
}

.leaflet-popup-content p {
  color: #202020;
  font-size: 14px;
  line-height: 1.5;
  margin: 6px 0;
  font-family: 'Montserrat', Arial, sans-serif;
}

.leaflet-popup-content img {
  height: 120px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  width: 100%;
  display: block;
}

.leaflet-popup-close-button {
  color: #006f34 !important;
  font-size: 20px !important;
  padding: 6px !important;
  transition: color 0.2s ease;
}

.leaflet-popup-close-button:hover {
  color: #00491f !important;
}

.leaflet-popup button,
.leaflet-popup .popup-btn,
.leaflet-popup .btn-itinerary-action {
  font-family: var(--bcc-font-family, 'Montserrat', sans-serif) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  padding: 8px 14px !important;
  border-radius: 20px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.pill.solid-green {
  background: #00843d;
  color: #fff;
}

.search-icon {
  color: #006f34;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
}

.bar.active {
  background: #003594 !important;
}

.axis-range {
  background: #003594 !important;
}

.axis-dot {
  border-color: #003594 !important;
}

.leaflet-tooltip.custom-tooltip {
  background-color: #003594;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaflet-tooltip-top.custom-tooltip:before {
  border-top-color: #003594;
}

/* Primary Green Button (Esplora il Territorio & Aggiungi a Itinerario) */
.popup-btn:not(.popup-btn-secondary):not(.btn-itinerary-secondary),
.leaflet-popup .btn-itinerary-primary {
  background-color: var(--bcc-verde-medio, #006f34) !important;
  background-image: linear-gradient(270deg, var(--bcc-verde-b2b, #008766) 0%, var(--bcc-verde-medio, #006f34) 100%) !important;
  color: #ffffff !important;
  border: 2px solid transparent !important;
  border-radius: 20px !important;
  padding: 8px 14px !important;
  font-family: var(--bcc-font-family, 'Montserrat', sans-serif) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
}

.popup-btn:not(.popup-btn-secondary):not(.btn-itinerary-secondary):hover,
.leaflet-popup .btn-itinerary-primary:hover {
  opacity: 0.95;
  filter: brightness(0.92);
  text-decoration: underline !important;
}

/* Secondary White Button (Sito Istituzionale - DaiSy style like 'Vai a BCC Arte&Cultura') */
.popup-btn-secondary,
.leaflet-popup .btn-itinerary-secondary {
  background-color: #ffffff !important;
  background-image: none !important;
  color: var(--bcc-verde-medio, #006f34) !important;
  border: 2px solid var(--bcc-verde-medio, #006f34) !important;
  border-radius: 20px !important;
  padding: 8px 14px !important;
  font-family: var(--bcc-font-family, 'Montserrat', sans-serif) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
}

.popup-btn-secondary:hover,
.leaflet-popup .btn-itinerary-secondary:hover {
  background-color: var(--bcc-argento-digital, #e9eaeb) !important;
  border-color: var(--bcc-verde-scuro, #00491f) !important;
  color: var(--bcc-verde-scuro, #00491f) !important;
  text-decoration: underline !important;
}

/* Indicazioni Stradali Button - Conforming to DaiSy green palette */
.popup-btn-directions {
  background-color: var(--bcc-verde-medio, #006f34) !important;
  background-image: linear-gradient(270deg, var(--bcc-verde-b2b, #008766) 0%, var(--bcc-verde-medio, #006f34) 100%) !important;
  color: #ffffff !important;
  border: 2px solid transparent !important;
  border-radius: 20px !important;
  padding: 8px 14px !important;
  font-family: var(--bcc-font-family, 'Montserrat', sans-serif) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.popup-btn-directions:hover {
  opacity: 0.95;
  filter: brightness(0.92);
  text-decoration: underline !important;
}

.popup-btn-directions svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  display: inline-block;
  vertical-align: middle;
}
