/* ============================================= */
/* 1. VARIABLES GLOBALES Y CONFIGURACIONES BASE  */
/* ============================================= */

:root {
  /* PALETA DE COLORES */
  --color-primary: #007887;
  --color-secondary: #121212;
  --color-white: #ffffff;
  --color-text: rgba(255, 255, 255, 0.85);
  --color-text-light: rgba(255, 255, 255, 0.5);
  --primary: #E27147;

  /* FONDOS Y SUPERFICIES */
  --bg-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --bg-glass: rgba(0, 0, 0, 0.1);
  --bg-modal: rgba(18, 18, 18, 0.95);
  --bg-overlay: rgba(0, 0, 0, 0.4);

  /* SOMBRAS Y EFECTOS */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.3);
  --blur-sm: blur(10px);
  --blur-md: blur(12px);
  --blur-lg: blur(15px);

  /* TRANSICIONES */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;
  --transition-slow: 0.5s;

  /* ESPACIADOS */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 50px;
  --border-glass: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================= */
/* 2. ESTRUCTURA BASE */
/* ============================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-gradient);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--color-white);
}

.content-wrapper {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 95px;
}

.main-content-centered {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ============================================= */
/* 3. EFECTOS VISUALES */
/* ============================================= */

.artwork-background {
  position: fixed;
  top: -20px;
  left: 0;
  width: 100vw;
  height: calc(100vh + 40px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(25px) brightness(0.85);
  transform: scale(1.4);
  z-index: -2;
  transition: background-image var(--transition-slow) ease-in-out;
  pointer-events: none;
}

body::before {
  content: '';
  position: fixed;
  top: -2px;
  left: -2px;
  width: 102vw;
  height: 102vh;
  background: var(--bg-overlay);
  backdrop-filter: var(--blur-sm);
  z-index: -1;
}

/* ============================================= */
/* 4. CABECERA Y LOGO */
/* ============================================= */

.main-header {
  padding-top: var(--spacing-md);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;  /* ← Añadido para centrado vertical */
}

.logo-img {
  display: block;           /* ← Elimina espacio extra debajo de la imagen */
  height: auto;             /* ← Mantiene la proporción */
  width: auto;              /* ← Mantiene la proporción */
  max-width: 100%;          /* ← Nunca se sale del contenedor */
  max-height: 70px;         /* ← Tamaño base en desktop */
  aspect-ratio: 600 / 392;  /* ← Proporción exacta 600:392 */
  filter: drop-shadow(var(--shadow-sm));
  object-fit: contain;      /* ← Asegura que no se recorte */
}

/* 📌 PC y Laptop (pantallas medianas y grandes) */
@media (min-width: 769px) {
  .logo-img {
    max-height: 65px;       /* ← Tamaño reducido para PC/laptop */
    max-width: 450px;       /* ← Límite de ancho */
  }
}

/* 📌 Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .logo-img {
    max-height: 70px;       /* ← Un poco más grande en tablet */
  }
}

/* 📌 Móviles */
@media (max-width: 480px) {
  .logo-img {
    max-height: 45px;       /* ← Más pequeño en móvil */
    max-width: 280px;
  }
}

/* ============================================= */
/* 5. NOW PLAYING */
/* ============================================= */

.container-artwork {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 25px auto 0 auto;
  padding: 0 1rem;
  width: 100%;
  text-align: center;
}

.now-playing-text {
  line-height: 1.2;
  font-family: 'Barlow Condensed', sans-serif;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 0.4rem;
}

#np_current_artist {
  font-size: clamp(1.2rem, 3vh, 1.8rem);
  font-weight: 700;
  color: var(--color-white);
}

#np_current_title {
  font-size: clamp(1rem, 2.5vh, 1.4rem);
  font-weight: 500;
  color: var(--color-text);
}

.np_track_artwork {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-sm);
  padding: 6px;
  border-radius: var(--radius-md);
  border: var(--border-glass);
  max-height: 35vh;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.np_track_artwork img {
  width: 100%;
  height: 100%;
  max-width: 250px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* ============================================= */
/* 6. REPRODUCTOR */
/* ============================================= */

.player-section {
  margin: 20px auto 0 auto;
  padding: 0 20px;
  flex-shrink: 0;
}

.player-container {
  display: flex;
  justify-content: center;
}

.player-button {
  background: rgba(255, 255, 255, 0.18);
  border: var(--border-glass);
  border-radius: 50%;
  width: clamp(60px, 8vh, 85px);
  height: clamp(60px, 8vh, 85px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal) ease;
}

.player-button svg {
  width: 40%;
  height: 40%;
  fill: var(--color-white);
}

.player-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.player-button.playing {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

/* ============================================= */
/* 7. BOTONES GLASS (GUÍA Y SERVICIOS) */
/* ============================================= */

.glass-nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem auto 1.5rem;
  padding: 0 1rem;
  max-width: 320px;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
}

.glass-btn i {
  font-size: 1.1rem;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
}

.glass-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 480px) {
  .glass-nav-buttons {
    gap: 1rem;
  }
  .glass-btn {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
  }
}

/* ============================================= */
/* 8. BARRA INFERIOR */
/* ============================================= */

.bottom-action-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 500px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 60px;
  border: var(--border-glass);
  padding: 8px 16px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  gap: 0;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  padding: 6px 0;
  border-radius: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.bottom-nav-item i {
  font-size: 20px;
}

.bottom-nav-item span {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

.bottom-nav-item:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.15);
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .bottom-action-bar {
    bottom: 10px;
    width: calc(100% - 20px);
    max-width: 450px;
    padding: 5px 10px;
    border-radius: 35px;
  }
  
  .bottom-nav-item {
    padding: 4px 0;
  }
  
  .bottom-nav-item i {
    font-size: 18px;
  }
  
  .bottom-nav-item span {
    font-size: 0.6rem;
  }
}

