
/*TAG*/

body, html {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

button.btn-sm {
  font-size: 0.8rem;
}

.hidden {
  display:none;
}

/*
-LEAFLET ADD-------------------------------------------------------------------
*/

#map {
  height: 100vh;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0; /* lascia spazio per la sidebar */
  right: 0;
  bottom: 0;
}

.leaflet-control-zoom {
    margin-top: 6px !important;
    margin-left: 6px !important;
}

/* tutti gli elementi interattivi della mappa, tutti i figli (*) tranne (:not) */
/* Area interattiva: tiles e overlay, inclusi marker */
.leaflet-container.routing-active,
.leaflet-container.routing-active *:not(.leaflet-control):not(.leaflet-control *) {
    cursor: crosshair !important;
}



.leaflet-popup-content {
  margin: 8px 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}


/*
-LOCATE GPS-----------------------------------------------------------------------
*/
/* Nasconde il pulsante nativo di locate-control ma mantiene la funzionalità attiva */
.leaflet-control-locate {
    display: none !important;
}

/* Opzionale: classe per far girare la tua icona quando cerca */
.spin-icon {
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Il marker di Leaflet.Locate è solitamente un div con classe .leaflet-control-locate-location */
.marker-on-track {
    filter: hue-rotate(140deg) brightness(1.2); /* Colore Verde */
    z-index: 1000 !important;
}

.marker-searching-track {
    filter: hue-rotate(50deg) saturate(2); /* Colore Giallo/Arancio */
}

.blinking {
    animation: fadeBlink 1.5s infinite;
}

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

/*
-MARKER E COLOR-------------------------------------------------------------------
*/
.leaflet-marker-divicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.marker-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);

  display: flex;
  align-items: center;
  justify-content: center;
}
.fa-marker-circle i {
  font-size: 14px;        /* controlla qui la dimensione */
  line-height: 1;
}
/* colori equivalenti alle tue PNG */
.poi-saved [class^="marker-color-"],
.poi-saved [class*=" marker-color-"] {
  /* regole applicate a TUTTE le classi che iniziano con marker-color-  incluse in poi-saved*/
  border: 1px solid black;
  outline: 2px solid gold;
}
.marker-color-ALLOGGI, #btn_sALLOGGI.active { background: #ff7f0e !important; }  /* success-s.png → verde */
.marker-color-SHELTER, #btn_sSHELTER.active { background: #9467bd !important; }  /* warning-s.png → giallo */
.marker-color-CIBO, #btn_sCIBO.active { background: #6c757d !important; }  /* secondary-s.png → grigio */
.marker-color-ACQUA, #btn_sACQUA.active { background: #17a2b8 !important; }  /* info-s.png → azzurro */
.marker-color-LUOGHI, #btn_sLUOGHI.active { background: #007bff !important; }  /* city-s.png → blu */
.marker-color-TRASPORTI, #btn_sTRASPORTI.active { background: #1f77b4 !important; }  /* city-s.png → blu */
.marker-color-NATURA, #btn_sNATURA.active { background: #2ca02c !important; }  /* city-s.png → blu */
.marker-color-GENERICI, #btn_sGENERICI.active { background: #008080 !important; }  /* city-s.png → blu */
.marker-color-Default  { background: #919191 !important; }     /* eye.png */
.marker-color-green  { background: #28a745; }
.marker-color-red    { background: #dc3545; }
.marker-color-blue   { background: #007bff; }
.marker-color-orange { background: #fd7e14; }
.marker-color-grey   { background: #6c757d; }

.blk_buttons {
  text-align: center;
}


/* Seleziona tutti i percorsi dentro il gruppo dei sentieri e rendili invisibili al mouse */
.leaflet-shadow-pane path, 
.leaflet-overlay-pane path[stroke-dasharray] { 
    pointer-events: none !important;
}


/* Classe per simulare il disabled sul div */
.disabled-btn {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed !important;
    background-color: #f0f0f0 !important;
    border-color: #ccc !important;
}

/*
-badge dei POI salvati-------------------------------------------------------------------
*/
.btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
    padding: 2px 5px;
    pointer-events: none; /* evita problemi col click */
}
.b-btn {
    position: relative; /* fondamentale per ancorare il badge */
}

.b-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
}

/*altri badge*/
#routeBadge {
  font-size: 0.5rem; /* più piccolo di fs-7 */
  line-height: 1;     /* opzionale, per compattezza */
  padding: 0.15em 0.3em; /* riduce leggermente il badge */
}


/*
-MODAL-------------------------------------------------------------------
*/
/*MODAL PER SETTINGS*/

/*
.settings-category { margin-bottom: 1rem; }
.settings-category > .cat-label { font-weight: bold; display: block; margin-bottom: 0.25rem; }
.sub-checkbox { margin-left: 1.5rem; display: block; }
*/

#settingsContainer > ul.list-group > li.list-group-item {
  border-bottom: 1px solid black;
}

#settingsModal .list-group-item {
  border: none;
  padding-bottom: 0.25rem;
}

#settingsModal .toggleIcoCat {
  float: right;
}

