 #map {
   position: absolute;
   left: 0%;
   width: 100%;
   height: 100%;
   border-style: solid;
   border-color: black;
   border-width: thin;
   z-index: 0;

 }

 /* Panels wrapper container - aligns all side panels */
 .panels-wrapper {
   position: fixed;
   top: 0;
   right: 0;
   width: auto;
   height: 100%;
   pointer-events: none;
   z-index: 1000;
 }

 .panels-wrapper > * {
   pointer-events: auto;
 }

 /* Align all side panels to the right with consistent spacing */
 .cbc-panel,
 .timeline,
 .leaflet-control-geocoder-form,
 .social-extra-buttons,
 
 #info-panel {
    height: fit-content;
    /* position: relative !important; */
    z-index: 1000 !important;
    width: fit-content;
    max-width: 560px;
    margin: 5px;
    margin-block: 0px;
    padding: 16px;
 }

 /* Ensure geocoder control stays aligned */
 .leaflet-control-geocoder {
   right: auto;
 }

 #layer {
   position: relative;
   width: 70%;
 }

 #attributes {
   position: relative;
   width: 70%;
 }

 #operator {
   position: relative;
   width: 70%;
 }

 #value {
   position: relative;
   width: 70%;
 }

 #table_data {
   position: absolute;
   bottom: 0%;
   overflow: scroll;
   left: 0%;
   right: 0%;
   height: 0%;
   border: 1px solid #4CAF50;
 }

 #table {
   white-space: nowrap;
   grid-template-areas: "head-fixed" "body-scrollable";
 }


 #table th {
   position: -webkit-sticky;
   /* for Safari */
   position: sticky;
   top: 0px;
   background-color: rgb(122, 209, 100);
 }

 #wms_layers_btn {
   position: absolute;
   z-index: 600;
   top: 1%;
   left: 30%;
 }

 #query_panel_btn {
   position: absolute;
   z-index: 600;
   top: 1%;
   left: 10%;
 }

 #legendHS_btn {
   position: absolute;
   z-index: 600;
   bottom: 3%;
   right: 0%;
 }

 #table_wms_layers {
   white-space: nowrap;
   grid-template-areas: "head-fixed" "body-scrollable";
 }

 #table_wms_layers th {
   position: -webkit-sticky;
   /* for Safari */
   position: sticky;
   top: 0px;
   background-color: rgb(122, 209, 100);
 }

 .modal-dialog {
   max-width: 60% !important;
   height: 60% !important;
   top: 18% !important;


 }

 .form-select {
   left: 0%;
   width: 85% !important;

 }

 .form-control {
   left: 0%;
   width: 85% !important;

 }

 .leaflet-popup-content {
   width: auto !important;
 }

 #clear_btn {
   position: absolute;
   z-index: 500;
   top: 1%;
   left: 50%;

 }

 #info_btn {
   position: absolute;
   z-index: 500;
   top: 1%;
   left: 80%;

 }

 .container {
    width: 100%; /* Full width of the parent */
    max-width: 800px; /* Optional: set a max width */
    margin: 0 auto; /* Center align */
}

.row {
    display: flex; /* Use flexbox to arrange columns horizontally */
}

.column {
    flex: 1; /* Each column takes an equal share of the row */
    padding: 10px; /* Add padding as needed */
}

.single-column {
    width: 100%; /* Full width for the single column */
    padding: 10px; /* Add padding as needed */
}

.responsive {
    width: 100%; /* Makes the image responsive */
    height: auto; /* Maintain aspect ratio */
}

.menuPanel-inner
{ zoom:60%;}

.menuPanel {
  position: fixed;
  /* Makes the panel float on the page */
  top: 10px;
  /* Distance from the top */
  left: 10px;
  /* Distance from the left */
  width: auto;
  /* Set a width for your panel */
  background-color: transparent;
  /* White background with transparency */
  border: 0px solid #ccc;
  /* Optional border */
  border-radius: 5px;
  /* Optional rounded corners */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  /* Optional shadow for a subtle effect */
  padding: 10px;
  /* Padding inside the panel */
  z-index: 1000;
  /* Ensures it stays on top of other elements */
  opacity: 0.9;
  pointer-events: auto;
}

.bold {
  font-weight: bold;
  color: rgb(0, 0, 0);
  font-size: small;
}

/* legend temperatures */
.legendHS
{
    width: fit-content;
    height: 280px;
    position: fixed;
    /* Makes the panel float on the page */
    bottom: 10px;
    /* Distance from the top */
    /* right: 10px; */
    /* Set a width for your panel */
    background-color: rgba(255, 255, 255, 0.8);
    /* White background with transparency */
    border: 1px solid #e5e5e5;
    /* Optional border */
    border-radius: 10px;
    /* Optional rounded corners */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    /* Optional shadow for a subtle effect */
    padding: 10px;
    /* Padding inside the panel */
    z-index: 1000;
    /* Ensures it stays on top of other elements */
    opacity: 0.9;
    pointer-events: auto;
    zoom: var(--panel-zoom);
  }

.legendPop {
  width: fit-content;
  position: fixed;
  bottom: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 15px 21px;
  z-index: 1000;
  opacity: 0.95;
  pointer-events: auto;
  zoom: var(--panel-zoom);
  display: none;
}

#legendPop {
  font-family: Arial, sans-serif;
}

#legendPop h5 {
  margin: 0 0 12px 0;
  font-size: 19px;
  font-weight: 600;
}

#legendPop ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#legendPop li {
  margin: 7px 0;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.legendShadow {
  width: fit-content;
  min-width: 450px;
  position: fixed;
  bottom: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 15px 21px;
  z-index: 1000;
  opacity: 0.95;
  pointer-events: auto;
  zoom: var(--panel-zoom);
  display: none;
}

