#map {
  width: 100%;
  height: 100vh;
}

#offcanvas-1 {
  width: 100%;
}

@media (min-width: 992px) {
  #offcanvas-1 {
    width: 35%;
  }
}

@media (min-width: 768px) {
  #offcanvas-1 {
    width: 40%;
  }
}

div.navbtn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1001;
  width: 100%;
}

.logo {
  position: absolute;
  top: 10px;
  right: 0;
  z-index: 999999;
  /*width: 324.3px;*/
}

.xdtls p {
  font-size: 16px;
}

#offcanvas-2 {
  border-top: none;
}

.offcanvas {
  position: fixed;
  bottom: 0;
  z-index: 9001;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  background-color: #fff;
  background-clip: padding-box;
  outline: 0;
  transition: transform .3s ease-in-out;
}

.leaflet-routing-container {
  display: none;
}

.scheda_titolo {
  color: rgb(0,0,0);
  margin: 0px;
  margin-right: 4px;
}

.scheda_telefono {
  color: var(--bs-emphasis-color);
  font-size: 14px;
}

#linkList, #linkList li {
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 1400px) {
  #dashboard {
    width: 100%;
  }
}

@media (min-width: 992px) {
  #dashboard {
    width: 100%;
    padding-top: 0px;
  }
}

@media (min-width: 300px) {
  #dashboard {
    width: 100%;
    margin-top: 400px;
    max-width: 420px;
    padding: 10px;
    height: auto !important;
  }
}

@media (min-width: 300px) {
  #dashboard .offcanvas-body {
    padding: initial;
    padding-top: 0;
    padding-right: 10px;
    width: 100%;
  }
}

@media (min-width: 576px) {
  #dashboard .offcanvas-body {
    padding-top: 40px;
    margin-right: 10px;
  }
}

.interesse {
  margin-right: initial;
  margin-top: 20px;
  color: var(--bs-emphasis-color);
}

#dashboard .offcanvas-body {
  margin-left: 0px;
}

#dashboard {
  background: rgba(255,255,255,0.85);
  z-index: 5000;
  height: 100%;
  max-width: 450px;
  width: 100%;
overflow-y: scroll;
}

@media (min-width: 576px) {
  #dashboard {
    margin-top: initial;
    background: rgb(255,255,255);
    padding-top: 5px;
  }
}

.btn-profile {
  color: var(--bs-body-bg);
  background: #3656b0;
  --bs-info: #3656b0;
  --bs-info-rgb: 54,86,176;
}


.sidebar {
  width: 100% !important;
}
.search-container {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border-radius: 16px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  justify-content: center;
}

.search-container:hover {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.search-location-btn,
.select-location-btn {
  border: 2px solid #e9ecef;
  background: #fff;
  color: #6c757d;
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.search-location-btn i,
.select-location-btn i {
  font-size: 18px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.search-location-btn::before,
.select-location-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 123, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.search-location-btn:hover::before,
.select-location-btn:hover::before {
  width: 100%;
  height: 100%;
}

.search-location-btn:hover,
.select-location-btn:hover {
  background-color: #fff;
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.search-location-btn:hover i,
.select-location-btn:hover i {
  transform: scale(1.1);
}

.search-location-btn:active,
.select-location-btn:active {
  transform: translateY(0);
}

/* Stato attivo per i pulsanti di geolocalizzazione e selezione mappa */
.search-location-btn.active,
.select-location-btn.active {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  border-color: #28a745;
  box-shadow:
    0 4px 12px rgba(40, 167, 69, 0.25),
    0 0 0 0 rgba(40, 167, 69, 0.4);
  animation: pulse-green 2s infinite;
}

.search-location-btn.active i,
.select-location-btn.active i {
  transform: scale(1.05);
}

.search-location-btn.active:hover,
.select-location-btn.active:hover {
  background: linear-gradient(135deg, #218838, #1c9d76);
  border-color: #1e7e34;
  color: #fff;
  transform: translateY(-2px);
}

.search-location-btn.active::before,
.select-location-btn.active::before {
  background: rgba(255, 255, 255, 0.2);
}

/* Animazione pulsante per indicare tracciamento attivo */
@keyframes pulse-green {
  0%, 100% {
    box-shadow:
      0 4px 12px rgba(40, 167, 69, 0.25),
      0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  50% {
    box-shadow:
      0 4px 12px rgba(40, 167, 69, 0.25),
      0 0 0 8px rgba(40, 167, 69, 0);
  }
}

/* Cursore crosshair per la mappa in modalità selezione */
#map.map-selection-active {
  cursor: crosshair !important;
}

#map.map-selection-active * {
  cursor: crosshair !important;
}
#accessibleAeeasItems, #trasportiItems, #panelView, #panelViewMobile, #schedaViewMobile, #categoriesView, #categoriesViewMobile {
    display: none;
}
#accessibleAeeasItems.active, #trasportiItems.active, #panelView.active, #panelViewMobile.active, #schedaViewMobile.active, #categoriesView.active, #categoriesViewMobile.active {
    display: block;
}
#panelViewMobile.active {
  padding: 30px;
}
#categoriesViewMobile.active {
  padding: 30px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}