/*MODAL PER POI*/

#poiForm input,
#poiForm select,
#poiForm textarea {
    height: 38px;      /* stessa altezza per tutti i campi */
    box-sizing: border-box; /* include padding e bordo nella misura */
}


/*
-UI-------------------------------------------------------------------
*/

#mapMessageBox {
  z-index: 2000;
  /*display:none;*/
  /*pointer-events:auto; auto = può ricevere click, tap, hover, scroll, ecc.*/
}


#searchBox {
  display:none;
  position:absolute;
  top:112px;
  left:50px;
  z-index:1000;
  border-radius:4px;
  border:1px solid #ccc;
}
#searchInput {
  width:220px;
  padding:2px 4px;
}

#searchSuggestions {
  position:absolute;
  top:100%;
  left:0;
  right:0;
  background:#fff;
  list-style:none;
  margin:0;
  padding:0;
  border:1px solid #ccc;
  z-index:9999;
}

#searchSuggestions li{
  padding:8px;
  cursor:pointer;
}

#searchSuggestions li:hover{
  background:#eee;
}


/*
-BOTTOM BAR-------------------------------------------------------------------
*/

#infoActGpx {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #ccc;
    font-size: 14px;
    gap: 10px;
}
#infoActGpx a {
    text-decoration: underline;
    cursor: pointer;
    color: #007bff;
}


#bottomStack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  flex-direction: column;

  /* sopra la mappa */
  z-index: 1000;
}

#bottomBar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}
#bottomBar, #bottomBar2 {
  padding: 6px 10px;
  height: 60px;
  background: #222;
  display: none;
  justify-content: space-around;
  align-items: center;
  color: #fff;
  z-index: 1000;  
}

/* BOTTOM SHEET */
.saved-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
  transform: translateY(100%);
  transition: transform .25s ease;
  padding: 12px;
  z-index: 9999;
}

.saved-sheet.visible {
  transform: translateY(0%);
}

.saved-sheet-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 10px;
}

.sheet-btn {
  width: 100%;
  padding: 10px;
  border: none;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #eee;
}

.sheet-btn.danger {
  background: #ffdddd;
}



#routeInfo {
    display: flex;         /* Attiva il layout flex */
    align-items: center;   /* Allinea verticalmente al centro */
    gap: 12px;             /* Spazio tra bottone e testi */
    padding: 8px;
}

#routeInfo > span {
    flex-grow: 1;          /* Fa sì che i testi occupino lo spazio rimanente */
    text-align: right;     /* Spinge i testi verso destra */
    line-height: 1.2;      /* Migliora la leggibilità con il <br> */
}



/*
-VERTICAL DX-------------------------------------------------------------------
*/

.v-buttons {
  margin-top: 6px !important;
  margin-left: 6px !important;
}

.v-buttons .b-btn {
    margin-bottom: 4px;
    background: #ffffff;
    padding: 16px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.12s, transform 0.08s;
}

/* Hover: stesso grigio di Beatcom */
.v-buttons .b-btn:hover {
    background: #f2f2f2;
}

/* Stato attivo (pulsante blu) */
.v-buttons .b-btn.active {
    background: #1476ff;
    border-color: #1476ff;
    color: white;
}








