/* Origen Estéreo - Estilos */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  padding: 20px 10px;
  gap: 20px;
}

/* Fondo animado */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 8s ease-in-out infinite;
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: #ffcc00;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.circle-2 {
  width: 350px;
  height: 350px;
  background: #0033a0;
  bottom: -100px;
  right: -100px;
  animation-delay: 2s;
}

.circle-3 {
  width: 300px;
  height: 300px;
  background: #d50000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Layout principal */
.main-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
  position: relative;
  z-index: 1;
}

.news-section {
  flex: 1;
  max-width: 320px;
}

.ranking-section {
  flex: 1;
  max-width: 320px;
}

/* Contenedor principal */
.player-container {
  position: relative;
  z-index: 1;
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 0 30px 25px;
  width: 380px;
  max-width: 95vw;
  text-align: center;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-container::-webkit-scrollbar {
  width: 4px;
}

.player-container::-webkit-scrollbar-track {
  background: transparent;
}

.player-container::-webkit-scrollbar-thumb {
  background: rgba(255, 204, 0, 0.3);
  border-radius: 4px;
}

.player-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 204, 0, 0.5);
}

/* Firefox */
.player-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 204, 0, 0.3) transparent;
}

/* Logo */
.logo {
  margin-bottom: 2px;
  text-align: center;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 100%);
}

.logo img {
  width: 180px;
  max-width: 50vw;
  display: block;
  margin: -3px auto 0;
  filter: drop-shadow(0 4px 15px rgba(255, 204, 0, 0.3));
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

.slogan {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
  margin-bottom: 8px;
  text-align: center;
}

/* Ecualizador */
.equalizer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  margin: 10px 0;
}

