/* =====================================================
   AUDIO CONTROL - CSS COMPLETO (Con comentarios en ES)
   Mantén las rutas (fonts / img) correctas en tu proyecto.
   ===================================================== */

/* ------------------ FUENTES PERSONALIZADAS ------------------ */
/* Define aquí tus fuentes locales. Asegúrate de que las rutas sean correctas. */
@font-face {
  font-family: "Open24Display";
  src: url("../fonts/Open24Display.ttf") format("truetype");
}
@font-face {
  font-family: "Righteous";
  src: url("../fonts/Righteous-Regular.ttf") format("truetype");
}

/* ------------------ RESET / BASE ------------------ */
/* Estilos base y contenedor principal */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: #121212;                 /* fondo oscuro */
  color: #fff;                         /* texto principal blanco */
  font-family: "Quicksand", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

/* Contenedor central (máximo ancho para pantallas grandes) */
.container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0 3rem 0;
}

/* ------------------ HEADER ------------------ */
/* Cabecera principal con título */
.page-header {
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 0.2rem;
  color: #ffca28;
}
.page-header h2 {
  margin: 0;
  font-family: Righteous, "Quicksand", sans-serif;
  letter-spacing: 1px;
  font-weight: 400;
  font-size: 1.6rem;
}

/* ------------------ PANEL PRINCIPAL (DISPLAY) ------------------ */
/* Card principal que contiene el display, botones y volumen */
#control {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 1.2rem;
  margin-top: 1.2rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Display con el GIF del espectro (mantén tu ruta) */
#display {
  background: #4caf50; /* fallback si gif no carga */
  background-image: url("../img/spectro.gif"); /* GIF de espectro */
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 80% auto;
  border-radius: 8px;
  color: #000;               /* texto sobre el rectángulo verde */
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: center;
}

/* Texto en el display */
#display strong {
  font-size: 1.05rem;
  color: #fff176;
  display: block;
}
#display p {
  margin: 0.2rem 0;
  font-size: 0.95rem;
  color: rgba(0,0,0,0.85);
  opacity: 0.95;
}

/* Reloj grande y tipografía de display */
#reloj {
  font-size: 1.9rem;
  font-weight: 700;
  font-family: "Open24Display", monospace;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0,0,0,0.6);
}

/* Indicadores pequeños debajo del display */
#display span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.75);
}

/* ------------------ GRUPO DE CONTROLES (BOTONES + VOLUMEN) ------------------ */
/* Contenedor que alinea botones y control de volumen en línea */
.controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 1rem;
  justify-content: flex-start;
}

/* ---------------------------------------------------------
   BOTONES PRINCIPALES - estilo coherente con el knob
   (circular, con borde, glow en hover y efecto presionado)
   --------------------------------------------------------- */
.btn-action {
  width: 64px;                      /* tamaño ligeramente más grande */
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a2a2a, #141414);
  border: 3px solid #555;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-family: Righteous, sans-serif;
  font-size: 1.35rem;               /* tamaño del icono */
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow:
    0 0 4px #000 inset,
    0 6px 18px rgba(0,0,0,0.6);
}

/* Iconos dentro del botón (si usas <i>) */
.btn-action i.material-icons {
  font-size: 1.6rem;
  transition: color 0.18s;
}

/* Hover (brillo tipo LED) */
.btn-action:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: #00eaff;
  box-shadow:
    0 0 12px rgba(0,234,255,0.25),
    0 12px 24px rgba(0,0,0,0.6);
  color: #00eaff;
}
.btn-action:hover i.material-icons {
  color: #00eaff;
}

/* Active / presionado (retroceso) */
.btn-action:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow:
    0 0 6px rgba(0,234,255,0.15) inset,
    0 4px 12px rgba(0,0,0,0.6);
}

