/* css/retro-tv-player2.css */

/* --- ESTILOS BASE (MOBILE-FIRST) --- */

.tv-player-wrapper {
  display: flex;
  justify-content: center; /* Centra horizontalmente */
  align-items: center; /* Centra verticalmente */
  /*min-height: calc(100vh - 150px); /* Ocupa toda la altura de la pantalla menos el espacio para el header */
  width: 70%;
  padding: 20px;
  box-sizing: border-box;

  /* Por defecto (móvil), los elementos están apilados */
  flex-direction: column;
  gap: 20px;
  margin-left: auto;
  margin-right: auto;
}

.tv-container {
  /* ¡LA MAGIA DE CLAMP! width: clamp(MINIMO, PREFERIDO, MAXIMO); */
  /* Nunca será más pequeño que 300px. */
  /* Intentará ocupar el 90% del ancho de la ventana (90vw). */
  /* Nunca será más grande que 1120px. */
  width: clamp(300px, 90vw, 1120px);

  aspect-ratio: 800 / 650; /* Mantiene la proporción perfecta siempre */
  background-image: url("../images/tv-frame.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
}

#youtube-player,
#static-noise {
  position: absolute;
  top: 13.2%;
  left: 14.1%;
  width: 71.5%;
  height: 64.5%;
  border-radius: 10px;
  overflow: hidden;
}

#youtube-player {
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
}

#static-noise {
  background: url("../images/static-tv-static.gif") center/cover;
  opacity: 0;
  /* --- CORRECCIÓN MÓVIL --- */
  /* La propiedad 'display: none' causaba el problema. Al estar oculto, 
       el JavaScript no podía cambiar su opacidad. Lo mantenemos siempre como 'block'. */
  display: block;
  z-index: 20;
  transition: opacity 0.3s ease; /* Añadimos una transición suave */
}

.remote-control {
  /* También usamos clamp para un tamaño proporcional y con límites */
  width: clamp(140px, 18vw, 200px);

  aspect-ratio: 200 / 350; /* Mantiene la forma del control */
  background-image: url("../images/remote-control.png");
  background-size: contain;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  box-sizing: border-box;
}

.remote-control ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: center;
  margin-top: -60px;
}

.remote-control li {
  margin-bottom: 8px; /* Espacio entre los botones */
}

.remote-control button {
  background: none;
  border: none;
  color: #000000;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 14px;
  width: 78%; /* Ancho del área clickeable */
  padding: 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Estilo específico para el botón POWER */
#power-btn {
  background-color: #d90429;
  color: white;
  border-radius: 8px;
  font-weight: normal;
  height: 20px;
}

.remote-control button:hover {
  transform: scale(1.1);
}

.remote-control button:active {
  transform: scale(1.05);
  color: #000;
}

/* ... (todos los estilos anteriores de retro-tv-player.css) ... */

/* --- ESTILOS PARA LAS ZONAS DE CLIC EN EL MARCO DE LA TV --- */

.tv-frame-buttons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10; /* Se asegura de que estén por encima de la TV pero por debajo de la estática si es necesario */
}

.frame-btn {
  position: absolute;
  cursor: pointer;
  border-radius: 50%; /* La mayoría de los botones en la imagen son redondos */

  /* 
      TRUCO DE DEPURACIÓN: 
      Quita el comentario de la siguiente línea para ver dónde están tus zonas de clic.
      ¡Esto es súper útil para ajustarlas!
    */
  /*border: 2px solid red;*/
}

/* 
  ¡AJUSTE CRÍTICO! 
  Debes ajustar los valores 'top', 'left', 'width' y 'height' de cada botón
  para que coincidan perfectamente con la ubicación en tu imagen tv-frame.png.
  Estos son valores de EJEMPLO.
*/

#power-frame-btn {
  bottom: 6.3%;
  right: 36%;
  width: 30px;
  height: 30px;
}

#ch-up-frame-btn {
  bottom: 7.3%;
  right: 49%;
  width: 13px;
  height: 13px;
}

#ch-down-frame-btn {
  bottom: 7.3%;
  right: 52%;
  width: 13px;
  height: 13px;
}

#vol-up-frame-btn {
  bottom: 7.3%;
  right: 55%;
  width: 13px;
  height: 13px;
}

#vol-down-frame-btn {
  bottom: 7.3%;
  right: 58%;
  width: 13px;
  height: 13px;
}

/* --- ESTILOS PARA LAS ZONAS DE CLIC Y LED EN EL MARCO DE LA TV --- */

/* --- ESTILO Y POSICIÓN DEL LED --- */
#power-led {
  position: absolute;
  /* Valores de EJEMPLO - ¡ajústalos! */
  bottom: 7.3%;
  right: 45%;
  width: 17px;
  height: 17px;
  background-color: #1a1a1a; /* Color oscuro cuando está apagado */
  border-radius: 50%;
  border: 1px solid #000;
  transition: all 0.3s ease; /* Transición suave */
}
/* Clase que se añadirá con JS para encender el LED */
#power-led.on {
  background-color: #00ff00; /* Verde brillante */
  box-shadow: 0 0 10px #00ff00, 0 0 15px #adff2f; /* Efecto de brillo */
}
/*
¡AJUSTE CRÍTICO!
He reorganizado y añadido los botones según tu descripción.
Debes ajustar los valores 'top/bottom', 'left/right', 'width' y 'height'
para que coincidan perfectamente con TU imagen tv-frame.png.
*/

/* Botones de Canal (a la izquierda del LED) */

/* Botón de Play/Pause (más a la izquierda) */
#play-pause-frame-btn {
  bottom: 7.3%;
  left: 36.5%; /* Usamos 'left' para el del extremo opuesto */
  width: 13px;
  height: 13px;
}

/* --- MEDIA QUERY PARA PANTALLAS GRANDES (ESCRITORIO) --- */
@media (min-width: 900px) {
  .tv-player-wrapper {
    flex-direction: row; /* Ponemos los elementos uno al lado del otro */
    align-items: flex-end; /* Los alineamos por la base */
    gap: 40px; /* Aumentamos el espacio entre ellos */
    margin-right:140px;
    margin-top: 60px;
  }

  .tv-container {
    /* --- CORRECCIÓN TAMAÑO ESCRITORIO --- */
    /* Tamaño original: 800px. 800 * 1.40 = 1120px */
    width: 1120px;
    aspect-ratio: 800 / 650; /* Mantenemos la proporción automáticamente */
    height: auto; /* Dejamos que la altura se ajuste sola */
    margin-bottom: 0;
  }

  .remote-control {
    /* --- CORRECCIÓN TAMAÑO ESCRITORIO --- */
    /* Tamaño original: 200px. 200 * 0.70 = 140px */
    width: 140px;
    /* Para la altura, mantenemos la proporción del control */
    height: 245px;
  }

  .remote-control ul {
    margin-bottom: 58;
  }
}