.equalizer span {
  display: block;
  width: 4px;
  height: 5px;
  background: linear-gradient(to top, #ffcc00, #ff6600);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.equalizer.active span {
  animation: equalize 0.8s ease-in-out infinite alternate;
}

.equalizer.active span:nth-child(1) { animation-delay: 0.0s; }
.equalizer.active span:nth-child(2) { animation-delay: 0.1s; }
.equalizer.active span:nth-child(3) { animation-delay: 0.2s; }
.equalizer.active span:nth-child(4) { animation-delay: 0.3s; }
.equalizer.active span:nth-child(5) { animation-delay: 0.4s; }
.equalizer.active span:nth-child(6) { animation-delay: 0.5s; }
.equalizer.active span:nth-child(7) { animation-delay: 0.3s; }
.equalizer.active span:nth-child(8) { animation-delay: 0.2s; }
.equalizer.active span:nth-child(9) { animation-delay: 0.1s; }
.equalizer.active span:nth-child(10) { animation-delay: 0.0s; }

@keyframes equalize {
  0% { height: 5px; }
  100% { height: 28px; }
}

/* Info de la canción */
.track-info {
  margin: 12px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cover-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.cover {
  width: 220px;
  height: 180px;
  border-radius: 16px;
  object-fit: contain;
  border: 3px solid rgba(255, 204, 0, 0.5);
  box-shadow: 0 8px 25px rgba(255, 204, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  image-rendering: high-quality;
  background: rgba(0, 0, 0, 0.3);
}

.cover:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(255, 204, 0, 0.3);
}

.pulse-ring {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 16px;
  border: 2px solid rgba(255, 204, 0, 0.4);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.song-details {
  color: #fff;
}

.now-playing {
  font-size: 11px;
  color: #ffcc00;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
  font-weight: 600;
}

.track-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

/* Controles en fila */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 15px 0;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s;
}

.control-btn:hover {
  background: rgba(255, 204, 0, 0.15);
  border-color: rgba(255, 204, 0, 0.4);
  transform: scale(1.1);
}

.control-btn.active {
  background: rgba(255, 204, 0, 0.2);
  border-color: rgba(255, 204, 0, 0.5);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

/* Botón play central */
.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ffcc00, #ff8800);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(255, 204, 0, 0.4);
  transition: all 0.3s ease;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(255, 204, 0, 0.6);
}

.play-btn:active {
  transform: scale(0.95);
}

.play-btn.playing {
  background: linear-gradient(135deg, #d50000, #ff4444);
  box-shadow: 0 6px 20px rgba(213, 0, 0, 0.4);
}

.play-btn.playing:hover {
  box-shadow: 0 8px 30px rgba(213, 0, 0, 0.6);
}

/* Volumen desplegable */
.volume-wrapper {
  position: relative;
}

.volume-slider {
  display: none;
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 15px 10px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.volume-wrapper:hover .volume-slider,
.volume-slider.active {
  display: flex;
}

.volume-slider input[type="range"] {
  writing-mode: vertical-lr;
  -webkit-writing-mode: vertical-lr;
  direction: rtl;
  width: 5px;
  height: 100px;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffcc00;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 204, 0, 0.4);
}

.volume-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffcc00;
  cursor: pointer;
  border: none;
}

.volume-slider .vol-percentage {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.lyrics-btn {
  color: rgba(255, 255, 255, 0.7);
}

.lyrics-btn:hover {
  color: #ffcc00;
}

.lyrics-btn.active {
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.2);
  border-color: rgba(255, 204, 0, 0.5);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

/* Letras desplegable */
.lyrics-content {
  margin-top: 12px;
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lyrics-content::-webkit-scrollbar {
  width: 3px;
}

.lyrics-content::-webkit-scrollbar-thumb {
  background: rgba(255, 204, 0, 0.3);
  border-radius: 3px;
}

.lyrics-scroll {
  text-align: center;
}

.lyrics-line {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 2.2;
  transition: all 0.3s;
  margin: 0;
}

.lyrics-line.active {
  color: #ffcc00;
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
}

.lyrics-line.past {
  color: rgba(255, 255, 255, 0.2);
}

.lyrics-unavailable {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  text-align: center;
}

/* Redes sociales */
.social-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-btn:hover {
  transform: translateY(-3px) scale(1.1);
}

.social-btn.facebook:hover {
  background: #1877f2;
  color: #fff;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

.social-btn.twitter:hover {
  background: #000;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.social-btn.instagram:hover {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 48, 108, 0.4);
}

.social-btn.share {
  color: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.social-btn.share:hover {
  background: rgba(0, 230, 118, 0.2);
  color: #00e676;
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.social-btn.whatsapp:hover {
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

/* Footer */
.footer {
  margin-top: 12px;
  padding-top: 10px;
}

.footer p {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
}

.footer-contact {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-contact p {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
}

/* Secciones (Ranking y Noticias) */
.section-container {
  position: relative;
  z-index: 1;
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 25px 20px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ranking-section {
  flex: 1;
  max-width: 380px;
}

.section-header h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px;
}

.section-header .news-source {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 10px;
}

/* Ranking */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.ranking-list::-webkit-scrollbar {
  width: 4px;
}

.ranking-list::-webkit-scrollbar-track {
  background: transparent;
}

.ranking-list::-webkit-scrollbar-thumb {
  background: rgba(255, 204, 0, 0.3);
  border-radius: 4px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: background 0.2s;
}

.ranking-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Tendencia (flechas) */
.trend {
  font-size: 12px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.trend-up {
  color: #00e676;
}

.trend-down {
  color: #ff4444;
}

.trend-new {
  color: #ffcc00;
}

.trend-same {
  color: rgba(255, 255, 255, 0.3);
}

/* Botones de voto */
.rank-votes {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.vote-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.vote-btn:hover {
  transform: scale(1.2);
}

.vote-btn.vote-up:hover {
  background: rgba(0, 230, 118, 0.2);
}

.vote-btn.vote-down:hover {
  background: rgba(255, 68, 68, 0.2);
}

.rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.rank.gold {
  background: linear-gradient(135deg, #ffcc00, #ff8800);
  color: #000;
}

.rank.silver {
  background: linear-gradient(135deg, #c0c0c0, #888);
  color: #000;
}

.rank.bronze {
  background: linear-gradient(135deg, #cd7f32, #a0522d);
  color: #fff;
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-title {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-artist {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.rank-plays {
  font-size: 11px;
  color: #ffcc00;
  font-weight: 600;
  flex-shrink: 0;
}

/* Noticias */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  overflow-y: auto;
}

/* En escritorio, la sección de noticias estira a la misma altura que las otras */
.news-section {
  display: flex;
  flex-direction: column;
}

.news-section .news-list {
  flex: 1;
  overflow-y: auto;
}

.news-list::-webkit-scrollbar {
  width: 4px;
}

.news-list::-webkit-scrollbar-thumb {
  background: rgba(255, 204, 0, 0.3);
  border-radius: 4px;
}

.news-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.news-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.news-content {
  flex: 1;
  min-width: 0;
}

.news-title {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 5px;
}

/* Responsive */

/* Pantallas pequeñas (móviles) */
@media (max-width: 420px) {
  .main-row {
    flex-direction: column;
    align-items: center;
  }

  .news-section,
  .ranking-section {
    max-width: 100%;
    width: 100%;
  }

  body {
    padding: 15px 8px;
  }

  .player-container {
    padding: 25px 18px;
    border-radius: 20px;
    width: 100%;
  }

  .logo img {
    width: 150px;
    margin-bottom: 15px;
  }

  .equalizer {
    height: 24px;
    margin-bottom: 15px;
  }

  .cover {
    width: 180px;
    height: 150px;
  }

  .now-playing {
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .track-info h3 {
    font-size: 15px;
  }

  .artist {
    font-size: 12px;
  }

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

  .play-btn svg {
    width: 26px;
    height: 26px;
  }

  .volume-control {
    padding: 8px 12px;
    gap: 8px;
  }

  .social-links {
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    flex-wrap: wrap;
  }

  .social-btn {
    width: 38px;
    height: 38px;
  }

  .social-btn svg {
    width: 18px;
    height: 18px;
  }

  .footer p {
    font-size: 10px;
  }
}

/* Pantallas muy pequeñas (iPhone SE, etc) */
@media (max-width: 340px) {
  .main-row {
    flex-direction: column;
    align-items: center;
  }

  .player-container {
    padding: 20px 14px;
  }

  .logo img {
    width: 130px;
  }

  .cover {
    width: 160px;
    height: 130px;
  }

  .track-info h3 {
    font-size: 14px;
  }

  .social-links {
    gap: 6px;
  }

  .social-btn {
    width: 34px;
    height: 34px;
  }

  .social-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Tablets */
@media (min-width: 421px) and (max-width: 768px) {
  .main-row {
    flex-direction: column;
    align-items: center;
  }

  .player-container {
    width: 400px;
    padding: 35px 28px;
  }

  .section-container {
    width: 400px;
  }

  .news-section,
  .ranking-section {
    max-width: 400px;
  }
}

/* Pantallas grandes (escritorio) */
@media (min-width: 769px) {
  .main-row {
    flex-direction: row;
    align-items: stretch;
  }

  /* En escritorio: Noticias izq | Reproductor centro | Ranking der */
  .news-section {
    order: 1;
    display: flex;
    flex-direction: column;
    height: 95vh;
  }

  .news-section .section-header {
    flex-shrink: 0;
  }

  .news-section .news-list {
    flex: 1;
    overflow-y: auto;
  }

  .player-container {
    order: 2;
    width: 380px;
    padding: 30px 25px;
    flex-shrink: 0;
    height: 95vh;
    overflow-y: auto;
  }

  .ranking-section {
    order: 3;
    display: flex;
    flex-direction: column;
    height: 95vh;
  }

  .ranking-section .ranking-list {
    flex: 1;
    overflow-y: auto;
  }

  .section-container {
    width: auto;
  }

  .news-section,
  .ranking-section {
    max-width: 320px;
  }

  .logo img {
    width: 200px;
  }

  .cover {
    width: 110px;
    height: 110px;
  }

  .track-info h3 {
    font-size: 18px;
  }

  .play-btn {
    width: 64px;
    height: 64px;
  }

  .social-btn {
    width: 42px;
    height: 42px;
  }
}

/* Pantallas muy altas (evitar que se vea perdido) */
@media (min-height: 900px) {
  body {
    align-items: center;
  }
}

/* Landscape en móvil */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    align-items: flex-start;
    padding: 10px;
  }

  .player-container {
    padding: 20px 25px;
  }

  .logo img {
    width: 120px;
    margin-bottom: 10px;
  }

  .cover {
    width: 120px;
    height: 100px;
  }

  .track-info {
    margin: 10px 0 15px;
  }

  .equalizer {
    height: 20px;
    margin-bottom: 10px;
  }

  .controls {
    margin: 10px 0;
  }

  .play-btn {
    width: 50px;
    height: 50px;
  }
}