#legendShadow {
  font-family: Arial, sans-serif;
}

#legendShadow h5 {
  margin: 0 0 12px 0;
  font-size: 19px;
  font-weight: 600;
}

#legendShadow ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#legendShadow li {
  margin: 7px 0;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.shadow-quant-cell {
  cursor: pointer;
  transition: transform 0.15s ease, border 0.15s ease;
}

#legendHS {
  padding: 10px;
  font-family: Arial, sans-serif;
}

#legendHS h3 {
  margin: 0 0 10px 0;
}

#legendHS ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#legendHS li {
  margin: 5px 0;
  display: flex;
  align-items: center;
}

.color-box {
  white-space: nowrap;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border: 1px solid #000;
}

.temperature-chart {
  width: 380px! important;
  height: 255px! important;
}

#legendTM 
#legendRoutes
{
  left: 430px!important;
  height: auto!important;
}
.routingAnalysis
{
  background-color: rgba(255, 255, 255, 0.8);
}
#legendTMMulti
{
  left: 460px!important;
  height: auto!important;
}

.routing-panel input {
  padding: 4px;
}

.legendRoutes
{
  display: block;
  position: fixed;
  bottom: 10px !important;
  left: 430px !important;
  transform: translateX(-50%);
  width: 250px !important;
  /* Set a width for your panel */
  background-color: rgba(255, 255, 255, 0.8);
  /* White background with transparency */
  border: 0px solid #ccc;
  /* Optional border */
  border-radius: 5px;
  /* Optional rounded corners */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  /* Optional shadow for a subtle effect */
  padding: 10px;
  /* Padding inside the panel */
  z-index: 1000;
  /* Ensures it stays on top of other elements */
  opacity: 0.9;
  pointer-events: auto;
  z-index: 9999;
  min-height: 235px !important;
 }


/* legend temperatures */
.legendTM.legendTMClassify
{
    white-space: nowrap;
    position: fixed;
    bottom: 10px !important;
    left: 350px !important;
    height: auto;
    width: 320px;
    /* Set a width for your panel */
    background-color: rgba(255, 255, 255, 0.8);
    /* White background with transparency */
    border: 0px solid #ccc;
    /* Optional border */
    border-radius: 5px;
    /* Optional rounded corners */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* Optional shadow for a subtle effect */
    padding: 10px;
    /* Padding inside the panel */
    z-index: 1000;
    /* Ensures it stays on top of other elements */
    opacity: 0.9;
    pointer-events: auto;
    zoom: var(--panel-zoom);
  }

.legendTM {
  white-space: nowrap;
  position: relative;
  bottom: 270px!important;
  left: 0px !important;
  height: auto;
  width: auto;
  /* Modern clean white background */
  background-color: #ffffff;
  /* Remove transparency - solid white */
  opacity: 1;
  /* Subtle shadow for depth */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  /* Smooth rounded corners */
  border-radius: 8px;
  /* Clean white border */
  border: 1px solid #f0f0f0;
  /* Adequate padding */
  padding: 20px;
  /* Modern font styling */
  font-family: 'Montserrat', sans-serif;
  z-index: 1000;
  /* Ensures it stays on top of other elements */
  pointer-events: auto;
}

.legendSocioDem {
    display: block;
    position: fixed;
    top: 150px;
    left: 10px;
    transform: translateX(-50%);
    z-index: 9999;
  }

  #temperatureLegendChartTypical {
  padding-top: 0px;
  }

/* legend temperatures */
.legendTMMulti {
  position: relative;
  /* Makes the panel float on the page */
  bottom: 320px !important;
  left: 0px !important;
  /* height: 285px !important; */
  /* Distance from the left */
  width: auto;
  /* Modern clean white background */
  background-color: #ffffff;
  /* Remove transparency - solid white */
  opacity: 1;
  /* Subtle shadow for depth */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  /* Smooth rounded corners */
  border-radius: 8px;
  /* Clean white border */
  border: 1px solid #f0f0f0;
  /* Adequate padding */
  padding: 20px;
  /* Modern font styling */
  font-family: 'Montserrat', sans-serif;
  z-index: 1000;
  /* Ensures it stays on top of other elements */
  pointer-events: auto;
  zoom: var(--panel-zoom);
}

#temperatureLegend {
  position: relative;
  /* width: 500px; */
  background-color: #ffffff;
  opacity: 1;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  padding: 15px;
  font-family: 'Montserrat', sans-serif;
  zoom: var(--panel-zoom);
}

.unified-panel #temperatureLegend {
  width: 100%;
  max-width: none;
  padding: 12px;
}

#temperatureLegendChart {
  padding: 10px;
  width: 400px;
}

#temperatureLegendChartHot,
#temperatureLegendChartTypical {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  padding: 15px;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 12px;
}

.unified-panel #temperatureLegendChartHot,
.unified-panel #temperatureLegendChartTypical {
  width: 100%;
  max-width: none;
}

#temperatureLegend h3 {
  margin: 0 0 10px 0;
  color: #333;
}

.temperature-day-title {
  display: inline-block;
  margin: 8px 0 10px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: #2c3e50;
}

.temperature-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 0;
  padding: 5px;
  width: 100%;
  height: 24px;
}

.temperature-value.hot {
  background-color: #b00000;
}

.temperature-item.average {
  background-color: #FFA500;
}

.temperature-item.typical {
  background-color: #FFD700;
  /* Gold */
}

.hot {
  color: #FF0000;
}
.normal {
  color: rgb(0, 0, 0);
}

.bold {
  font-weight: bold;
}

.temperature-value {
  font-weight: bold;
  width: 100px;
}