/* Colores por tipo (borde y color en hover) */
.btn-action.play { border-color: #4caf50; }
.btn-action.pause { border-color: #ff9800; }
.btn-action.stop { border-color: #f44336; }

.btn-action.play:hover { color: #4caf50; border-color: #4caf50; }
.btn-action.pause:hover { color: #ff9800; border-color: #ff9800; }
.btn-action.stop:hover { color: #f44336; border-color: #f44336; }

/* Texto al lado del icono (si mantienes texto) */
/* Si usas sólo iconos puedes ocultar este span */
.btn-action span {
  display: none; /* ocultamos texto para mantener botones circulares */
}

/* ------------------ CONTENEDOR DEL VOLUMEN ------------------ */
/* Posicionado a la derecha de los botones (misma línea) */
.volume-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  position: relative;
  user-select: none;
}

/* ------------------ RUEDA / KNOB (versión pequeña) ------------------ */
/* Control circular compacto (ajustado al tamaño de botones) */
.volume-wheel {
  width: 46px;                /* tamaño reducido según tu petición */
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #333, #111);
  border: 3px solid #444;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow:
    0 0 6px rgba(0,0,0,0.6) inset,
    0 6px 14px rgba(0,0,0,0.6);
}

/* Hover y pressed igual que botones para coherencia */
.volume-wheel:hover {
  transform: translateY(-3px) scale(1.06);
  border-color: #00eaff;
  box-shadow:
    0 0 10px rgba(0,234,255,0.18),
    0 10px 20px rgba(0,0,0,0.6);
}
.volume-wheel:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow:
    0 0 6px rgba(0,234,255,0.08) inset,
    0 6px 12px rgba(0,0,0,0.6);
}

/* ------------------ INDICADOR INTERNO (la barrita que gira) ------------------ */
/* Esta es la clase que solicitaste: .volume-indicator */
.volume-indicator {
  width: 6px;                 /* grosor de la barrita */
  height: 18px;               /* largo de la barrita */
  background: #00eaff;        /* color cian/azul */
  border-radius: 4px;
  position: absolute;
  top: 6px;                   /* separación desde arriba del círculo */
  left: 50%;
  transform-origin: bottom;   /* rota desde la base */
  transform: translateX(-50%) rotate(0deg);
  transition: transform 0.12s linear, background 0.12s linear;
  box-shadow: 0 0 8px rgba(0,234,255,0.12);
}

/* ------------------ GLOW / HALO (opcional) ------------------ */
/* Un halo circular que puede aumentar su opacidad/escala según volumen */
.volume-halo {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  background: radial-gradient(circle, rgba(0,234,255,0.18), transparent 45%);
  opacity: 0;
  transition: opacity 0.12s linear, transform 0.12s linear;
}

/* ------------------ TABS (navegación tipo pestañas) ------------------ */
.tabs {
  display: flex;
  gap: 10px;
  margin-top: 1.05rem;
  padding: 0.6rem;
  background: #232323;
  border-radius: 8px;
  overflow-x: auto;
}
.tab a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  color: #ddd;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.tab a:hover, .tab a.active {
  background: #2f2f2f;
  color: #ffca28;
}

/* ------------------ PANEL BUSCADOR ------------------ */
.panel-menu {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.panel_busqueda {
  flex: 1 1 65%;
}
.input-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 0.9rem;
  background: #151515;
  border-radius: 8px;
  border: 1px solid #222;
}
.input-field i {
  color: #ffca28;
}
.input-field input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1rem;
  width: 100%;
}

/* ------------------ LISTA DE REPRODUCCIÓN ------------------ */
.panel_listaRep {
  flex: 1 1 30%;
}
.collection {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
}
.collection-item {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #222;
  color: #e6e6e6;
  font-size: 0.95rem;
}
.collection-item:last-child { border-bottom: none; }
.collection-item:hover { background: #272727; }

/* ------------------ CONTROLES DE ZONA (ZONAS/DESTINOS) ------------------ */
.subtitulo {
  display: inline-block;
  margin-top: 1.4rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 2px solid #ffca28;
}
.row-zonas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0.6rem;
}
.ctrl_box {
  background: #1f1f1f;
  border-radius: 10px;
  padding: 0.9rem;
  width: calc(33.33% - 8px);
  min-width: 160px;
  text-align: center;
  transition: transform 0.15s ease, background 0.15s;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
.ctrl_box:hover {
  transform: translateY(-4px);
  background: #292929;
}
.ctrl_nombre {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* ------------------ SWITCH MODERNO ------------------ */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 26px;
}
.switch input { display: none; }
.lever {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background: #444;
  border-radius: 26px;
  transition: background 0.18s;
}
.lever:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
}

/* ===================================================================
   DESCARGA DE AUDIO YOUTUBE
   =================================================================== */
.yt-download {
  margin-top: 1.2rem;
  margin-bottom: 1.5rem;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.yt-download-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  transition: all 0.25s ease;
}

.yt-download-input-wrapper:focus-within {
  border-color: #ff3d00;
  box-shadow: 0 0 10px rgba(255, 61, 0, 0.25);
  background: #181818;
}

.yt-download-input-wrapper .yt-icon {
  color: #ff3d00;
  font-size: 1.25rem;
  margin-right: 10px;
  flex-shrink: 0;
}

#yt-url {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #fff;
  font-size: 0.95rem;
  padding: 10px 0 !important;
  margin: 0 !important;
  height: auto !important;
}

#yt-url::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.btn-download-action {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(229, 57, 53, 0.35);
  transition: all 0.2s ease;
}