.categories-container {
  position: relative;
}
.show-more-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  color: #6c757d;
  border-radius: 6px;
  transition: all 0.2s;
  z-index: 10;
}
.show-more-btn:hover {
  background: #e9ecef;
  color: #495057;
}
.category-items {
  display: none;
  margin-left: 2rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 2px solid #e9ecef;
}
.category-items.show {
  display: block;
}
.category-item-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: #6c757d;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.category-item-link:hover {
  background-color: #e9ecef;
  color: #495057;
}
.category-item.active {
  background-color: #3656af !important;
  color: white !important;
}
.category-item:hover {
  background-color: #e9ecef;
}
.category-item.active:hover {
  background-color: #0b5ed7 !important;
}
.hidden-categories,
.hidden-layers{
  display: none;
}
.hidden-categories.show,
.hidden-layers.show {
  display: block;
}
.detail-card {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 300px;
  display: none;
  z-index: 1000;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.detail-card.show {
  display: block;
}
.detail-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.rating {
  color: #ffc107;
  font-size: 0.875rem;
}
.category-count {
  font-size: 0.75rem;
  color: #6c757d;
  background-color: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  margin-left: auto;
}
.local-details {
  flex: 1;
  min-width: 0;
}
.local-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.local-info {
  font-size: 0.75rem;
  color: #6c757d;
}
.back-button {
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.back-button:hover {
  background-color: #e9ecef;
  color: #495057;
}
.item-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #dee2e6;
  margin-bottom: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.item-card.premium {
  border: 2px solid #ffd700;
  background: linear-gradient(to right, #fff, #fff8e8);
}

.item-card.premium:hover {
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.premium-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 1;
}

.item-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.item-card:hover .item-image {
  transform: scale(1.05);
}

.premium-content {
  position: relative;
  background: transparent;
}

.premium-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
      120deg,
      transparent,
      rgba(255, 215, 0, 0.1),
      transparent
  );
  animation: shine 2s infinite;
}

@keyframes shine {
  to {
      left: 200%;
  }
}

.accessibility-features {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.premium-feature {
  background: rgba(255, 215, 0, 0.1);
  color: #b8860b;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.accessible-feature {
  background: #fff;
  color: #5100ff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.rating {
  color: #ffd700;
}

.price-cimplementaategory {
  color: #6c757d;
  font-size: 0.875rem;
}

.verified-badge {
  color: #0d6efd;
  margin-left: 4px;
}
.manual-pin-section {
  margin-bottom: 16px;
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === WRAPPER SELEZIONE MAPPA === */
.map-selection-wrapper {
  animation: slideInUp 0.3s ease-out;
  margin-top: 16px;
}

/* === PULSANTI MODALITÀ ROUTING === */
.routing-mode-buttons {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #1A2C44;
  border-radius: 12px;
}

/* === LEGENDA MAPPA (collassabile) === */
.map-legend-section {
  background: transparent;
}

.legend-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bs-secondary-bg, #f8f9fa);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--bs-body-color, #495057);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.legend-toggle-btn:hover {
  background: var(--bs-tertiary-bg, #f1f3f5);
  border-color: #007bff;
}

.legend-toggle-label {
  display: flex;
  align-items: center;
}

.legend-toggle-label i {
  color: #007bff;
}

.legend-chevron {
  font-size: 12px;
  color: #6c757d;
  transition: transform 0.25s ease;
}

.legend-toggle-btn[aria-expanded="true"] .legend-chevron {
  transform: rotate(180deg);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #495057;
}

.legend-icon-img {
  width: 24px;
  height: auto;
}

.legend-actv-stop {
  width: 16px;
  height: 16px;
  background-color: #9C27B0;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* === PULSANTI MODALITÀ ROUTING === */
.routing-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}

.routing-mode-btn i {
  font-size: 30px;
  transition: all 0.3s ease;
}

.routing-mode-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.routing-mode-btn.active {
  background: #fff;
  border-color: #fff;
  color: #3656AF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.routing-mode-btn.active i {
  color: #3656AF;
}

/* === ISTRUZIONI ROUTING === */
.routing-instructions {
  margin-bottom: 24px;
}

.instructions-title {
  color: #495057;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.instructions-title i {
  color: #007bff;
  font-size: 16px;
}

.instruction-cards {
  display: grid;
  gap: 12px;
}

.instruction-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.instruction-card::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.instruction-card.active::after {
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(135deg, #28a745, #20c997);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.instruction-card.active::before {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 17px;
  color: #fff;
  font-size: 12px;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.instruction-card.active::before {
  opacity: 1;
}

.instruction-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
  transform: translateX(4px);
}

.instruction-card.active {
  border-color: #28a745;
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.instruction-card.active:hover {
  border-color: #28a745;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.instruction-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.instruction-icon i {
  font-size: 16px;
  color: #fff;
}

.instruction-card:hover .instruction-icon {
  transform: scale(1.1);
}

.search-icon {
  background: #1A2C44;
  box-shadow: 0 4px 12px rgba(54, 86, 175, 0.3);
}

.location-icon {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.map-icon {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.instruction-text {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  flex: 1;
  transition: padding-right 0.3s ease;
}

.instruction-card.active .instruction-text {
  padding-right: 32px;
}

/* === CAMPO RICERCA INDIRIZZO === */
.search-address-container {
  margin-top: 16px;
  animation: slideDownFade 0.3s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
  }
}

.search-address-container .search-input-group {
  width: 100%;
}

.search-address-container .input-group {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.search-address-container .input-group:focus-within {
  border-color: #007bff;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.search-address-container .input-group-text {
  background: #fff !important;
  border: none !important;
  padding-left: 14px;
}

.search-address-container .input-group-text i {
  color: #6c757d;
  font-size: 16px;
  transition: color 0.3s ease;
}

.search-address-container .input-group:focus-within .input-group-text i {
  color: #007bff;
}

.search-address-container .form-control {
  border: none !important;
  padding: 12px 14px 12px 0;
  font-size: 15px;
  font-weight: 500;
  background: #fff !important;
}

.search-address-container .form-control:focus {
  box-shadow: none !important;
}

.search-address-container .form-control::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

/* === LISTA DESTINAZIONI === */
.destinations-list {
  margin-bottom: 20px;
  display: none; /* Nascosta di default */
}

.destinations-list.visible {
  display: block; /* Mostrata quando ha classe visible */
}

.destinations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e9ecef;
}

.destinations-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.destinations-title i {
  color: #007bff;
  font-size: 16px;
}

.destinations-title h6 {
  font-size: 15px;
  font-weight: 600;
  color: #495057;
}

.destinations-badge {
  background: #1A2C44;
  color: #fff;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(54, 86, 175, 0.3);
  animation: countPulse 0.3s ease-out;
}

@keyframes countPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.destinations-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar personalizzata per la lista destinazioni */
.destinations-container::-webkit-scrollbar {
  width: 6px;
}

.destinations-container::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 10px;
}

.destinations-container::-webkit-scrollbar-thumb {
  background: #1A2C44;
  border-radius: 10px;
}

.destinations-container::-webkit-scrollbar-thumb:hover {
  background: #1A2C44;
}

/* Elemento destinazione */
.destination-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 10px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  animation: slideInItem 0.3s ease-out;
}

@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.destination-item:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
  transform: translateX(4px);
}

.destination-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1A2C44;
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(54, 86, 175, 0.3);
}

.destination-item:hover .destination-number {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(54, 86, 175, 0.4);
}

.destination-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.destination-coordinates {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  line-height: 1.5;
}

.remove-destination-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e9ecef;
  background: #fff;
  color: #dc3545;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.remove-destination-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.remove-destination-btn:hover::before {
  width: 100%;
  height: 100%;
}

.remove-destination-btn:hover {
  background: #fff;
  border-color: #dc3545;
  transform: scale(1.1);
}

.remove-destination-btn i {
  font-size: 14px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.remove-destination-btn:hover i {
  transform: rotate(15deg);
}

.remove-destination-btn:active {
  transform: scale(0.95);
}

/* === PULSANTI AZIONE === */
.routing-actions {
  display: none; /* Nascosti di default */
  gap: 10px;
}

.routing-actions.visible {
  display: flex; /* Mostrati quando ha classe visible */
}

.routing-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.routing-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.routing-btn:hover::before {
  width: 300px;
  height: 300px;
}

.routing-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.routing-btn:hover i {
  transform: scale(1.1);
}

.routing-btn-primary {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.routing-btn-primary:hover {
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
  transform: translateY(-2px);
}

.routing-btn-primary:active {
  transform: translateY(0);
}

.routing-btn-secondary {
  background: #fff;
  color: #6c757d;
  border: 2px solid #dee2e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.routing-btn-secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.routing-btn-secondary:active {
  transform: translateY(0);
}

.map-in-selection-mode {
cursor: pointer !important;
}

/* ================================================
   NUOVI CAMPI PARTENZA / DESTINAZIONE (route-inputs)
   ================================================ */

.route-inputs-card {
  background: #1A2C44;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 14px;
  position: relative;
}

.route-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

/* La riga di partenza deve stare sopra quella di destinazione
   affinché il suo dropdown non venga coperto */
.route-input-row:first-of-type {
  z-index: 2;
}

/* Pallino colorato (start/end) */
.route-input-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px currentColor;
}

.route-dot-start {
  background: #28a745;
  color: #28a745;
}

.route-dot-end {
  background: #dc3545;
  color: #dc3545;
}

/* Marker mappa con pulsazione */
@keyframes markerPulse {
  0%   { box-shadow: 0 0 0 2px currentColor, 0 0 0 4px currentColor; }
  70%  { box-shadow: 0 0 0 2px currentColor, 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 2px currentColor, 0 0 0 4px currentColor; }
}

.map-marker-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  animation: markerPulse 1.8s ease-out infinite;
}

.map-marker-dot.start { background: #28a745; color: #28a745; }
.map-marker-dot.end   { background: #dc3545; color: #dc3545; }

/* Linea verticale tra i due pallini */
.route-connector-line {
  width: 2px;
  height: 14px;
  background: rgba(255,255,255,0.4);
  margin-left: 6px;  /* allineato con centro pallino (10px wrapper - 2px/2) */
}

.route-input-wrapper {
  flex: 1;
  min-width: 0;
}

.route-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  overflow: visible;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.route-input-group:focus-within {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

.route-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  color: #1a1a2e;
  outline: none;
  min-width: 0;
}

.route-input::placeholder {
  color: #7a8ab0;
  font-weight: 400;
}

.route-input-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.route-input-btn {
  background: transparent;
  border: none;
  padding: 8px 8px;
  cursor: pointer;
  color: #3656AF;
  font-size: 15px;
  flex-shrink: 0;
  border-radius: 0;
  transition: color 0.2s ease, background 0.2s ease;
}

.route-input-actions .route-input-btn:last-child {
  border-radius: 0 10px 10px 0;
}

.route-input-btn:hover {
  color: #2A4489;
  background: rgba(54, 86, 175, 0.1);
}

/* Pulsante × svuota campo */
.clear-btn {
  color: #3656AF;
  font-size: 13px;
}

.clear-btn:hover {
  color: #2A4489 !important;
  background: rgba(54, 86, 175, 0.1) !important;
}

.route-input-btn.active {
  color: #2A4489;
}

.gps-btn:hover { color: #2A4489; }
.gps-btn.loading { animation: pulse 1s ease-in-out infinite; color: #3656AF; }
.gps-btn.active {
  color: #2A4489;
  background: rgba(54, 86, 175, 0.12);
  border-radius: 6px;
  animation: gps-active-pulse 2s ease-in-out infinite;
}
@keyframes gps-active-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(54, 86, 175, 0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(54, 86, 175, 0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Pin mappa → blu */
.map-pin-btn:hover { color: #2A4489; }
.map-pin-btn.active {
  color: #2A4489;
  background: rgba(54, 86, 175, 0.1);
}

/* Pin partenza → blu */
#mapPinBtnStart:hover { color: #2A4489; }
#mapPinBtnStart.active {
  color: #2A4489;
  background: rgba(54, 86, 175, 0.1);
}

/* Dropdown suggerimenti */
.route-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bs-body-bg, #fff);
  border: 1.5px solid #007bff;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 9999;
  overflow: hidden;
  /* Scroll se molti risultati su mobile */
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.route-suggestion-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--bs-body-color, #333);
  border-bottom: 1px solid var(--bs-border-color, #f0f0f0);
  transition: background 0.15s ease;
  /* Prevenire selezione testo accidentale su touch */
  user-select: none;
  -webkit-user-select: none;
}

.route-suggestion-item:last-child { border-bottom: none; }
.route-suggestion-item:hover {
  background: rgba(0, 123, 255, 0.06);
  color: #007bff;
}

/* Touch feedback immediato */
.route-suggestion-item.touching {
  background: rgba(0, 123, 255, 0.12);
  color: #007bff;
}

/* ── Mobile: target touch più grandi ── */
@media (max-width: 768px) {
  .route-input {
    padding: 12px 12px;
    font-size: 16px; /* evita zoom automatico iOS */
  }

  .route-input-btn {
    padding: 10px 10px;
    min-width: 40px;
    min-height: 44px;
    font-size: 16px;
  }

  .route-suggestion-item {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .route-suggestions {
    max-height: 50vh;
    /* Larghezza minima per non essere troppo stretta */
    min-width: 240px;
  }

  .routing-mode-btn {
    flex: 1;
    min-height: 44px;
  }

  .route-calculate-btn {
    min-height: 48px;
    font-size: 15px;
  }

  .route-cancel-btn {
    min-width: 48px;
    min-height: 48px;
  }
}

/* Contenitore affiancato Calcola + Annulla */
.route-action-buttons {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* Pulsante Calcola percorso */
.route-calculate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 11px 16px;
  background: #fff;
  color: #007bb5;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.route-calculate-btn:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.route-calculate-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Pulsante Annulla (icona quadrata) */
.route-cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.route-cancel-btn:hover {
  background: rgba(255,255,255,0.28);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-1px);
}

.route-cancel-btn:active {
  transform: translateY(0);
}

[data-bs-theme="dark"] .route-cancel-btn {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

/* Dark mode overrides */
[data-bs-theme="dark"] .route-inputs-card {
  background: #1A2C44;
  border-color: rgba(255,255,255,0.12);
}

[data-bs-theme="dark"] .route-input-group {
  background: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.5);
}

[data-bs-theme="dark"] .route-suggestion-item:hover {
  background: rgba(0, 123, 255, 0.15);
}

[data-bs-theme="dark"] .legend-toggle-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .route-suggestions {
  background: #1e1e2e;
}

[data-bs-theme="dark"] .route-suggestion-item {
  border-color: rgba(255,255,255,0.07);
}

/* ================================================
   MODALE RICERCA INDIRIZZO MOBILE
   ================================================ */

.addr-search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200000;
  background: var(--bs-body-bg, #fff);
  flex-direction: column;
}

.addr-search-modal.open {
  display: flex;
}

.addr-search-modal-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.addr-search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--bs-border-color, #e9ecef);
  flex-shrink: 0;
}

.addr-search-modal-back {
  background: none;
  border: none;
  padding: 6px 8px;
  color: var(--bs-body-color, #333);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  line-height: 1;
}

.addr-search-modal-back:active {
  background: var(--bs-secondary-bg, #e9ecef);
}

.addr-search-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--bs-body-color, #333);
  flex: 1;
}

/* Input wrapper */
.addr-search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 16px 0;
  background: var(--bs-secondary-bg, #f0f2f5);
  border-radius: 12px;
  padding: 0 12px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.addr-search-modal-input-wrap:focus-within {
  border-color: #3656AF;
  background: var(--bs-body-bg, #fff);
}

.addr-search-modal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #fff;
}

.addr-search-modal-dot.start {
  background: #28a745;
  box-shadow: 0 0 0 2px #28a745;
}

.addr-search-modal-dot.end {
  background: #dc3545;
  box-shadow: 0 0 0 2px #dc3545;
}

.addr-search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 17px;
  color: var(--bs-body-color, #333);
  outline: none;
  min-width: 0;
}

.addr-search-modal-input::placeholder {
  color: var(--bs-secondary-color, #888);
}

.addr-search-modal-clear {
  background: none;
  border: none;
  padding: 6px;
  color: var(--bs-secondary-color, #888);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

/* Lista suggerimenti */
.addr-search-modal-suggestions {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}

.addr-search-modal-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bs-border-color, #f0f0f0);
  cursor: pointer;
  color: var(--bs-body-color, #333);
  font-size: 15px;
  transition: background 0.12s;
  user-select: none;
  -webkit-user-select: none;
}

.addr-search-modal-suggestion-item:active,
.addr-search-modal-suggestion-item.touching {
  background: rgba(54, 86, 175, 0.08);
}

.addr-search-modal-suggestion-item i {
  color: #3656AF;
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.addr-search-modal-suggestion-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Azioni rapide (GPS / Mappa) */
.addr-search-modal-actions {
  flex-shrink: 0;
  border-top: 1px solid var(--bs-border-color, #e9ecef);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}

.addr-search-modal-gps,
.addr-search-modal-map {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 20px;
  font-size: 15px;
  color: #3656AF;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.addr-search-modal-gps:active,
.addr-search-modal-map:active {
  background: rgba(54, 86, 175, 0.08);
}

.addr-search-modal-gps i,
.addr-search-modal-map i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Dark mode */
[data-bs-theme="dark"] .addr-search-modal {
  background: #1a1a2e;
}

[data-bs-theme="dark"] .addr-search-modal-input-wrap {
  background: rgba(255,255,255,0.07);
}

[data-bs-theme="dark"] .addr-search-modal-input-wrap:focus-within {
  background: rgba(255,255,255,0.1);
}

[data-bs-theme="dark"] .addr-search-modal-suggestion-item:active,
[data-bs-theme="dark"] .addr-search-modal-suggestion-item.touching {
  background: rgba(54, 86, 175, 0.2);
}

/* Su desktop la modale non si usa mai */
@media (min-width: 769px) {
  .addr-search-modal {
    display: none !important;
  }
}


#suggestions {
  position: absolute;
  width: 100%;
  display: block;
  background: #fff;
  z-index: 3;
  top: 48px;
  left: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}

/* Scrollbar personalizzata per suggestions */
#suggestions::-webkit-scrollbar {
  width: 6px;
}

#suggestions::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 0 0 10px 0;
}

#suggestions::-webkit-scrollbar-thumb {
  background: #1A2C44;
  border-radius: 10px;
}

#suggestions::-webkit-scrollbar-thumb:hover {
  background: #1A2C44;
}

.autocomplete-suggestion {
  font-size: 14px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

.autocomplete-suggestion:hover {
  cursor: pointer;
  background: linear-gradient(145deg, #f8f9fa, #e9ecef);
  padding-left: 18px;
}


.destination-item {
  display: flex;
  align-content: space-between;
}
.destination-item div {
  display: flex;
}


/* navigatore 
.header {
  padding: 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
}

.header h1 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 5px;
}

.header p {
  color: #666;
  font-size: 0.9rem;
}

.status-bar {
  padding: 10px 20px;
  background-color: #e3f2fd;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-bar.updating {
  background-color: #fff3e0;
}

.steps-container {
  padding: 10px 0;
}

.step {
  display: flex;
  align-items: flex-start;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background-color 0.3s;
}

.step:hover {
  background-color: #f8f9fa;
}

.step.active {
  background-color: #e3f2fd;
}

.step.completed {
  background-color: #f1f8e9;
}

.step-icon {
  width: 40px;
  height: 40px;
  background-color: #2196f3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.completed .step-icon {
  background-color: #4caf50;
}

.step-content.active {
  background: lightgreen;
}
.step-content {
  flex-grow: 1;
  margin: 15px 5px;
  padding: 10px;
}


.step-instruction {
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
  text-align: left;
  font-size: 19px;
}
.step-details {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
}

.step-details span:not(:last-child)::after {
  content: "•";
  margin: 0 8px;
  color: #999;
}

.step-distance {
  color: #2196f3;
  font-weight: 500;
}

.step-number {
  width: 24px;
  height: 24px;
  background-color: #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #666;
  margin-left: 10px;
}

.active .step-number {
  background-color: #2196f3;
  color: white;
}

.completed .step-number {
  background-color: #4caf50;
  color: white;
}*/
.detail-header {
  position: relative;
  height: 100px;
  overflow: hidden;
}
.header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.quick-actions {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
}
.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  transition: all 0.2s;
}
.action-btn:hover {
  background: white;
  transform: scale(1.05);
}
.info-box {
  
  border-radius: 12px;
  margin-bottom: 1rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #dee2e6;
}
.contact-item:last-child {
  border-bottom: none;
}
.contact-icon {
  width: 40px;
  height: 40px;
  background: #e9ecef;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
}
.schedule-day {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}
.schedule-day:last-child {
  border-bottom: none;
}
.accessibility-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

/* Campi extra specifici per categoria (es: servizi igienici) */
.extra-field-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}
.extra-field-item:last-child {
  border-bottom: none;
}
.extra-field-icon {
  width: 36px;
  height: 36px;
  background: #e3f2fd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.extra-field-icon i {
  font-size: 1rem;
}
.extra-field-value {
  font-weight: 500;
  color: #212529;
}
.scheda_extra_fields {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 12px;
}

/* Fix per layout tabs nella scheda POI */
#scheda .nav-tabs,
#schedaViewMobile .nav-tabs,
.offcanvas .nav-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  border-bottom: 1px solid #dee2e6;
  gap: 0;
}
#scheda .nav-tabs .nav-item,
#schedaViewMobile .nav-tabs .nav-item,
.offcanvas .nav-tabs .nav-item {
  display: inline-flex !important;
  flex-shrink: 0;
  margin-bottom: -1px;
}
.nav-tabs .nav-link {
  color: #495057;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.nav-tabs .nav-link.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
  background: none;
}
.nav-tabs .nav-link:hover {
  border-color: transparent;
  border-bottom-color: #dee2e6;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}
.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.transport-option {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.feature-badge {
  background: #e9ecef;
  color: #495057;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}
.badge {
  font-weight: 500;
  font-size: 0.875rem;
}
.badge.bg-success {
  background-color: #198754 !important;
}
.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000;
}
.badge.bg-danger {
  background-color: #dc3545 !important;
}
.scheda_alert_lim{
  display:none !important;
}
.scheda_alert_lim.show{
  display:block !important;
}
.scheda_alert_lim_mobile{
  display:none !important;
}
.scheda_alert_lim_mobile.show{
  display:block !important;
} 

.flags-only-selector {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.flag-button {
  font-size: 24px;
  background: none;
  border: 2px solid transparent;
  padding: 6px;
  margin: 0 8px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.flag-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 5px rgba(0,0,0,0.15);
}

.flag-button.active {
  border: 2px solid #3656b0;
  background: #f8f9fa;
}

/* ========================================
   CATEGORIE PRINCIPALI - Griglia 2 colonne
   ======================================== */

/* Griglia 2 colonne */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Se l'ultimo elemento è solo nella sua riga, occupa entrambe le colonne */
.categories-grid .category-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Card categoria */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px 12px !important;
  border-radius: 12px !important;
  border: 1px solid #dee2e6 !important;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  text-align: center;
  min-height: 90px;
}

/* Icona grande centrata */
.category-card-icon {
  font-size: 1.6rem;
  color: #3656b0;
  transition: all 0.25s ease;
  display: block;
}

/* Label */
.category-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #495057;
  line-height: 1.2;
  transition: all 0.25s ease;
}

/* Icona occhio — in alto a destra, nascosta */
.category-card-status {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.65rem;
  color: #adb5bd;
  opacity: 0;
  transition: all 0.25s ease;
}

/* Hover */
.category-card:hover {
  background: #f0f4ff !important;
  border-color: #3656b0 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 86, 176, 0.15);
}

.category-card:hover .category-card-icon {
  color: #3656b0;
  transform: scale(1.15);
}

.category-card:hover .category-card-status {
  opacity: 0.5;
}

/* Stato attivo */
.category-card.active {
  background: linear-gradient(135deg, #3656b0 0%, #00A8E8 100%) !important;
  border-color: #3656b0 !important;
  box-shadow: 0 4px 16px rgba(54, 86, 176, 0.35);
  transform: translateY(0);
}

.category-card.active .category-card-icon,
.category-card.active .category-card-label {
  color: white !important;
}

.category-card.active .category-card-status {
  opacity: 1;
  color: rgba(255,255,255,0.8) !important;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Dark mode */
[data-bs-theme="dark"] .category-card {
  background: #1e2330;
  border-color: #2d3548 !important;
}

[data-bs-theme="dark"] .category-card:hover {
  background: #252d42 !important;
  border-color: #00A8E8 !important;
  box-shadow: 0 4px 12px rgba(0, 168, 232, 0.2);
}

[data-bs-theme="dark"] .category-card:hover .category-card-icon {
  color: #00A8E8;
}

[data-bs-theme="dark"] .category-card-icon {
  color: #00A8E8;
}

[data-bs-theme="dark"] .category-card-label {
  color: #adb5bd;
}

/* ========================================
   SOTTO-CATEGORIE (POI) - Indicatori di accessibilità
   ======================================== */

/* Indicatore colorato per POI */
.accessibility-indicator-poi {
  width: 5px;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 8px 0 0 8px;
  transition: all 0.3s ease;
}

/* POI Accessibile - Verde */
.poi-item[data-accessibility="accessible"] .accessibility-indicator-poi {
  background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
  box-shadow: inset -2px 0 8px rgba(40, 167, 69, 0.4);
}

/* POI Parzialmente accessibile - Blu */
.poi-item[data-accessibility="partial"] .accessibility-indicator-poi {
  background: linear-gradient(180deg, #0d6efd 0%, #0dcaf0 100%);
  box-shadow: inset -2px 0 8px rgba(13, 110, 253, 0.4);
}

/* POI Non accessibile - Rosso */
.poi-item[data-accessibility="not-accessible"] .accessibility-indicator-poi {
  background: linear-gradient(180deg, #dc3545 0%, #fd7e14 100%);
  box-shadow: inset -2px 0 8px rgba(220, 53, 69, 0.4);
}

/* POI Da rilevare - Giallo */
.poi-item[data-accessibility="to-survey"] .accessibility-indicator-poi {
  background: linear-gradient(180deg, #ffc107 0%, #ffca2c 100%);
  box-shadow: inset -2px 0 8px rgba(255, 193, 7, 0.4);
}

/* Stile card POI migliorato */
.poi-item {
  position: relative;
  border-radius: 8px !important;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  overflow: hidden;
  padding-left: 0 !important;
}

.poi-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.poi-item .premium-contenst {
  padding-left: 16px !important;
}

/* Nome POI */
.poi-name {
  font-weight: 500;
  color: #212529;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* Badge accessibilità per POI */
.accessibility-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #e9ecef;
  color: #495057;
}

.poi-item[data-accessibility="accessible"] .accessibility-badge {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.poi-item[data-accessibility="partial"] .accessibility-badge {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

.poi-item[data-accessibility="not-accessible"] .accessibility-badge {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.poi-item[data-accessibility="to-survey"] .accessibility-badge {
  background: rgba(255, 193, 7, 0.1);
  color: #d39e00;
}

/* Smooth transitions for all interactive elements */
.poi-item * {
  transition: all 0.2s ease;
}
#itemsList{
  overflow: scroll;
  height: 80vh;
}

/* ========================================
   ACCOUNT OFFCANVAS - Stili
   ======================================== */

/* Pulsante Account Trigger */
.btn-account-trigger {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3656b0, #4a6cc5);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(54, 86, 176, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 10px;
  z-index: 1000;
}

.btn-account-trigger:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(54, 86, 176, 0.45);
  background: linear-gradient(135deg, #2a4a9a, #3656b0);
  color: #fff;
}

.btn-account-trigger:active {
  transform: translateY(0) scale(0.98);
}

.btn-account-trigger i {
  font-size: 18px;
}

/* Account Offcanvas Container */
#accountOffcanvas {
  max-width: 380px;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

#accountOffcanvas .offcanvas-body {
  padding: 0;
}

#accountOffcanvas .sidebar {
  height: 100%;
}

/* Account Container */
.account-container {
  padding-top: 10px;
}

/* Account Header */
.account-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #3656b0, #4a6cc5);
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(54, 86, 176, 0.3);
}

.account-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.account-info {
  flex: 1;
}

.account-username {
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
  color: #fff;
}

.account-role {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* Section Title */
.account-section .section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.account-section .section-title i {
  color: #3656b0;
}

/* Recent Routes List */
.recent-routes-list {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.recent-routes-list::-webkit-scrollbar {
  width: 6px;
}

.recent-routes-list::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 10px;
}

.recent-routes-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3656b0, #4a6cc5);
  border-radius: 10px;
}

/* Empty Routes */
.empty-routes {
  padding: 20px;
}

.empty-routes i {
  display: block;
}

/* Route Item */
.route-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.route-item:last-child {
  margin-bottom: 0;
}

.route-item:hover {
  border-color: #3656b0;
  box-shadow: 0 4px 12px rgba(54, 86, 176, 0.1);
  transform: translateX(4px);
}

.route-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  background: #1A2C44;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(54, 86, 175, 0.3);
}

.route-details {
  flex: 1;
  min-width: 0;
}

.route-origin,
.route-destination {
  font-size: 0.85rem;
  color: #495057;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

.route-origin {
  font-weight: 500;
  margin-bottom: 2px;
}

.route-destination {
  color: #6c757d;
}

.route-meta {
  margin-top: 4px;
  font-size: 0.75rem;
}

.route-action-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  background: #f8f9fa;
  color: #dc3545;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
}

.route-item:hover .route-action-btn {
  opacity: 1;
}

.route-action-btn:hover {
  background: #dc3545;
  color: #fff;
}

/* Account Actions */
.account-actions {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.btn-logout {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.btn-logout:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.35);
}

.btn-logout:active {
  transform: translateY(0);
}

/* Pulsante Modifica Profilo */
.btn-edit-profile {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-edit-profile:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
  color: #fff;
}

.btn-edit-profile i {
  font-size: 14px;
}

/* Account Email */
.account-email {
  font-size: 0.8rem;
  display: block;
}

/* Edit Profile Form */
.edit-profile-form {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.edit-profile-form .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 4px;
}

.edit-profile-form .form-control {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  padding: 10px 14px;
  transition: all 0.3s ease;
}

.edit-profile-form .form-control:focus {
  border-color: #3656b0;
  box-shadow: 0 0 0 4px rgba(54, 86, 176, 0.1);
}

.edit-profile-form .form-control::placeholder {
  color: #adb5bd;
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .btn-account-trigger {
    width: 40px;
    height: 40px;
    margin-right: 8px;
  }

  .btn-account-trigger i {
    font-size: 16px;
  }

  #accountOffcanvas {
    max-width: 100%;
  }

  .account-header {
    padding: 16px;
  }

  .account-avatar {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .account-username {
    font-size: 1.1rem;
  }

  .btn-edit-profile {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .btn-edit-profile i {
    font-size: 12px;
  }
}
/* Mappa base in scala di grigi (solo tile OSM, non overlay/marker) */
.leaflet-tile-pane .basemap-grayscale {
  filter: grayscale(100%);
}
