/* Contenedor principal del reproductor */
.nixia-player {
  position: fixed; /* Ocupa toda toda la pantalla sin moverse al hacer scroll */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Inter', sans-serif;
}

/* Video */
.nix-video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Mantiene proporción del video */
  display: block;
}

/* Controles generales */
.nix-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20; /* Aumentado para asegurar que esté sobre otros elementos */
}

.nixia-player:hover .nix-controls,
.nixia-player:focus-within .nix-controls {
  opacity: 1;
}

/* Línea de tiempo (arriba) */
.nix-timeline {
  width: 100%;
  height: 4px;
  appearance: none;
  background: rgba(255, 255, 255, 0.2); /* Base color for the timeline */
  border-radius: 2px;
  cursor: pointer;
  /* La propiedad background de este elemento será actualizada por JS para el degradado de progreso */
}

/* Ocultar el track predeterminado del input range */
.nix-timeline::-webkit-slider-runnable-track {
  background: transparent;
}
.nix-timeline::-moz-range-track {
  background: transparent;
}

/* Barra inferior con botones */
.nix-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
}

/* Grupo izquierdo: Botones principales */
.nix-control-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0; /* Evita que se comprima */
}

/* Botones comunes */
.nix-control-buttons button,
.nix-config-btn,
.nix-play,
.nix-volume,
.nix-pip,
.nix-fullscreen {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.3s ease;
}

/* Efecto hover opcional */
.nix-control-buttons button:hover,
.nix-config-btn:hover,
.nix-pip:hover, /* Nuevo: Hover para PiP */
.nix-fullscreen:hover { /* Nuevo: Hover para Fullscreen */
  color: #00ffff;
}

/* Volumen */
.nix-volume-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nix-volume-slider {
  width: 80px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.4); /* Base color for the volume slider */
  border-radius: 2px;
  appearance: none;
  /* La propiedad background de este elemento será actualizada por JS para el degradado de progreso */
}

.nix-volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
}

/* Indicador de tiempo */
.nix-time {
  color: white;
  font-size: 13px;
  min-width: 80px;
  text-align: right;
  white-space: nowrap;
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* Grupo derecho: Configuración, PiP y Pantalla completa */
.nix-right-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Menú contextual */
.nix-context-menu {
  position: fixed;
  background: #222222ab;
  border: 1px solid #444;
  padding: 5px;
  border-radius: 4px;
  color: white;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.nix-context-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nix-context-item:hover {
  background: #444;
}
.nix-context-submenu {
  padding: 5px 10px;
  font-weight: bold;
  color: #aaa;
}

.nix-context-item.nix-context-small {
  font-size: 13px;
  padding: 4px 28px;
}
/* Tooltip sobre la línea de tiempo */
.nix-tooltip {
  position: absolute;
  bottom: 40px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transform: translateX(-50%);
  display: none;
  z-index: 100; /* Incrementado para asegurar visibilidad */
}

/* Contenedor del overlay de play central */
.nix-overlay-play-container {
  position: absolute;
  top: 50%; /* Ajustado a 50% para centrado */
  left: 50%; /* Ajustado a 50% para centrado */
  transform: translate(-50%, -50%); /* Para centrarlo */
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 10; /* Menor que los controles inferiores para que no los cubra */
  cursor: pointer;
  /* Eliminado display y pointer-events de aquí, ahora controlados por JS */
}


/* Círculo de fondo para el icono de play */
.nix-overlay-play-circle {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #afafaf75;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease, opacity 0.4s ease;
  will-change: transform, opacity;
}

/* Icono de play central */
.nix-overlay-play {
  font-size: 27px;
  color: white;
  z-index: 1;
  transition: transform 0.4s ease, opacity 0.4s ease;
  will-change: transform, opacity;
}

/* Hover conjunto: círculo + ícono */
.nix-overlay-play-circle:hover,
.nix-overlay-play-circle:hover .nix-overlay-play {
  transform: scale(1.15);
  opacity: 1;
}

/* Animación de salida */
@keyframes overlayZoomOutFade {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.nix-overlay-animating-out {
  animation: overlayZoomOutFade 0.5s ease-in-out forwards;
}

/* Animación de entrada */
@keyframes overlayZoomInFade {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.nix-overlay-animating-in {
  animation: overlayZoomInFade 0.5s ease-out forwards;
}

/* Menú de configuración */
.nix-config-menu {
  position: absolute;
  right: 10px;
  bottom: 60px;
  background: rgba(34, 34, 34, 0.9);
  color: white;
  padding: 10px;
  border-radius: 6px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  width: 160px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.nix-config-menu.open {
  display: flex;
}

.nix-config-option label {
  font-size: 13px;
  margin-bottom: 4px;
  color: #bbb;
}

.nix-config-option select {
  width: 100%;
  padding: 4px;
  background: #333;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 600px) {
  .nix-control-buttons {
    gap: 6px;
    font-size: 16px;
  }

  .nix-volume-wrapper {
    display: none;
  }

  .nix-time {
    font-size: 12px;
    min-width: 60px;
  }

  .nix-right-buttons {
    gap: 6px;
  }

  .nix-overlay-play-circle {
    width: 60px; /* Ajustar tamaño para móviles */
    height: 60px;
  }
  .nix-overlay-play {
    font-size: 20px; /* Ajustar tamaño para móviles */
  }
}