.temperature-label {
  white-space: nowrap;
  width: 50px;
  background-color: transparent;
}
.temperature-labelT {
  text-align: right;
  white-space: nowrap;
  width: 50px;
  background-color: transparent;
}

.temperature-space {
  max-width: 5px;
}
.temperature-labelTBold {
  text-align: right;
  white-space: nowrap;
  font-weight: bold;
  width: 50px;
  background-color: transparent;
}

/* Satellite layer grayscale when shadow analysis is active */
.satellite-grayscale {
  filter: grayscale(100%);
  transition: filter 0.4s ease;
}

.temperature-bar {
    padding: 0.01em 5px!important;
    width: 30%;
    height: 24px;
    white-space: nowrap;
    display: flex;
    justify-content: flex-start;
    /* align horizontally to the left */
    align-items: center;
    /* vertically center the content */
    height: 100px;
    /* or your desired height */
    width: 200px;
    /* or your desired width */
    /* border: 1px solid #000; */
    /* optional, for visualization */
    font-weight: 600!important;
      text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.7),
        0 0 4px rgba(0, 0, 0, 0.5)!important;
  }


.highlighted-date {
  color: orange;
  /* Highlight date */
  font-weight: bold;
}

#temperatureLegend .temperature-item {
  display: flex;
  width: 100%;
  margin-bottom: 8px;
  /* optional: space between rows */
}

/* Set column widths for each span based on position */
#temperatureLegend .temperature-item span:nth-child(1) {
  width: 10%;
  text-align: left;
}

#temperatureLegend .temperature-item span:nth-child(2) {
  width: 50%;
  text-align: center;
}

#temperatureLegend .temperature-item span:nth-child(3) {
  width: 40%;
  text-align: right;
}


.rowLegend {
  display: flex;
  width: 100%;
  /* or fixed width if preferred */
  align-items: center;
  height: 50px;
  /* or your desired height */
  border: 1px solid #000;
  /* optional border for clarity */
}

/* Column 1: small font */
.column.temp {
  max-width: 10px;
  font-size: smaller;
  text-align: left;
  padding-left: 5px;
}

/* Column 2: background fill based on percentage -- set via inline style or class */
.column.fill {
  width: 100%;
  /* default, will override inline style */
  height: 20px;
  /* height of the background bar */
  background-color: #4CAF50;
  /* fill color */
  transition: width 0.5s ease;
  /* smooth fill transition */
  margin: 0 10px;
}

/* Column 3: label aligned right */
.column.label {
  width: 100%;
  text-align: right;
  padding-right: 5px;
  font-weight: bold;
}


/* Modal overlay */
.modal {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  isolation: isolate;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

/* Modal box */
.modal-content {
  position: relative;
  z-index: 1;
  width: calc(100% - 32px);
  max-width: 320px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.messageModal {
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  margin: 0 0 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-close-button {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
}

.modal-close-button:hover {
  background: #cbd5e1;
}

/* Styles for the image and bar graph */
.ClassificationPanel {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-width: none;
  height: auto;
  background-color: #ffffff;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  padding: 8px;
  font-family: 'Montserrat', sans-serif;
  z-index: 1000;
  pointer-events: auto;
  zoom: 100%;
  overflow: visible;
}
.ClassificationPanel .image-container {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  gap: 10px;
  position: relative;
}

.ClassificationPanel .classification-zoom-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: zoom-in;
  z-index: 2;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ClassificationPanel .classification-zoom-hint.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.ClassificationPanel .classification-zoom-hint-arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid #1d4ed8;
  border-bottom: 2px solid #1d4ed8;
  transform: rotate(-45deg);
  animation: classify-hint-arrow-pulse 0.9s ease-in-out infinite;
}

@keyframes classify-hint-arrow-pulse {
  0% {
    transform: translateX(-4px) rotate(-45deg);
    opacity: 0.35;
  }
  50% {
    transform: translateX(2px) rotate(-45deg);
    opacity: 1;
  }
  100% {
    transform: translateX(8px) rotate(-45deg);
    opacity: 0.35;
  }
}

.ClassificationPanel .image-container img {
  margin-bottom: 0;
  width: calc(50% - 5px);
  max-width: calc(50% - 5px);
  height: auto;
}

.ClassificationPanel .image-container img.classification-zoomable-image {
  cursor: zoom-in;
}

.classification-image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 24px;
}

.classification-image-lightbox-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
  max-width: 96vw;
  /* flex: 1 1 auto; */
  min-height: 0;
}

.classification-image-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 96vw;
  height: 94vh;
  overflow: hidden;
  transform: scale(1.2);
  transform-origin: center center;
}

.classification-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.classification-lightbox-close:hover {
  background: rgba(255, 0, 0, 0.7);
}

