:root{
  --bg: #e6e9ef;
  --panel: #e6e9ef;
  --soft-dark: #c9ccd1;
  --soft-light: #ffffff;
  --accent-primary: #6c5ce7;    /* Violeta principal */
  --accent-secondary: #00a8ff;  /* Azul secundario */
  --text: #3a3f47;
  --muted: #8a8f97;
  --card-radius: 18px;
  --shadow-dark: 8px 8px 16px rgba(166, 171, 189, 0.6);
  --shadow-light: -8px -8px 16px rgba(255, 255, 255, 0.8);
  
  /* Variables para botones neumórficos */
  --btn-shadow-dark: 5px 5px 10px rgba(166, 171, 189, 0.6);
  --btn-shadow-light: -5px -5px 10px rgba(255, 255, 255, 0.8);
  --btn-inset-shadow-dark: inset 3px 3px 6px rgba(166, 171, 189, 0.6);
  --btn-inset-shadow-light: inset -3px -3px 6px rgba(255, 255, 255, 0.8);
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%}
body{
  font-family:Inter,system-ui,Arial,Helvetica,sans-serif;
  background: linear-gradient(135deg, #E5F3FE, #E5F3FE);
  color:var(--text);
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;

  background-image: url('../logo/textura1.png'); /* Ruta a tu imagen */
  background-size: cover; /* Cubre toda la pantalla */
  background-repeat: no-repeat; /* Evita que la imagen se repita */
  background-position: center; /* Centra la imagen */
}

/* Efecto de partículas suaves */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/* BARRAS DE ANIMACIÓN - VERSIÓN CORREGIDA Y FUNCIONAL */
.side-bars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

.bar-container {
  display: flex;
  flex-direction: row;
  gap: 25px;
}

.loader-bar {
  position: relative;
  width: 40px;
  height: 200px;
  margin: 20px;
  overflow: hidden;
  border-radius: 40px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05));
  border: 2px solid #272727;
  box-shadow: -5px -5px 5px rgba(92, 92, 92, 0.1),
    10px 10px 10px rgba(0, 0, 0, 0.4), 
    inset -5px -5px 5px rgba(82, 82, 82, 0.2),
    inset 10px 10px 10px rgba(0, 0, 0, 0.4);
}

.loader-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  border-radius: 40px;
  box-shadow: -5px -5px 5px rgba(92, 92, 92, 0.1),
    10px 10px 10px rgba(0, 0, 0, 0.4), 
    inset -5px -5px 5px rgba(82, 82, 82, 0.2),
    inset 10px 10px 10px rgba(0, 0, 0, 0.4);
}

.loader-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  background: #343434;
  border-radius: 50%;
  box-shadow: inset -5px -5px 5px rgba(0, 0, 0, 0.2), 
              0 420px 0 400px var(--accent-primary);
  animation: animate 2.5s ease-in-out infinite;
  transform: translateY(160px);
  animation-delay: calc(-0.5s * var(--i));
}

@keyframes animate {
  0% {
    transform: translateY(160px);
    filter: hue-rotate(180deg);
  }
  50% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(160px);
    filter: hue-rotate(0deg);
  }
}

/* Ocultar barras en dispositivos móviles */
@media (max-width: 1100px) {
  .side-bars {
    display: none;
  }
}

/* layout */
.app{
  display:grid;
  grid-template-columns:260px 1fr 360px;
  gap:28px;
  height:100vh;
  padding:28px;
  align-items:center;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
  width: 100%;
}