/*eccezioni button GPS*/
/* Eccezione GPS1: attesa Segnale o sincronizzazione con la mappa (Celeste) */
#btn_gps.searchGPS {
    background: #93bffd !important;
    border-color: #93bffd !important;
}
/* Eccezione GPS2: Libero/Sganciato (Giallo) - Stato: GPS On + Mappa Libera */
#btn_gps.modGPS { /*ex activeMod*/
    background: #ffc014 !important;
    border-color: #ffc014 !important;
    color: white !important;
}

/* MARKER GPS */
/* STATO AGGANCIATO (Viola + Pulsazione) */
.marker-snapped {
    filter: hue-rotate(260deg) brightness(1.2) !important; /* Trasforma in Viola */
}
/* Per CircleMarker SVG (se il plugin usa quelli) */
path.marker-snapped {
    fill: #9b59b6 !important;
    stroke: #ffffff !important;
}
.marker-snapped::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    margin: -4px; /* Centratura rispetto al pallino */
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(155, 89, 182, 0.4);
    animation: pulse-purple 1.5s infinite;
}

/* STATO MANUALE (Giallo) */
/*.marker-manual {
    filter: hue-rotate(45deg) brightness(1.5) !important; /* Trasforma in Giallo 
}*/

@keyframes pulse-purple {
    0% { box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(155, 89, 182, 0); }
    100% { box-shadow: 0 0 0 0 rgba(155, 89, 182, 0); }
}





/*
-horizontal DX-------------------------------------------------------------------
*/
.o-buttons-horizontal {
  display: flex;
  flex-direction: row; /* fila orizzontale */
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 8px;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.o-buttons-horizontal .b-btn {
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  background: #f0f0f0;
  transition: all 0.2s;
}

.o-buttons-horizontal .b-btn.active {
  background: #007bff;
  color: #fff;
}


@media (max-width: 768px) {
    .leaflet-control-layers {
        transform: scale(1.1);
    }
}
.leaflet-touch .leaflet-control-layers-toggle {
    width: 44px;
    height: 44px;
}
.leaflet-control-layers-toggle {
    background-color: rgba(255,255,255,0.9);
    border-radius: 4px;
}


/* SETTING ROUTING ------------------------------------------------------------- */

.routing-section {
  display: none;
}


#elevationContainer {
  height:250px;  /* altezza fissa visibile */
  background:white;
  box-shadow:0 0 10px rgba(0,0,0,0.3);
  z-index:1000;
}




/* GPS ------------------------------------------------------------------------- */
.user-dot {
  width: 14px;
  height: 14px;
  background: #1e90ff;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(30, 144, 255, 0.8);
}




/* Forza il contenitore Leaflet in alto a destra a disporre i figli in riga */
.leaflet-top.leaflet-right {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Allinea i pulsanti in alto */
    gap: 10px;               /* Spazio tra il selettore layer e i tuoi bottoni */
}
/* Rimuove eventuali margini che potrebbero sballare l'allineamento */
.leaflet-right .leaflet-control {
    margin-left: 0 !important;
    margin-right: 10px !important; /* Margine esterno destro */
}
/* Assicura che il tuo contenitore personalizzato sia inline-flex */
.o-buttons-horizontal.leaflet-control {
    display: flex !important;
    flex-direction: row;
    white-space: nowrap;     /* Impedisce ai bottoni di andare a capo */
}



/* Rimuove lo stile di default del fumetto Leaflet */
.km-marker-label {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #333 !important; /* Colore del numero */
    font-weight: bold !important;
    font-size: 11px !important;
    padding: 0 !important;
}

/* Rimuove la "freccetta" del fumetto */
.km-marker-label::before {
    display: none !important;
}



/*per layer aregioni*/
.region-label {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}


/*per layer aree protette*/
.area-tooltip {
    background: rgba(0, 100, 0, 0.8);   /* verde scuro semi-trasparente */
    color: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border: none;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.leaflet-popup-content-wrapper {
    background: #f8fff8; /* sfondo chiaro verde */
    color: #006600;
}


.panoramici-tooltip {
    background: rgba(255,102,0,0.9);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    padding: 3px 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.panoramici-tooltip::before { border-top-color: rgba(255,102,0,0.9) !important; }