.classification-lightbox-title {
  color: #fff;
  font-size: 1.3em;
  font-weight: 600;
  text-align: center;
  margin: 0;
  flex-shrink: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.classification-lightbox-chart {
  flex: 0 1 auto;
  max-width: min(84vw, 960px);
  min-height: 0;
}

.classification-lightbox-chart img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.classification-image-lightbox img {
  max-width: min(55vw, 1080px);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.ClassificationPanel #classifyChart {
  width: 100% !important;
  max-width: clamp(180px, 30vh, 280px);
  height: auto !important;
  display: block;
  margin: 0 auto;
}

.bar-graph {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 300px;
  margin-bottom: 10px;
}

.bar {
  width: 20px;
  height: 100px;
  display: inline-block;
}

.bar.red {
  background-color: red;
}

.bar.green {
  background-color: limegreen;
}

.bar.blue {
  background-color: deepskyblue;
}

.bar.yellow {
  background-color: yellow;
}

.bar.gray {
  background-color: gray;
}

.label {
  text-align: center;
  font-size: 14px;
  margin-top: 5px;
}

/* Style the main container */
.custom-base-control {
  position: fixed;
  bottom: 20px;
  right: 8px;
  background: #fff;
  padding: 8px;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
}

/* Style each checkbox-label pair in a row */
.custom-base-control .checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

/* Add spacing between checkbox and label */
.custom-base-control input[type="checkbox"] {
  margin-right: 8px;
}

/* Style the label to stay inline */
.custom-base-control label {
  cursor: pointer;
  margin: 0;
  /* optional reset */
}

.wait-socioDemTemp {
  position: absolute;
  top: 110px;
  left: 170px;
  z-index: 99;
}

.wait-socioDemStat {
  position: absolute;
  top: 420px;
  left: 170px;
  z-index: 99;
}

.wait-socioDemAvg {
  position: absolute;
  top: 710px;
  left: 170px;
  z-index: 99;
}

.socioDemTempOverlay{ 
  position: absolute;
  top: 45px;    
  left: 5px;
  width: 490px;
  height: 255px;
  background: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
  display: block;
  z-index: 10;
}

.socioDemStatOverlay {
  position: absolute;
  top: 45px;
  left: 5px;
  width: 490px;
  height: 255px;
  background: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
  display: block;
  z-index: 10;
}

.socioDemTAvgOverlay {
  position: absolute;
  top: 45px;
  left: 5px;
  width: 490px;
  height: 255px;
  background: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
  display: block;
  z-index: 10;
}

.mouse-tooltip {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
}

.area-label-tooltip {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  box-shadow: none;
  font-weight: bold;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #222;
  white-space: nowrap;
  pointer-events: none;
}
.area-label-tooltip::before {
  display: none;
}

.legendClassify
{
  transform: translateX(-50%);
  z-index: 9999;
  position: fixed;
  bottom: 10px;
  left: 100px;
  width: 150px;
  /* Modern clean white background */
  background-color: #ffffff;
  /* Remove transparency - solid white */
  opacity: 1;
  /* Subtle shadow for depth */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  /* Smooth rounded corners */
  border-radius: 8px;
  /* Clean white border */
  border: 1px solid #f0f0f0;
  /* Adequate padding */
  padding: 20px;
  /* Modern font styling */
  font-family: 'Montserrat', sans-serif;
  z-index: 1000;
}

.messageModal {
  font-size: x-large;;
}

.play-btn {
  cursor: pointer;
  width: 32px;
  height: 32px;
  vertical-align: middle;
}

.play-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 0 6px rgba(0, 123, 255, 0.35));
  transition: .18s;
}

/* stato base del ring (vuoto) */
.progress-ring {
  stroke-dasharray: 63;
  /* approx 2πr where r=10 -> 62.8 */
  stroke-dashoffset: 63;
  /* start = empty */
}

/* classe che fa partire il disegno in 5s */
.animate-ring {
  animation: drawRing 5s linear forwards;
}

@keyframes drawRing {
  from {
    stroke-dashoffset: 63;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.socioDemPanel-container {
  position: fixed;
  bottom: 10px;
  left: 11px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  z-index: 1000;
  zoom: var(--panel-zoom);
  /* Modern clean white background */
  background-color: transparent;
  /* Remove transparency - solid white */
  opacity: 1;
  /* Subtle shadow for depth */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  /* Smooth rounded corners */
  border-radius: 8px;
  /* Clean white border */
  border: 0px solid #f0f0f0;
  /* Adequate padding */
  padding: 20px;
  /* Modern font styling */
  font-family: 'Montserrat', sans-serif;
}

.socioDemPanel {
  position: relative;
  width: 500px;
  /* Modern clean white background */
  background-color: #ffffff;
  /* Remove transparency - solid white */
  opacity: 1;
  /* Smooth rounded corners */
  border-radius: 8px;
  /* Subtle inner shadow for depth */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  /* Clean divider border */
  border: 1px solid #e5e5e5;
  /* Adequate padding */
  padding: 15px;
}

.socioDemPanel canvas {
  width: 100%;
  height: auto;
}

#socioDemPanel {
  padding: 10px;
  width: 400px;
  font-family: Arial, sans-serif;
}

/*small*/
@media (max-height: 100px) {
  .socioDemPanel-container {
    position: fixed;
    top: auto !important;
    /* 🔴 ANNULLA TOP */
    bottom: 0px !important;
    /* 🔴 FORZA IL BASSO */
    left: 0;
    /* width: 365px!important; */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    padding: 5px 10px;
    background: transparent;
    z-index: 9999;
  }

  .socioDemPanel {
    flex: 1;
    /* width: auto; */
    min-width: 0;
    /* height: auto; */
  }

  h4 {
    font-size: 13px;
    margin: 4px 0;
    text-align: center;
  }

  /* canvas {
    width: auto !important;
    height: auto !important;
  } */

  .legendSocioDem {
    display: block;
    position: fixed;
    top: 150px;
    left: 10px;
    transform: none;
    z-index: 9999;
    }

  .wait-socioDemStat {
    position: absolute;
    top: 20px;
    left: 100px;
    z-index: 99;
  }

  .wait-socioDemTemp {
    position: absolute;
    top: 20px;
    left: 100px;
    z-index: 99;
  }

  .wait-socioDemAvg {
    position: absolute;
    top: 20px;
    left: 100px;
    z-index: 99;
  }

  .socioDemTempOverlay {
position: absolute;
  top: auto;
  left: 5px;
  width: 310px;
  height: 150px;
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  display: block;
  z-index: 10;
  bottom: 10px;
  }

  .socioDemStatOverlay {
position: absolute;
  top: auto;
  left: 5px;
  width: 310px;
  height: 150px;
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  display: block;
  z-index: 10;
  bottom: 10px;
  }

  .socioDemTAvgOverlay {
position: absolute;
  top: auto;
  left: 5px;
  width: 310px;
  height: 150px;
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  display: block;
  z-index: 10;
  bottom: 10px;
  }

}

/*BIG*/
@media (min-height: 836px) {

#socioDemTAvg {
  width: 480px !important;
}

#socioDemStat {
  width: 480px !important;
}