/* sidebar neumorphic */
.sidebar{
  background: var(--panel);
  border-radius:var(--card-radius);
  padding:24px;
  box-shadow: var(--shadow-dark), var(--shadow-light);
  display:flex;
  flex-direction:column;
  gap:18px;
  align-items:center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 2;
}
.profile{text-align:center;width:100%}
.profile img{
  width:84px;height:84px;border-radius:50%;
  box-shadow: inset 6px 6px 12px var(--soft-dark), 
              inset -6px -6px 12px var(--soft-light);
  border:4px solid rgba(255,255,255,0.5);
}
.brand{
  font-weight:700;
  margin-top:10px; 
  letter-spacing:0.4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* lista de países */
.country-list-sidebar{
  margin-top:16px;
  width:100%;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.country-btn{
  background:var(--panel); 
  color:var(--muted);
  border-radius:12px; 
  padding:12px 14px;
  border:none; 
  width:100%; 
  text-align:left;
  cursor:pointer; 
  font-size:15px;
  box-shadow: var(--btn-shadow-dark), var(--btn-shadow-light);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}
.country-btn:hover {
  box-shadow: var(--btn-inset-shadow-dark), var(--btn-inset-shadow-light);
  color: var(--text);
}
.country-btn.active{ 
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); 
  color: white; 
  font-weight:600;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* player card */
.player-card{
  background: var(--panel);
  border-radius:28px;
  padding:28px;
  box-shadow: var(--shadow-dark), var(--shadow-light);
  display:flex;flex-direction:column;align-items:center;gap:18px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 2;
}

/* cover */
.cover{ 
  width:250px;height:250px;border-radius:50%;
  display:grid;place-items:center;background:var(--panel);
  box-shadow: 18px 18px 36px var(--soft-dark), 
              -18px -18px 36px var(--soft-light);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}
.cover img{ width:220px;height:220px;border-radius:50%;object-fit:cover }

/* title */
.track-title{ 
  font-size:30px;
  text-align: center;
  font-weight: bolder;
}
.emisora_eslogan{
    font-style: italic;
}

.track-sub{ 
  color:var(--muted);margin-top:15px;font-size:18px;
  text-align: center;
  font-weight: bold;
}



.visualizer-bar:nth-child(2) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.4s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.6s; }
.visualizer-bar:nth-child(5) { animation-delay: 0.8s; }
.visualizer-bar:nth-child(6) { animation-delay: 1.0s; }
.visualizer-bar:nth-child(7) { animation-delay: 1.2s; }

/* controls */
.controls{ display:flex;gap:22px;align-items:center }
.control-btn{
  width:64px;height:64px;border-radius:50%;display:grid;place-items:center;
  background:var(--panel);border:none;color:var(--text);
  box-shadow: var(--btn-shadow-dark), var(--btn-shadow-light);
  cursor:pointer;
  transition: all 0.3s ease;
  position: relative;
}
.control-btn:hover {
  box-shadow: var(--btn-inset-shadow-dark), var(--btn-inset-shadow-light);
}
.control-btn:active {
  box-shadow: var(--btn-inset-shadow-dark), var(--btn-inset-shadow-light);
  transform: translateY(2px);
}
.play-btn{ 
  width:86px;height:86px;font-size:20px;
  background:linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}
.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6);
}

/* progress */
.progress-wrap{ width:76%;display:flex;flex-direction:column;align-items:center;gap:8px }
.progress{ 
  width:100%;height:10px;border-radius:999px;background:var(--soft-light);
  box-shadow: inset 6px 6px 12px var(--soft-dark), 
              inset -6px -6px 12px var(--soft-light);
  overflow:hidden;
}
.progress>.bar{ 
  height:100%;width:0;
  background:linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}
.time-row{ width:100%;display:flex;justify-content:space-between;font-size:12px;color:var(--muted) }

/* volumen */
.volume-control{margin-top:10px;width:76%;}
.volume-control input{
  width:100%;cursor:pointer;height:8px;border-radius:8px;
  background:var(--soft-light);
  box-shadow: inset 4px 4px 8px var(--soft-dark), 
              inset -4px -4px 8px var(--soft-light);
  -webkit-appearance: none;
}
.volume-control input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid white;
}

/* playlist */
.playlist{
  background: var(--panel);
  border-radius:var(--card-radius);
  padding:18px;
  box-shadow: var(--shadow-dark), var(--shadow-light);
  height:75vh;
  overflow:auto;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}
.track-row{ 
  display:flex;gap:12px;align-items:center;padding:10px;border-radius:10px;cursor:pointer;
  transition: all 0.3s ease;
}
.track-row:hover{ 
  background: var(--soft-light);
}
.track-row.active{ 
  background:linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}
.thumb{ width:54px;height:54px;border-radius:8px;object-fit:cover }

/* Loading animation */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  flex-direction: column;
  gap: 15px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(108, 92, 231, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Status message */
.status-message {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}

/* NUEVO: Sección de artistas con efecto neumórfico mejorado */
.artists-section {
  margin-top: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.artists-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.5px;
}

.artists-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  width: 100%;
}

/* Efecto de gradiente al pasar el mouse */
.artist-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 168, 255, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.artist-btn:hover::after {
  opacity: 1;
}

