body {
  margin: 0;
  color: #161616;
  font-family: "Geologica", sans-serif;
}

/* Impedisce la selezione del testo su tutto il body */
body {
  user-select: none;
  -webkit-user-select: none; /* Chrome/Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE/Edge */
}

#map {
  top: 76px;
  bottom: 30px;
  margin: 0;
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
}

/* Overlay trasparente con effetto vetro */
#map-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  /* sfocatura dello sfondo */
  background: rgba(255, 255, 255, 0.4);
  /* leggero bianco trasparente */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

/* Contenuto centrato */
.loader-content {
  text-align: center;
  color: #333;
  font-family: "Segoe UI", sans-serif;
}

/* Spinner moderno */
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(0, 0, 0, 0.1);
  border-top: 6px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

#map-loader p {
  font-size: 16px;
  font-weight: 500;
  color: #222;
}

.map-dropdown {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
  background: white;
  border: 1px solid #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.map-dropdown select {
  font-size: 14px;
  padding: 4px;
}

.side-panel {
  position: fixed;
  top: 100px;
  bottom: 60px;
  left: 30px;
  width: 400px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.8);
  border-right: 1px solid #ccc;
  transform: translateX(-430px);
  /* NASCOSTO DI DEFAULT */
  transition: transform 0.3s ease;
  z-index: 1000;
}

#side-panel .content {
  height: calc(100vh - 120px);
  /* se hai un pulsante Chiudi sopra */
  padding: 0rem;
  width: 100%;
}

#table-wrapper {
  height: calc(100vh - 180px);
  display: block;
  position: relative;
  overflow: auto;
  overflow-x: hidden;
}

#side-panel .content h4 {
  text-transform: uppercase;
  margin: 0;
  color: #161616;
  font-weight: 200;
}

#side-panel .content h6 {
  margin: 0;
  margin-bottom: 10px;
  font-size: 12px;
  color: #161616;
  font-weight: 200;
}

.side-panel.open {
  transform: translateX(0) !important;
}

#close-panel {
  float: right;
  font-size: 20px;
  cursor: pointer;
}

div.dataTables_wrapper div.dataTables_filter input {
  width: 100% !important;
}

table.dataTable thead .filters input,
table.dataTable thead .filters select {
  width: 100%;
  box-sizing: border-box;
  padding: 4px;
  font-size: 12px;
}

#municipalityTable {
  font-size: 14px;
  overflow: auto;
}

table thead tr th {
  text-transform: uppercase !important;
  font-size: 12px;
}

#municipalityTable tbody tr {
  height: 30px;
}

#municipalityTable tbody td {
  vertical-align: middle !important;
}

#municipalityTable td:first-child {
  cursor: pointer;
  text-decoration: none;
}

#municipalityTable td:first-child:hover {
  cursor: pointer;
  text-decoration: underline;
}

#municipalityTable_info {
  font-size: 12px;
}

div.dataTables_wrapper div.dataTables_filter input {
  width: 50%;
}

#bottom-right-buttons {
  position: absolute;
  bottom: 50px;
  right: 20px;
  z-index: 1000;
}

#bottom-right-buttons .custom-buttons button {
  display: block;
  background: #000;
  color: #fff;
  border: none;
  margin-top: 20px;
  padding: 8px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 18px;
  width: 40px;
  height: 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#bottom-right-buttons .custom-buttons button:hover {
  background: #3C686B;
}

.map-type-container {
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

#map-type-btn {
  background: #111;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
}

.map-type-container {
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

#map-type-btn {
  background: #111;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
}

#map-type-dropdown {
  display: flex;
  /* Da colonna a riga */
  opacity: 0;
  visibility: hidden;
  position: absolute;
  bottom: 0;
  right: 50px;
  /* sposta a sinistra del pulsante */
  border-radius: 8px;
  overflow: hidden;
  transform: translateX(10px);
  transition: all 0.2s ease;
}

#map-type-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

#map-type-dropdown button {
  background: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  margin-left: 20px;
}

#map-type-dropdown button:last-child {
  border-right: none;
}

#map-type-dropdown button:hover {
  background: #eee;
}

.leaflet-control-geocoder {
  display: none;
}

/* Contenitore geocoder */
/* Contenitore input custom */


#geocoder-container {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  padding: 5px;
  display: none;
  /* oppure usa `.hidden` */
  z-index: 9999;
}

#geocoder-input {
  border: 0;
}

a {
  color: #5B7D6F !important;
}


.title-color {
  color: #161616 !important;
}

.btn.btn-primary {
  background-color: #5B7D6F !important;
  border-color: #5B7D6F !important;
  border: 1px solid #3C686B !important;
  text-transform: uppercase;
}

.btn.btn-primary:hover {
  background-color: white !important;
  border-color: #3C686B !important;
  color: #3C686B !important;
  border: 1px solid #3C686B !important;
}

.text-primary {
  border-top: 6px solid #3C686B !important;
}


.custom-header {
  position: sticky;
  /* resta in cima */
  top: 0;
  z-index: 1020;
  /* sopra altri contenuti */
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-header .navbar-brand img {
  height: 50px;
  padding-left: 50px;
}

.navbar .nav-link {
  color: #000000 !important;
  fill: #000000 !important;
  font-size: 14px;
  padding-left: 12px;
  padding-right: 12px;
  padding-top: 15px;
  padding-bottom: 15px;
}

.navbar .nav-link:hover {
  color: #3C686B !important;
  fill: #3C686B !important;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

#footer {
  position: fixed;
  /* Sovrappone il div alla mappa */
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  vertical-align: middle;
  background-color: rgba(255, 255, 255, 0.8);
  /* semi-trasparente */
  z-index: 1000;
  /* sopra la mappa */
  text-align: center;
  font-weight: normal;
  font-size: 11px;
  align-content: center;
}

/* Menu mobile */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .navbar-nav .nav-item {
    margin-bottom: 5px;
  }

  .navbar-nav .btn {
    width: 100%;
  }
}


/* Sfondo semi-trasparente */
  /* Overlay semi-trasparente */
  #overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 10px; /* Per non toccare i bordi su mobile */
    box-sizing: border-box;
  }

  /* Popup */
  #popup {
    background-color: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    font-size: 13px;
    line-height: 1.5;
  }

  /* Logo */
  #popup img {
    width: 250px;
    margin: 0 auto 15px auto;
  }

  /* Contenuto scrollabile */
  #popup-content {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 15px;
    font-weight: 100;
    padding-right: 5px; /* spazio per scrollbar */
  }


  .checkbox-group {
    font-size: 13px;
    line-height: 1.5;
  }

  .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  /* Pulsante */
  #btn-overlay-accept {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    background-color: #3C686B;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    max-width: 300px;
    margin: auto;
  }

  #btn-overlay-accept.enabled {
    opacity: 1;
    cursor: pointer;
  }

  /* Mobile adjustments */
  @media (max-width: 480px) {
    #popup {
      padding: 15px;
    }

    #popup-content p {
      font-size: 13px;
    }

    #btn-overlay-accept {
      font-size: 14px;
    }
  }