#socioDemTemp {
  width: 480px !important;
}

.wait-socioDemStat {
  position: absolute;
  top: 100px;
  left: 190px;
  z-index: 99;
}

.wait-socioDemTemp {
  position: absolute;
  top: 100px;
  left: 190px;
  z-index: 99;
}

.wait-socioDemAvg {
  position: absolute;
  top: 100px;
  left: 190px;
  z-index: 99;
}

.socioDemTempOverlay {
  position: absolute;
  top: 45px;
  left: 5px;
  width: 480px;
  height: 250px;
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  display: block;
  z-index: 10;
  }

.socioDemStatOverlay {
  position: absolute;
  top: 45px;
  left: 5px;
  width: 480px;
  height: 250px;
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  display: block;
  z-index: 10;
  }

.socioDemTAvgOverlay  {
  position: absolute;
  top: 45px;
  left: 5px;
  width: 480px;
  height: 250px;
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  display: block;
  z-index: 10;
  }
}

.loading {
  position: fixed;
  /* Position it relative to the viewport */
  top: 0;
  /* Align to the top */
  left: 0;
  /* Align to the left */
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  background-color: rgba(255, 255, 255, 0.8);
  /* Semi-transparent background */
  /* Use Flexbox for centering */
  justify-content: center;
  /* Center horizontally */
  align-items: center;
  /* Center vertically */
  z-index: 1000;
  /* Ensure it is above other content */
  display: none;
}

.leaflet-bar a {
  width: 40px!important;
  height: 40px!important;
  line-height: 40px!important;
}

/* CONTENITORE CONTROLLO */
.leaflet-control-geocoder.leaflet-bar {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  border: 0;
}

/* BOTTONE GEOCODER */
.leaflet-control-geocoder .leaflet-control-geocoder-icon {
  display: none !important;
}

/* ALLINEAMENTO CON ALTRI CONTROLLI */
.leaflet-control-geocoder button {
  width: 40px;
  height: 40px;
}

/* INPUT SEARCH (quando aperto) */
.leaflet-control-geocoder .leaflet-control-geocoder-form {
  display: none;
}

.leaflet-control-geocoder.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
  display: inline-block !important;
}

.leaflet-control-geocoder-form input {
  height: 40px;
  width: 246px;
  font-size: 16px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px 0 0 12px;
  background: transparent;
}

/* RIMUOVE STILI CHE BLOCCANO IL RESIZE */
.leaflet-control-geocoder-icon::before {
  display: none;
}

/*-----------------*/
/* ============================= */
/* CONTAINER BASE (40x40)        */
/* ============================= */
.custom-base-control {
  position: relative;
  /* 🔑 riferimento per il panel */
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  padding: 0;
  margin: 0;
  bottom: 0px;
  right: 0px;
}

/* ============================= */
/* TOGGLE BUTTON                 */
/* ============================= */
.custom-base-control .cbc-toggle {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0px;
  margin: 8px;

  border: none;
  background: transparent!important;
  cursor: pointer;
}

.custom-base-control.open .cbc-toggle {
  color: #0078ff;
}

/* ============================= */
/* PANEL (CHIUSO)                */
/* ============================= */
.custom-base-control .cbc-panel {
  position: absolute;
  top: 0;
  right: 40px;
  /* 🔑 si apre a SINISTRA */

  display: none;
  min-width: 206px;
  padding: 10px;

  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);

  z-index: 1000;
}

/* ============================= */
/* PANEL (APERTO)                */
/* ============================= */
.custom-base-control.open .cbc-panel {
  display: block;
}

.legend-hs {
  font-size: 13px;
}

.legend-hs h3 {
  margin: 0 0 6px;
  /* font-size: 18px; */
}

.legend-hs table {
  border-collapse: collapse;
}