/* Responsive para tablets */
@media(max-width:1100px){ 
  .app{
    grid-template-columns:200px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: 
      "sidebar player"
      "playlist playlist";
    gap: 20px;
    padding: 20px;
    height: auto;
    min-height: 100vh;
  }
  
  .sidebar {
    grid-area: sidebar;
    height: fit-content;
  }
  
  .player-card {
    grid-area: player;
  }
  
  .playlist {
    grid-area: playlist;
    height: 40vh;
    margin-top: 20px;
  }
  
  /* Ocultar artistas en tablets */
  .artists-section {
    display: none;
  }
  
  /* Ocultar visualizador en tablets */
  .player-visualizer {
    display: none;
  }
}

/* CORRECCIÓN PRINCIPAL: Mejora para visualización de países en móviles */
@media(max-width:700px){
  body {
    overflow: auto;
  }
  
  .app{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 
      "sidebar"
      "player"
      "playlist";
    gap: 15px;
    padding: 15px;
    height: auto;
    min-height: 100vh;
  }
  
  .sidebar{
    grid-area: sidebar;
    flex-direction: column;
    width: 100%;
    padding: 15px;
    align-items: stretch;
    height: auto;
    gap: 12px;
  }
  
  .profile {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    width: 100%;
    justify-content: center;
  }
  
  .profile img {
    width: 50px;
    height: 50px;
  }
  
  /* OCULTAR LISTA DE PAÍSES ORIGINAL */
  .country-list-sidebar {
    display: none !important;
  }
  
  .player-card{
    grid-area: player;
    padding: 20px;
    width: 100%;
    height: auto;
  }
  
  .cover {
    width: 200px;
    height: 200px;
  }
  
  .cover img {
    width: 170px;
    height: 170px;
  }
  
  .controls {
    gap: 15px;
  }
  
  .control-btn {
    width: 50px;
    height: 50px;
  }
  
  .play-btn {
    width: 70px;
    height: 70px;
  }
  
  .playlist{
    grid-area: playlist;
    height: 50vh;
    max-height: 50vh;
    margin-top: 0;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .track-row {
    padding: 8px;
  }
  
  .thumb {
    width: 45px;
    height: 45px;
  }
  
  .progress-wrap {
    width: 90%;
  }
  
  .volume-control {
    width: 90%;
  }
  
  /* Ocultar artistas en móviles */
  .artists-section {
    display: none;
  }
  
  /* Ocultar visualizador en móviles */
  .player-visualizer {
    display: none;
  }
}

/* NUEVO: Panel de países para móviles - VISIBLE Y FUNCIONAL */
.mobile-countries-panel {
  display: none;
}

@media(max-width:700px){
  .mobile-countries-panel {
    display: block;
    width: 100%;
    margin-top: 10px;
  }
  
  .mobile-countries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .mobile-countries-title {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
  }
  
  .mobile-countries-toggle {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
  }
  
  .mobile-countries-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
  }
  
  .mobile-countries-list {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .mobile-countries-list.show {
    display: flex;
    animation: fadeIn 0.3s ease;
  }
  
  .mobile-country-btn {
    background: var(--panel);
    color: var(--muted);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 3px 3px 6px var(--soft-dark), 
                -3px -3px 6px var(--soft-light);
    transition: all 0.2s ease;
  }
  
  .mobile-country-btn:hover {
    background: var(--soft-light);
    color: var(--text);
  }
  
  .mobile-country-btn.active {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-weight: 600;
    box-shadow: 0 2px极8px rgba(108, 92, 231, 0.4);
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pequeños ajustes para móviles muy pequeños */
@media(max-width:400px){
  .cover {
    width: 180px;
    height: 180px;
  }
  
  .cover img {
    width: 150px;
    height: 150px;
  }
  
  .controls {
    gap: 10px;
  }
  
  .control-btn {
    width: 45px;
    height: 45px;
  }
  
  .play-btn {
    width: 60px;
    height: 60px;
    font-size: 16px;
  }
  
  .track-title {
    font-size: 18px;
  }
  
  .track-sub {
    font-size: 13px;
  }
  
  .playlist {
    height: 45vh;
    max-height: 45vh;
  }
  
  .mobile-countries-list {
    max-height: 120px;
  }
  
  .mobile-country-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Mejora visual para la barra de scroll */
.playlist::-webkit-scrollbar {
  width: 6px;
}

.playlist::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.mobile-countries-list::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.mobile-countries-list::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}