/* =======================================================
 * MASHAROS TV & RADIO - INTERFAZ PWA 
 * Versión: 1.1.2
 * ======================================================= */

/* NUEVAS VARIABLES DE DISEÑO */
:root {
  --primary: #d8681c; /* Color principal de Masharos */
  --primary-darker: #bb5410; /* Tono para hover */
  --bg: #0d0d0d; /* Fondo más oscuro */
  --panel: #1c1c1c; /* Fondo de contenedores */
  --text-light: #f0f0f0;
  --text-muted: #a0a0a0;
  --shadow-dark: 0 4px 12px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-light);
  font-size: 18px;
}

/* ENCABEZADO */
.main-header {
  text-align: center;
  padding: 20px 16px 15px;
  background: var(--bg);
}

.app-logo {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* TABS */
.tabs {
  display: flex;
  justify-content: center;
  gap: 2px;
  background: var(--panel);
  border-bottom: 3px solid var(--primary-darker);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: var(--shadow-dark);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  font-size: 1.1em;
  transition: all 0.3s ease;
}

.tab-btn:hover:not(.active) {
  color: var(--text-light);
  background: #252525;
}

.tab-btn.active {
  border-color: var(--primary);
  color: var(--text-light);
  background: var(--bg);
}

.tab-panel {
  display: none;
  padding: 10px 16px;
}

.tab-panel.active {
  display: block;
}

/* TV */
.tv-wrap {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding: 0 16px;
}

video {
  width: 100%;
  max-height: 75vh;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  background: #000;
  display: block;
}

/* INSTRUCCIÓN DE AUDIO EN TV */
#audioInstruction {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(27, 27, 27, 0.95);
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  font-size: 18px;
  text-align: center;
  max-width: 90%;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: none;
  display: none;
  font-weight: bold;
  border: 1px solid var(--primary);
}

#audioInstruction.show {
  display: block;
}

/* BOTÓN DE UNMUTE */
#unmuteBtn {
  display: none;
  width: 90%;
  max-width: 300px;
  margin: 15px auto 0;
  padding: 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

#unmuteBtn:hover {
  background-color: var(--primary-darker);
}

/* RADIO */
.radio-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.player-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow-dark);
  padding: 20px;
}

.song-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  text-align: center;
}

.title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.artist {
  font-size: 18px;
  color: var(--text-muted);
}

.cover-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.6s ease;
}

.cover.fade-out {
  opacity: 0;
}

.cover.zoom {
  transform: scale(1.04);
}

.bannerB {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.bannerB.show {
  opacity: 1;
}

.bannerB img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s, background-color 0.2s;
}

.btn:hover {
  transform: scale(1.08);
  background: var(--primary-darker);
}

.vol {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

input[type="range"] {
  appearance: none;
  width: 120px;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.wave {
  width: 100%;
  height: 6px;
  background: #252525;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 15px;
}

.progress {
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 0.25s linear;
}

/* PUBLICIDAD A */
.adA-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.adA-overlay.show {
  display: flex;
}

.adA-card {
  width: min(900px, 100vw);
  max-height: 100vh;
  height: 100vh;
  background: var(--bg);
  border-radius: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.adA-media {
  width: 100%;
  height: calc(100vh - 60px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adA-media video,
.adA-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.adA-ctrls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 15px;
  background: var(--panel);
  border-top: 1px solid #222;
  min-height: 60px;
}

.adA-skip {
  background: #e74c3c;
  color: #fff;
  font-size: 1.1em;
  padding: 12px 20px;
  border-radius: 5px;
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.adA-skip:hover {
  background: #c0392b;
}

/* =======================================================
   🎨 BANNER DE ACTUALIZACIÓN (Masharos Style)
   ======================================================= */
.update-banner {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #d8681c, #ff9933);
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: all 0.6s ease;
  cursor: pointer;
  z-index: 9999;
  opacity: 0.95;
}

.update-banner small {
  font-weight: 400;
  font-size: 0.85rem;
  color: #fff8;
}

.update-banner.show {
  bottom: 25px;
  animation: pulse 1.6s infinite ease-in-out;
}

.update-banner.updating {
  background: #333;
  color: #ffb347;
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 15px rgba(216,104,28,0.4); }
  50% { box-shadow: 0 0 25px rgba(255,153,51,0.9); }
  100% { box-shadow: 0 0 15px rgba(216,104,28,0.4); }
}

/* =======================================================
   🎚️ TOASTS (Avisos flotantes)
   ======================================================= */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 90%;
  max-width: 400px;
}

.toast {
  min-width: 200px;
  padding: 12px 18px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: linear-gradient(90deg, #28a745, #4cd964);
}

.toast.error {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.toast.info {
  background: linear-gradient(90deg, #1c1c1c, #d8681c);
}

.toast.warning {
  background: linear-gradient(90deg, #f39c12, #f1c40f);
}

/* =======================================================
   📱 RESPONSIVE (Móviles)
   ======================================================= */
@media (max-width: 600px) {
  .btn { width: 56px; height: 56px; font-size: 22px; }
  .tab-btn { padding: 12px 14px; }
  .app-logo { max-width: 120px; }
  body { font-size: 16px; }
  .title { font-size: 20px; }
  .artist { font-size: 16px; }
  #audioInstruction { font-size: 16px; }
  .adA-card { height: 100%; max-height: 100%; }
  .adA-skip { font-size: 1.2em; padding: 15px 25px; font-weight: 900; }
}