.legend-hs td {
  padding: 3px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.legend-hs .range {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.legend-hs .color-box {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1px solid #444;
}


.legend-shared {
  display: flex;
  row-gap: 2px  ;
  column-gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 8px;
  max-width: none;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}

.legend-label {
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* =============clock================ */

.timeline {
  position: relative;
  background-color: #f0f0f0;
  /* Optional: colore di sfondo */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 3px;
  z-index: 1000;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.timeline a {
  color: #0056b3 !important;
  font-size: normal !important;
}

.timeline a:hover {
  color: #011427 !important;
  font-size: medium !important;
}

.timelineSelected {
  font-weight: bold;
  color: rgb(0, 0, 0);
  font-size: medium !important;
}
.square-clock {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: transparent;
  border: 0px solid #aaa;
  border-radius: 8px;
  width: auto;
  min-width: 600px;
  overflow-x: auto;
}

.timeline-hours {
  display: flex;
  align-items: center;
  /* gap: 8px; */
  flex: 1;
  min-width: 0;
}

.square-clock .time-link {
  position: relative;
  padding: 4px 6px;
  font-size: 11px;
  color: #0057ff;
  text-decoration: none;
  user-select: none;
  pointer-events: auto;
  white-space: nowrap;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.square-clock .time-link:hover {
  background-color: rgba(0, 87, 255, 0.1);
  color: #003d99;
}

.square-clock .time-link.active {
  font-weight: bold;
  color: #000;
  background-color: rgba(0, 87, 255, 0.2);
}

.square-clock .play-btn {
  position: relative;
  width: 28px;
  height: 28px;
  cursor: pointer;
  fill: #222;
  flex-shrink: 0;
}

/* Stile per il pulsante time quando il play è attivo */
#tool-time.playing {
  position: relative;
}

#tool-time.playing::before {
  content: '';
  position: absolute;
  top: 33.2%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 3.5px solid transparent;
  border-top-color: #007bff;
  border-right-color: #007bff;
  border-radius: 50%;
  animation: spinRing 5s linear infinite;
  pointer-events: none;
}

@keyframes spinRing {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}


/* ===================================================== */
/* GLOBAL FONT OVERRIDE – SAFE VERSION                   */
/* ===================================================== */

html,
body {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 400;
  margin: 0;
  zoom: var(--panel-zoom);
  height: 100%;
  padding: 0;
  margin: 0;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 600 !important;
}

/* UI elements */
button,
input,
select,
textarea,
.leaflet-container,
.leaflet-control,
.leaflet-popup-content,
.w3-button,
.w3-btn,
.w3-bar,
.w3-container,
.w3-panel,
.legendHS,
.legendTM,
.legendTMMulti,
.legendRoutes,
.legendClassify,
.custom-base-control,
.timeline,
.square-clock,
.mouse-tooltip {
  font-family: 'Montserrat', sans-serif !important;
}

/* Keep monospace where needed */
code,
pre,
kbd,
samp,
.w3-code,
.w3-codespan {
  font-family: Consolas, monospace !important;
}

.leaflet-container {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

/* ============================================
   MODERN GLASSMORPHIC TOOLBAR
   ============================================ */

/* TOOLBAR CONTAINER */
.toolbar {
    position: fixed;
    top: 5px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    padding: 24px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: visible;
    zoom: 85%;
}

/* BUTTON */
.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 70px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.tool-btn:active {
    transform: scale(0.95);
}

/* ICON CIRCLE */
.icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.tool-btn:hover .icon-wrapper {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Active state */
.tool-btn.active .icon-wrapper {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* SVG */
.icon-wrapper svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* LABEL */
.tool-label {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    text-align: center;
    line-height: 1.2;
    /* max-width: 65px; */
    transition: color 0.2s ease;
}

.tool-btn:hover .tool-label {
    color: #1f2937;
}

.tool-btn.active .tool-label {
    color: #ef4444;
    font-weight: 600;
}

#tool-chatbot {
  display: flex !important;
}

#tool-sociodem {
  position: relative;
}

#tool-sociodem {
  position: relative;
  overflow: visible !important;
}

#tool-sociodem .social-extra-buttons {
  position: absolute;
  top: 50%;
  left: auto;
  right: calc(100% + 20px);
  transform: translateY(-50%);
  margin-right: 0 !important;
  display: none;
  align-items: center;
  gap: 8px;
  pointer-events: auto !important;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  padding: 6px 8px;
  z-index: 1010;
}

#tool-sociodem .social-extra-buttons .area-button,
#tool-sociodem .social-extra-buttons .poly-button {
  width: 46px;
  min-height: 50px;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  padding: 4px 2px;
}

#tool-sociodem .social-extra-buttons .area-button:hover,
#tool-sociodem .social-extra-buttons .poly-button:hover {
  border-color: #ef4444;
}

#tool-shadow {
  position: relative;
  overflow: visible !important;
}

#tool-shadow .shadow-extra-buttons {
  position: absolute;
  top: 50%;
  left: auto;
  right: calc(100% + 20px);
  transform: translateY(-50%);
  margin-right: 0 !important;
  display: none;
  align-items: center;
  gap: 8px;
  pointer-events: auto !important;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  padding: 6px 8px;
  z-index: 1010;
}

#tool-shadow .shadow-extra-buttons .shadow-hot-button,
#tool-shadow .shadow-extra-buttons .shadow-normal-button {
  width: 46px;
  min-height: 50px;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  padding: 4px 2px;
}

#tool-shadow .shadow-extra-buttons .shadow-hot-button:hover,
#tool-shadow .shadow-extra-buttons .shadow-normal-button:hover {
  border-color: #ef4444;
}

/* Shadow slider panel */
#tool-shadow .shadow-slider-panel {
  display: none;
  position: absolute;
  right: calc(100% + 20px);
  top: calc(50% + 44px);
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  padding: 10px 14px;
  min-width: 160px;
  pointer-events: auto;
  z-index: 1010;
}

.shadow-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  min-width: 28px;
  text-align: center;
}

.shadow-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, #dbeafe, #1d4ed8);
  outline: none;
  cursor: pointer;
}

.shadow-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

.shadow-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

.shadow-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shadow-play-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #1d4ed8;
  background: #fff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.shadow-play-btn:hover {
  background: #1d4ed8;
  color: #fff;
}

.shadow-play-btn.playing {
  background: #1d4ed8;
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px), (max-height: 800px) {
    .toolbar {
        top: 10px;
        right: 10px;
        padding: 16px 8px;
        gap: 18px;
        zoom: 85%;
    }
    
    .tool-btn {
        width: 60px;
    }
    
    .icon-wrapper {
        width: 36px;
        height: 36px;
    }
    
    .icon-wrapper svg {
        width: 16px;
        height: 16px;
    }
    
    .tool-label {
      font-size: 10px;
    }
}

@media (max-height: 900px) {
  .ClassificationPanel,
  .unified-panel .unified-panel-content {
    zoom: 93%;
  }
}

@media (max-height: 800px) {
  .ClassificationPanel,
  .unified-panel .unified-panel-content {
    zoom: 84%;
  }
}

