/* Wrapper para centrar y ajustar ancho */
.video-wrapper {
  width: 100%;
  max-width: 800px; /* Ajusta si deseas limitar el ancho en desktop */
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

/* Contenedor con relación de aspecto 16:9 */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background-color: #000;
  overflow: hidden;
  border-radius: 8px;
}

/* Video ocupa todo el contenedor */
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  background-color: #000;
}

/* Controles */
.controls-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px;
}

/* Botones genéricos */
.control-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2em;
  margin: 0 5px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.control-btn:hover {
  color: #ddd;
}

/* Barra de progreso */
.progress-bar {
  flex: 1;
  margin: 0 5px;
  cursor: pointer;
  appearance: none;
  height: 5px;
  background: #444;
  border-radius: 2.5px;
  outline: none;
}

.progress-bar::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.progress-bar::-webkit-slider-thumb:hover {
  background: #ddd;
}

.progress-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.progress-bar::-moz-range-thumb:hover {
  background: #ddd;
}

/* Barra de volumen */
.volume-bar {
  width: 80px;
  margin: 0 5px;
  cursor: pointer;
  appearance: none;
  height: 5px;
  background: #444;
  border-radius: 2.5px;
  outline: none;
}

.volume-bar::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.volume-bar::-webkit-slider-thumb:hover {
  background: #ddd;
}

.volume-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.volume-bar::-moz-range-thumb:hover {
  background: #ddd;
}

/* Textos (tiempo) */
.time-label {
  color: #fff;
  font-size: 0.9em;
  margin: 0 3px;
}

/* Evitar selección de texto en los controles */
.controls-container,
.controls-container * {
  user-select: none;
}

/* Responsive */
@media (max-width: 600px) {
  .control-btn {
    font-size: 1em;
  }
  .volume-bar {
    width: 60px;
  }

  /* Ajuste de íconos para pantallas pequeñas */
  .play-icon {
    border-left: 20px solid #fff;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
  }

  .pause-icon {
    width: 20px;
    height: 20px;
  }

  .pause-icon::before,
  .pause-icon::after {
    width: 5px;
    height: 20px;
  }
}

/* Overlay de play y pause */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3); /* Semi-transparente */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.play-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Ícono de play y pause */
.play-icon,
.pause-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Ícono de play */
.play-icon {
  width: 0;
  height: 0;
  border-left: 30px solid #fff; /* Triángulo blanco */
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
}

.play-icon:hover {
  transform: scale(1.1);
  border-left-color: #ddd; /* Cambio de color al hacer hover */
}

/* Ícono de pausa */
.pause-icon {
  width: 30px;
  height: 30px;
  position: relative;
  display: flex;
  justify-content: space-between;
}

.pause-icon::before,
.pause-icon::after {
  content: '';
  display: block;
  width: 8px;
  height: 30px;
  background-color: #fff;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.pause-icon::before {
  margin-right: 5px;
}

.pause-icon::after {
  margin-left: 5px;
}

.pause-icon:hover::before,
.pause-icon:hover::after {
  background-color: #ddd;
}

.pause-icon.hidden {
  opacity: 0;
  pointer-events: none;
}
