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

  #map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
  }

  #controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
  }

  #progressBar {
    width: 200px;
  }


  .modal {
    position: fixed;
    z-index: 10;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex; justify-content: center; align-items: center;
  }
  .modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
  }
  .modal-content button {
    margin: 5px;
  }


  
  #recordingProgressBar {
    width: 100%;
  }
  
  #cancelRecordingButton {
    margin-top: 10px;
  }
  

  .maplibregl-ctrl-select {
    background-color: white;
    color: black;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 12px;
  }
  


  #resolutionModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }
  
  #resolutionModal .modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
  }
  
  #resolutionModal h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
  }
  
  #resolutionModal .grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
  }
  
  #cancelRecordingButton,
  #resolutionModal .resolutionOption,
  #resolutionModal #customResolutionBtn,
  #resolutionModal #confirmCustomResolution,
  #resolutionModal #cancelResolutionModal {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    text-align: center;
  }
  
  #resolutionModal .resolutionOption:hover,
  #resolutionModal #customResolutionBtn:hover,
  #resolutionModal #confirmCustomResolution:hover,
  #resolutionModal #cancelResolutionModal:hover {
    background-color: #0056b3;
  }
  
  #resolutionModal #customResolutionInputs {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  
  #resolutionModal input[type="number"] {
    width: 70px;
    padding: 6px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
  }
  
  #videoDurationContainer {
    margin-top: 12px;
    font-size: 14px;
  }
  
  #videoDurationContainer input {
    padding: 6px;
    font-size: 14px;
    width: 60px;
    margin-left: 5px;
    text-align: center;
  }
  
  #resolutionModal #customResolutionBtn {
    margin-top: 12px;
  }
  
  #resolutionModal #cancelResolutionModal {
    margin-top: 12px;
  }
  

  /* Contenedor del buscador */
#searchContainer {
  position: absolute;
  top: 10px;
  left: 10px;
  background: white;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  z-index: 1000;
}

/* Input de búsqueda */
#searchInput {
  width: 200px;
  padding: 8px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  background: #f1f1f1;
  transition: background 0.3s ease;
}

#searchInput:focus {
  background: white;
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
}

/* Botón de búsqueda */
#searchButton {
  margin-left: 8px;
  padding: 8px;
  border: none;
  border-radius: 50%;
  background: #4285f4;
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s ease;
}

#searchButton:hover {
  background: #3367d6;
}

/* Resultados de búsqueda */
#searchResults {
  display: none;
  position: absolute;
  top: 45px;
  left: 0;
  background: white;
  width: 100%;
  max-height: 500px;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  padding: 5px 0;
}

.search-item {
  padding: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
  border-bottom: 1px solid #ddd;
}

.search-item:hover {
  background: #f1f1f1;
}

.search-meta {
  font-size: 12px;
  color: gray;
}

#uploadYouTubeButton,
#saveVideoButton {
  display: none; /* Se oculta hasta que se genera el vídeo */
  margin-top: 10px;
  width: 100%;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

#uploadYouTubeButton:hover,
#saveVideoButton:hover {
  background-color: #0056b3;
}


#recordingModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 1000;
  color: black;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw; /* 🔄 Permitir que el modal sea más ancho */
  max-height: 90vh; /* 🔄 Evitar que salga de la pantalla */
  overflow: auto; /* 🔄 Añadir scroll si el vídeo es muy grande */
}

/* 📹 Ajustar el tamaño del reproductor de vídeo */
#videoPreview {
  display: none;
  width: 100%;
  height: auto;
  max-height: 80vh; /* 🔄 Ajustar la altura según la pantalla */
  margin-top: 10px;
  border-radius: 5px;
}


#recordingStatus {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#saveVideoButton, #closeModalButton {
  width: 100%;
  margin-top: 10px;
}



#uploadModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1001; /* Asegurar que está por encima del mapa */
}

#uploadModal h3 {
  text-align: center;
}

#uploadModal input,
#uploadModal select {
  width: 100%;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#uploadModal button {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  border-radius: 5px;
  transition: background 0.3s ease;
}

#confirmUpload {
  background: #007bff;
  color: white;
}

#confirmUpload:hover {
  background: #0056b3;
}

#cancelUpload {
  background: #dc3545;
  color: white;
}

#cancelUpload:hover {
  background: #a71d2a;
}