@media (max-height: 700px) {
  .ClassificationPanel,
  .unified-panel .unified-panel-content {
    zoom: 74%;
  }
}

@media (max-height: 600px) {
  .ClassificationPanel,
  .unified-panel .unified-panel-content {
    zoom: 64%;
  }
}

@media (max-height: 900px) {
  #multiTempDataTempContainer {
    zoom: 86%;
  }
}

@media (max-height: 800px) {
  #multiTempDataTempContainer {
    zoom: 78%;
  }
}

/* Hide default Leaflet controls (except geocoder proxy target) */
.leaflet-top.leaflet-right {
  display: block;
}

.leaflet-top.leaflet-right .leaflet-control {
  display: none;
}

.leaflet-control-mouseposition {
  display: none !important;
}

.leaflet-top.leaflet-right .leaflet-control-geocoder {
  display: block !important;
  position: fixed;
  top: var(--geocoder-panel-top, 170px);
  right: var(--geocoder-panel-right, 120px);
  overflow: visible;
  z-index: 1001;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
}

.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-form {
  position: relative;
  top: 0;
  right: 0;
  white-space: nowrap;
  display: none;
  height: 40px;
  padding: 0 0 0 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-right: 0;
  border-radius: 12px 12px 12px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  align-items: center;
}

.leaflet-top.leaflet-right .leaflet-control-geocoder.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
  display: inline-flex !important;
}

.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-form input:focus {
  outline: none;
}

.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-alternatives {
  position: absolute;
  top: 42px;
  left: 0;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-alternatives li {
  background: #ffffff;
}

.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-alternatives li:hover,
.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-selected {
  background: #f3f4f6;
}

/* #tool-search: same pattern as #tool-shadow for overflow + relative positioning */
#tool-search {
  position: relative;
  overflow: visible !important;
}

/* Geocoder ancorato a #tool-search come shadow-extra-buttons su #tool-shadow */
.geocoder-docked-to-toolbar {
  position: absolute;
  top: 50%;
  left: auto;
  right: calc(100% + 20px);
  transform: translateY(-50%);
  display: block !important;
  overflow: visible;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  margin: 0;
  padding: 0;
  z-index: 1010;
}

.geocoder-docked-to-toolbar .leaflet-control-geocoder-form {
  position: relative;
  top: 0;
  right: 0;
  white-space: nowrap;
  display: none;
  height: 40px;
  padding: 0 0 0 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-right: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  align-items: center;
}

.geocoder-docked-to-toolbar.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
  display: inline-flex !important;
}

.geocoder-docked-to-toolbar .leaflet-control-geocoder-form input:focus {
  outline: none;
}

.geocoder-docked-to-toolbar .leaflet-control-geocoder-alternatives {
  position: absolute;
  top: 42px;
  left: 0;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  text-align: left !important;
  width: 250px !important;
  z-index: 9999 !important;
  list-style: none;
  margin: 0;
  padding: 0;
  display: none !important;
}

/* mostra la lista solo quando il geocoder è expanded e ha risultati */
.geocoder-docked-to-toolbar.leaflet-control-geocoder-expanded
  .leaflet-control-geocoder-alternatives:not(.leaflet-control-geocoder-alternatives-minimized) {
  display: block !important;
}

.geocoder-docked-to-toolbar .leaflet-control-geocoder-alternatives li {
  background: #ffffff;
}

.geocoder-docked-to-toolbar .leaflet-control-geocoder-alternatives li:hover,
.geocoder-docked-to-toolbar .leaflet-control-geocoder-selected {
  background: #f3f4f6;
}

/* Panel header titles styling */
.panel-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
}

/* Section dividers */
.panel-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
}

/* First section shouldn't have top margin/border */
.panel-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Improve text contrast */
.legendTM h3,
.legendTM h4,
.legendTM h5,
.legendTM h6,
.legendTMMulti h3,
.legendTMMulti h4,
.legendTMMulti h5,
.legendTMMulti h6,
.ClassificationPanel h3,
.ClassificationPanel h5,
.socioDemPanel h3,
.socioDemPanel h4,
#temperatureLegend h5 {
  color: #333;
  margin-top: 8px;
  margin-bottom: 8px;
}

.ClassificationPanel .classification-address,
.unified-panel .ClassificationPanel .classification-address {
  text-align: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.ClassificationPanel .classification-title-block,
.unified-panel .ClassificationPanel .classification-title-block {
  background: transparent !important;
  border: 0 !important;
  text-align: left;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px;
  padding: 0;
}

.classification-layout,
.unified-panel .classification-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: clamp(280px, 30vw, 380px);
  max-width: 100%;
}

.classification-layout > .ClassificationPanel,
.classification-layout > .ClassifyPointPanel,
.unified-panel .classification-layout > .ClassificationPanel,
.unified-panel .classification-layout > .ClassifyPointPanel {
  width: 100%;
  box-sizing: border-box;
}