.btn-download-action i.material-icons {
  font-size: 1.2rem;
}

.btn-download-action:hover {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(229, 57, 53, 0.5);
}

.btn-download-action:active {
  transform: translateY(0);
}

.btn-download-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===================================================================
   STREAMING EN VIVO (Web Audio Streaming / Megafonía)
   =================================================================== */
.stream-control-bar {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stream-mode-group {
  display: flex;
  gap: 6px;
  background: #141414;
  padding: 3px;
  border-radius: 20px;
  border: 1px solid #333;
}

.btn-stream-mode {
  background: transparent;
  border: none;
  color: #888;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-stream-mode i.material-icons {
  font-size: 1.1rem;
}

.btn-stream-mode:hover {
  color: #fff;
}

.btn-stream-mode.active {
  background: #ffb300;
  color: #121212;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
}

.btn-stream-action {
  background: #e53935;
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
  transition: all 0.2s ease;
}

.btn-stream-action i.material-icons {
  font-size: 1.15rem;
}

.btn-stream-action:hover {
  background: #d32f2f;
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(229, 57, 53, 0.6);
}

.btn-stream-action.btn-streaming-active {
  background: #c62828;
  animation: pulse-stream 1.5s infinite;
}

@keyframes pulse-stream {
  0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(229, 57, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

.stream-live-badge {
  background: rgba(229, 57, 53, 0.15);
  border: 1px solid #e53935;
  color: #ff5252;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  animation: blink-badge 1s infinite alternate;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@keyframes blink-badge {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ===================================================================
   DISEÑO RESPONSIVO (Tablets y Móviles)
   =================================================================== */
@media (max-width: 768px) {
  .controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .panel-menu {
    flex-direction: column;
  }

  .panel_busqueda,
  .panel_listaRep {
    flex: 1 1 100%;
  }

  .row-zonas {
    justify-content: space-between;
  }

  .ctrl_box {
    width: calc(50% - 8px);
  }
}

@media (max-width: 580px) {
  .page-header h2 {
    font-size: 1.35rem;
  }

  #display {
    grid-template-columns: 1fr;
    text-align: center;
    background-size: cover;
  }

  .display__status {
    flex-direction: row;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  .player-buttons {
    justify-content: center;
    width: 100%;
  }

  .btn-action {
    width: 56px;
    height: 56px;
  }

  .volume-wheel {
    width: 65px;
    height: 65px;
  }

  .stream-control-bar {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .stream-mode-group {
    width: 100%;
    justify-content: center;
  }

  .btn-stream-action {
    width: 100%;
    justify-content: center;
  }

  .yt-download {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-download-action {
    width: 100%;
    justify-content: center;
  }

  .ctrl_box {
    width: 100%;
  }
}
