/* General Styles */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: #282c34;
  color: #ffffff;
  overflow: hidden;
}

.orientation-message {
  display: none;
}

/* Contenedor principal de video */
#video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Video y Canvas */
#video,
#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Botones Laterales (Ocultar paneles, Cambiar cámara) */
#right-buttons {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px; /* Espacio vertical entre estos botones */
  pointer-events: auto;
  z-index: 999;
}

#right-buttons button {
  width: 85px;
  height: 85px;
  padding: 5px;
  background-color: #61dafb;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  cursor: pointer;
  outline: none; /* Quita contorno */
  transition: background-color 0.3s ease;
}

#right-buttons button:focus {
  outline: none;
  box-shadow: none;
}

/* Imágenes dentro de los botones laterales */
#right-buttons button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Overlay principal */
#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Panel lateral (deslizadores) */
#side-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: rgba(32,35,42,0.4);
  padding: 10px;
  pointer-events: auto;
  transform: scale(0.8);
  transform-origin: top left;
  /* Cambia la fuente para todo lo que está dentro del panel */
  font-family: "Helvetica", Arial, sans-serif;
  font-size: 1em;
  color: #fff; /* si deseas color de texto */
}

#side-controls label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 1.2em;
}

#side-controls input {
  margin-bottom: 20px;
  width: 300px;
  height: 20px;
}

/* Controles principales con íconos de 85px */
#controls {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px; /* Espacio horizontal entre botones principales */
  justify-content: center;
  background-color: rgba(32,35,42,0.4);
  padding: 20px;
  border-radius: 12px;
  pointer-events: auto;
  box-shadow: 0 4px 8px rgba(0,0,0,0.0);
}

#controls button {
  width: 85px;
  height: 85px;
  background-color: #61dafb;
  color: #20232a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.3s ease;
}

/* Quitar outline */
#controls button:focus {
  outline: none;
  box-shadow: none;
}

/* Imágenes dentro de botones principales */
#controls button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 
   Cuando el botón "Anterior Captura" (toggle-overlay) está activo,
   pasamos a color blanco. 
   => Agregamos la clase "active" en JS
*/
#toggle-overlay.active {
  background-color: #ffffff !important; /* Fondo blanco */
  color: #20232a !important;           /* Texto oscuro, si tuviera */
}

/* Si quieres invertir el ícono para que se vea blanco, puedes hacer: 
#toggle-overlay.active img {
  filter: invert(1);
}
*/

/* Timeline Container */
#timeline-container {
  position: absolute;
  /* Ajustar bottom para subir el timeline */
  bottom: 180px; /* Valor para subir un poco más (antes 155px) */
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  background-color: rgba(32,35,42,0.6);
  padding: 0.3px;
  border-radius: 10px;
  pointer-events: auto;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap; 
}

/* Cinta de miniaturas */
#timeline {
  display: inline-flex;
  gap: 10px;
  pointer-events: auto;
}

/* Miniaturas */
#timeline img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

/* Miniatura seleccionada */
#timeline img.selected {
  border-color: #ff9800;
}

/* Efecto de parpadeo (Grabando) */
.blinking {
  animation: blinker 1s linear infinite;
}

@keyframes blinker {
  60% {
    opacity: 0.1;
  }
}

/* Modo Portrait / Móvil (opcional) */
@media screen and (orientation: portrait) {
  .orientation-message {
    display: flex;
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.5em;
    z-index: 9999;
  }
  body.portrait #video-container,
  body.portrait #overlay {
    display: none;
  }
}






/* Estilo General del input[type=range] (para quitar estilos por defecto) */
input[type=range] {
  -webkit-appearance: none; /* Quita estilo por defecto en Chrome/Safari */
  -moz-appearance: none;    /* Quita estilo por defecto en Firefox */
  width: 300px;             /* Ajusta el ancho si lo deseas */
  height: 8px;              /* Grosor aproximado del “track” */
  background: transparent;  /* Para que no interfiera */
  outline: none;            /* Quitar outline por defecto */
}

/* TRACK (barra de fondo) en navegadores WebKit (Chrome, Safari...) */
input[type=range]::-webkit-slider-runnable-track {
  height: 8px;
  background: #aaa; /* Cambia el color del track */
  border-radius: 4px;
  border: 1px solid #444;
}

/* THUMB (botón) en navegadores WebKit */
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px; 
  height: 30px; 
  background: #61dafb; /* Color que quieras para el “thumb” */
  border-radius: 50%;
  border: 7px solid #000000; /* Borde, si lo deseas */
  cursor: pointer;        /* Indicador de que se puede arrastrar */
  margin-top: -6px;       /* Para alinear el thumb verticalmente con el track */
}

/* Hover sobre el THUMB (opcional) */
input[type=range]::-webkit-slider-thumb:hover {
  background: #81e0ff; /* Un color más claro al hover, por ejemplo */
}

/* TRACK en Firefox */
input[type=range]::-moz-range-track {
  height: 8px;
  background: #aaa;   /* Mismo color de track que en WebKit */
  border-radius: 4px;
  border: 1px solid #444;
}

/* THUMB en Firefox */
input[type=range]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  background: #61dafb; /* Mismo color para el thumb */
  border: 7px solid #000000;
  border-radius: 50%;
  cursor: pointer;
}

/* Opcional: para Edge/IE (legacy) se usa -ms prefijos ... 
   pero muchos proyectos modernos no lo necesitan. */