.ClassifyPointPanel,
.unified-panel .ClassifyPointPanel {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ClassifyPointPanel:empty,
.unified-panel .ClassifyPointPanel:empty {
  display: none;
}

/* Canvas margins */
.legendTM canvas,
.legendTMMulti canvas,
.ClassificationPanel canvas,
.socioDemPanel canvas {
  margin-top: 12px;
}

/* ========================================
   UNIFIED PANEL STYLES
   Single left panel for all graphs and legends
   ======================================== */
.unified-panel {
  position: fixed;
  top: 10px;
  left: 0px;
  width: auto;
  max-width: 500px;
  min-width: 320px;
  height: fit-content;
  max-height: calc(100vh - 20px);
  background-color: #ffffff;
  opacity: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  padding: 20px;
  font-family: 'Montserrat', sans-serif;
  z-index: 1000;
  pointer-events: auto;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.leaflet-bottom .leaflet-left .unified-panel.leaflet-control {
  margin: 0;
}

.unified-panel-content {
  width: 100%;
}

.unified-panel-loading {
  text-align: center;
  padding: 20px;
}

.unified-panel h3,
.unified-panel h4,
.unified-panel h5,
.unified-panel h6 {
  color: #333;
  margin-top: 8px;
  margin-bottom: 8px;
}

.unified-panel h3 {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 1.2rem !important;
  font-weight: 600 !important;
  line-height: 1.3;
}

.unified-panel canvas {
  margin-top: 12px;
}

.unified-panel .panel-title,
.unified-panel #legendHS h5 {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #2c3e50;
}

.unified-panel .panel-section {
  margin-bottom: 16px;
}

.unified-panel #legendHS.panel-section {
  margin-top: 20px;
  padding-top: 20px;
}

.unified-panel #legendHS {
  background: #f8fafc;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.unified-panel .panel-section:first-child {
  padding-top: 0;
  border-top: none;
}

.analysis-card-horizontal {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  height: fit-content;
  padding: 8px 12px;
  /* border-top: 2px solid var(--analysis-card-border-color, #1d4ed8); */
  background: #fafafa;
  border-radius: 6px;
  box-sizing: border-box;
  min-height: 0;
  /* flex: 0 0 var(--analysis-card-width, 220px);
  min-width: var(--analysis-card-width, 220px);
  max-width: var(--analysis-card-width, 220px); */
}

.route-data-temp-container {
  position: fixed;
  bottom: 22px;
  left: 10px;
  transform: none;
  width: fit-content;
  max-width: 1420px;
  z-index: 999;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.unified-panel .ClassificationPanel {
  position: relative;
  left: 0;
  top: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  zoom: 100%;
  height: auto;
  max-height: none;
  overflow-y: visible;
}

.unified-panel .ClassificationPanel .image-container {
  margin-bottom: 16px;
  flex-direction: row !important;
  gap: 10px;
  zoom:100%;
}

.unified-panel .ClassificationPanel .image-container img {
  width: calc(50% - 5px);
  max-width: calc(50% - 5px);
}

.unified-panel .ClassificationPanel #classifyChart {
  width: 100% !important;
  max-width: clamp(180px, 30vh, 320px);
  height: auto !important;
}

.unified-panel .socioDemPanel-container {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  zoom: 100%;
  overflow: visible;
}

.unified-panel .socioDemPanel {
  width: 100%;
  max-width: none;
  padding: 12px;
}

/* Canvas dimensioni per i pannelli socio-demografici */
.unified-panel .socioDemPanel canvas {
  max-width: 100%;
  height: auto;
  margin-top: 4px;
  display: block;
}

.unified-panel .socioDemPanel-2 canvas {
  height: auto;
}

.unified-panel #socioDemPanel {
  width: 100%;
  padding: 0;
}

/* Temporary legend policy: show UTCI only inside unified left panel */
.leaflet-control.legendHS,
.leaflet-control.legendTM,
.leaflet-control.legendTMMulti,
.leaflet-control.legendRoutes,
.leaflet-control.legendClassify,
.leaflet-control.legendSocioDem {
  display: none !important;
}

/* Panel zoom responsive by window height */
:root {
  --panel-zoom: 100%;
}

.menuPanel,
.legendHS,
.legendPop,
.legendTM,
.legendTMMulti,
.legendRoutes,
.legendClassify,
#query_panel,
#legendHS,
#legendPop {
  zoom: var(--panel-zoom);
}

@media screen and (max-height: 760px) {
  :root {
    --panel-zoom: 80%;
  }
}

@media screen and (min-height: 761px) and (max-height: 900px) {
  :root {
    --panel-zoom: 89%;
  }
}

@media screen and (min-height: 901px) and (max-height: 1080px) {
  :root {
    --panel-zoom: 95%;
  }
}

@media screen and (min-height: 1081px) {
  :root {
    --panel-zoom: 100%;
  }
}

/* Approx. <17" displays (viewport-based): classify images on one row + larger elements */
@media screen and (max-width: 1600px) and (max-height: 1000px) {
  .ClassificationPanel .image-container,
  .unified-panel .ClassificationPanel .image-container {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .ClassificationPanel .image-container img,
  .unified-panel .ClassificationPanel .image-container img {
    width: calc(50% - 5px);
    max-width: calc(50% - 5px);
  }

  .ClassificationPanel .panel-title,
  .unified-panel .ClassificationPanel .panel-title {
    font-size: 1.35rem !important;
  }

  .ClassificationPanel h5,
  .unified-panel .ClassificationPanel h5 {
    font-size: 1.05rem;
  }

  .ClassificationPanel #classifyChart,
  .unified-panel .ClassificationPanel #classifyChart {
    max-width: clamp(240px, 40vh, 380px);
  }
}

.leaflet-top.leaflet-right .leaflet-control-geocoder .leaflet-control-geocoder-alternatives {
  position: relative!important;
  top: 42px!important;
  left: 10px !important;
}

#classifyTempContainer,
#multiTempDataTempContainer,
#tempDataTempContainer {
  zoom: 85%
}

#classifyTempContainer {
  width: fit-content !important;
  max-width: 420px !important;
  min-width: 280px !important;
  background: transparent !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#tempDataTempContainer,
#routeDataTempContainer
{
  background: transparent!important;
}

.menuPanel-inner {
  position: relative;
}

.credits-link {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(255, 255, 255, .85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  left: -50px;
  height: 45px;
  width: 45px;
}

.credits-link:hover {
  background: #fff;
  transform: scale(1.1);
}