/* ============================================= */
/* 9. MODAL SINTONIZA */
/* ============================================= */

.popup-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  width: min(90vw, 500px);
  max-height: 80vh;
  background: var(--bg-modal);
  backdrop-filter: var(--blur-lg);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  z-index: 10000;
  color: var(--color-white);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal) ease;
}

.popup-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-overlay);
  backdrop-filter: var(--blur-sm);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal) ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: var(--border-glass);
}

.history-head h3 {
  margin: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
}

.history-head .x {
  background: rgba(0, 0, 0, 0.2);
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  color: white;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.pwa-popup-body {
  padding: var(--spacing-md);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================= */
/* 10. SUBMENÚ LEGAL (renombrado) */
/* ============================================= */

.legal-submenu {
  position: fixed;
  bottom: 80px;
  right: 16px;
  background: rgba(10, 20, 25, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0;
  min-width: 180px;
  z-index: 1100;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.legal-submenu.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.submenu-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  color: white;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.submenu-option:last-child {
  border-bottom: none;
}

.submenu-option i {
  width: 22px;
  font-size: 1.1rem;
  opacity: 0.8;
  color: #4fc3f7;
}

.submenu-option:hover {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0;
}

@media (max-width: 480px) {
  .legal-submenu {
    right: 12px;
    min-width: 160px;
    bottom: 75px;
  }
  .submenu-option {
    padding: 12px 18px;
    font-size: 0.85rem;
  }
}

/* ============================================= */
/* 11. OVERLAY para cerrar submenú */
/* ============================================= */

.info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.info-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ============================================= */
/* 12. BARRA LATERAL COMPARTIR - TIPO WIDGET */
/* ============================================= */

.share-widget {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Pestaña que siempre se ve (solo asoma) */
.share-widget-tab {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-radius: 14px 0 0 14px;
  padding: 14px 6px 14px 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
  min-height: 80px;
}

.share-widget-tab i {
  writing-mode: horizontal-tb;
  font-size: 1rem;
  margin-bottom: 6px;
  display: block;
}

.share-widget-tab:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  padding-right: 10px;
}

/* Panel desplegable (oculto) */
.share-widget-panel {
  position: absolute;
  top: 50%;
  right: -200px;
  transform: translateY(-50%);
  background: rgba(10, 20, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-radius: 16px 0 0 16px;
  padding: 20px 18px;
  min-width: 170px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-widget-panel.open {
  right: 0;
}

/* Título del panel */
.share-widget-panel .panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-align: center;
}

/* Botones de compartir dentro del panel */
.share-widget-panel .share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}

.share-widget-panel .share-option i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.share-widget-panel .share-option:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(-4px);
}

.share-widget-panel .share-option:active {
  transform: scale(0.97);
}

/* Botón para cerrar el panel */
.share-widget-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.share-widget-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================= */
/* 13. BANNER INSTALACIÓN PWA */
/* ============================================= */

.pwa-install-banner-simple {
  position: fixed;
  bottom: 20px;
  left: 16px;
  right: 16px;
  z-index: 10000;
  animation: slideUpBannerInstall 0.4s ease-out;
}

.pwa-install-banner-simple .banner-content {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(226, 113, 71, 0.3);
}

.pwa-install-banner-simple .banner-icon {
  background: linear-gradient(135deg, #E27147, #c55a2e);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-install-banner-simple .banner-icon i {
  font-size: 22px;
  color: white;
}

.pwa-install-banner-simple .banner-text {
  flex: 1;
}

.pwa-install-banner-simple .banner-title {
  font-weight: 700;
  font-size: 15px;
  color: white;
  margin-bottom: 2px;
}

.pwa-install-banner-simple .banner-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
}

.pwa-install-banner-simple .banner-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-banner-simple .btn-install {
  background: linear-gradient(135deg, #E27147, #c55a2e);
  border: none;
  color: white;
  border-radius: 40px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-install-banner-simple .btn-later {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 40px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
}

@keyframes slideUpBannerInstall {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 400px) {
  .pwa-install-banner-simple .banner-content {
    padding: 10px 12px;
  }
  .pwa-install-banner-simple .banner-icon {
    width: 36px;
    height: 36px;
  }
  .pwa-install-banner-simple .banner-icon i {
    font-size: 18px;
  }
  .pwa-install-banner-simple .banner-title {
    font-size: 13px;
  }
  .pwa-install-banner-simple .btn-install,
  .pwa-install-banner-simple .btn-later {
    padding: 6px 12px;
    font-size: 11px;
  }
}

/* ============================================= */
/* 14. AJUSTES MÓVILES PARA WIDGET */
/* ============================================= */

@media (max-width: 480px) {
  .share-widget-tab {
    padding: 12px 4px 12px 10px;
    font-size: 0.6rem;
    min-height: 60px;
    border-radius: 10px 0 0 10px;
  }
  
  .share-widget-tab i {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }
  
  .share-widget-panel {
    padding: 16px 14px;
    min-width: 150px;
  }
  
  .share-widget-panel .share-option {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  
  .share-widget-panel .share-option i {
    font-size: 1rem;
    width: 20px;
  }
}

@media (max-width: 380px) {
  .share-widget-tab {
    padding: 10px 3px 10px 8px;
    font-size: 0.5rem;
    min-height: 50px;
  }
  
  .share-widget-panel {
    padding: 14px 12px;
    min-width: 130px;
  }
  
  .share-widget-panel .share-option {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* ============================================= */
/* 15. UTILIDADES */
/* ============================================= */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}