/* Reset e font base */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Welcome screen */
#welcomeScreen {
  background-image: url('A_2D_digital_graphic_welcome_screen_for_GPAmaps_ap.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0px;
  height: 100vh;
}

/* Seconda schermata */
#capScreen {
  background-image: url('A_2D_digital_graphic_welcome_screen_for_GPAmaps_ap.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 120px;
  height: 100vh;
}

/* Mappa */
#mapScreen {
  position: relative;
  height: 100vh;
  width: 100%;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 0;
}

#liveMap {
  height: 100vh;
  width: 100%;
  
}
/* Logo */
.logo {
  width: 250px;
  height: auto;
  margin-bottom: 20px;

  opacity: 0;              /* invisibile all'inizio */
  transform: scale(0.8);  /* un po' piccolo */

  animation: logoEnter 1s ease-out forwards;
}

@keyframes logoEnter {
  to {
    opacity: 1;           /* diventa visibile */
    transform: scale(1);  /* torna normale */
  }
}

/* Titoli */
h1, h2 {
  color: white;
  margin-bottom: 15px;
  text-align: center;
}
h1 {
  font-size: 40px;   /* rende “Benvenuto” più grande */
  margin: 10px 0;   /* meno spazio sopra e sotto */
}

/* Input, select, button base */
input, select, textarea, button {
  font-size: 16px;
  border-radius: 12px;
  border: none;
  outline: none;
  text-align: center;
  box-sizing: border-box;
}

/* Input e select */
input, select {
  width: 80%;
  padding: 12px;
  margin: 10px 0;
}

/* Textarea */
textarea {
  width: 100%;
  padding: 10px;
  resize: none;
}

/* Pulsanti */
button {
  background-color: #007aff;
  color: white;
  padding: 12px 30px;
  font-size: 18px;
  margin-top: 10px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

#continueBtn1, #continueBtn2 {
  font-size: 22px;
  padding: 18px 40px;
  border-radius: 16px;
}

#continueBtn2 {
  margin-top: 30px;
}

/* Label lingua */
#langLabel {
  color: white;
  font-weight: bold;
  margin-top: 20px;
}

/* Draggable sheet principale */
#draggableSheet,
#draggableSheetNav {
  touch-action: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(100vh - 20px);
  background-image: url('A_2D_digital_graphic_welcome_screen_for_GPAmaps_ap.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: top 0.1s;
  padding: 20px;
  color: white;
}

/* Maniglia per trascinare */
#dragHandle, #dragHandleNav {
  width: 50px;
  height: 5px;
  background-color: #ccc;
  border-radius: 3px;
  margin: 0 auto 10px auto;
}

/* Riga input */
.input-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.input-row input {
  width: 48%;
}

/* Pulsanti in riga */
.button-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.button-row button {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  background-color: #007bff;
  font-weight: bold;
}

/* Pulsanti elenco fermate */
.sheet-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

#btnNav {
  grid-column: span 2;
  background-color: #0059b3;
}

/* Box info percorso */
#infoBox {
  background-color: #00264d;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 16px;
  margin-top: 15px;
}

/* Elenco fermate */
#elencoFermateContainer {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 20px;
}

#fermateList {
  list-style: none;
  padding-left: 0;
}

#fermateList li {
  padding: 6px 0;
  border-bottom: 1px solid #ffffff33;
}

/* Nasconde il pannello di Leaflet Routing */
.leaflet-routing-container,
.leaflet-control-container .leaflet-routing-alternatives-container {
  display: none !important;
  pointer-events: none !important;
}
.button-row.full-width {
  margin-top: 10px;
}

.button-row.full-width button {
  width: 100%;
  height: 50px;
  font-size: 18px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
}
.spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  /* CENTRA orizzontalmente e verticalmente */
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.3); /* sfondo semi-trasparente */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner img {
  width: 400px;
  height: 400px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hidden {
  display: none;
}
#navigazioneMappa {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

	/* === Stile personalizzato per il marker della macchina === */
.leaflet-marker-icon.macchina-marker {
  border-radius: 50%;
  box-shadow: 0 0 10px red;
}

/* Pulsante Indietro */
#backToFermateBtn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  color: black;
  font-size: 20px;
  font-weight: bold;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}
#mapNavigazione {

  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
  z-index: 1;
}
	#infoNavigazione {
  position: fixed;
  top: 90px;
  right: 12px;
  background: white;
  color: black;
  font-size: 16px;
  font-weight: bold;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: auto;
  min-width: 110px;
}
#orologio, #velocita {
  font-weight: bold;
}
.btn-mappa {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: white;
  color: black;
  border: 1px solid #ccc;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
#navigazioneMappa 
	.btn-cerchio {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: white;
  color: black;
  font-size: 20px;
  font-weight: bold;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.leaflet-control-zoom {
  display: none !important;
}
.cerchio-num {
  background-color: black;
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  text-align: center;
  line-height: 26px;
  font-weight: bold;
  font-size: 14px;
  border: 2px solid white;
}

.cerchio-num.bianco {
  background-color: white;
  color: black;
  border: 2px solid #666;
}
#welcomeTitle {
  opacity: 0;
  transform: translateY(30px);

  animation: titleEnter 1s ease-out forwards;
  animation-delay: 0.3s;
}

@keyframes titleEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#langLabel, #languageSelect, #continueBtn1 {
  opacity: 0;
  transform: translateY(20px);

  animation: fadeUp 0.8s ease forwards;
}

#langLabel { animation-delay: 0.6s; }
#languageSelect { animation-delay: 0.8s; }
#continueBtn1 { animation-delay: 1s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#welcomeScreen {
  animation: bgMove 10s linear infinite;
}

@keyframes bgMove {
  0% { background-position: center; }
  50% { background-position: 55% 45%; }
  100% { background-position: center; }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(1.05);
  }
}
#langLabel {
  margin-top: 10px;   /* meno spazio sopra */
}

select {
  margin: 5px 0 15px 0;  /* sistema spazio sopra e sotto */
}
.fermata {
  display: flex;          /* 🔥 mette tutto in riga */
  align-items: center;    /* 🔥 li allinea bene */
  gap: 10px;              /* spazio tra elementi */
  margin-top: 10px;
}

.inputFermata {
  flex: 3;
  padding: 10px;
  height: 45px;
}

.inputMinuti {
  flex: 1;
  padding: 10px;
  text-align: center;
  height: 45px;
}
.fermata button {
  background: none;        /* ❌ niente sfondo */
  border: none;            /* ❌ niente bordo */
  color: red;              /* ✅ X rossa */

  font-size: 22px;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: transform 0.1s ease, color 0.2s ease;
}

.fermata button:active {
  transform: scale(0.8);
}

.fermata button:hover {
  color: darkred;
}
#fermateScroll {
  max-height: 140px;   /* 🔥 altezza blocco */
  overflow-y: auto;    /* 🔥 scroll solo qui */
  margin: 10px 0;
}