@charset "utf-8";

@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,600;0,700;1,300;1,800&display=swap");

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #000;
  color: #fff;
  font-family: "Poppins", sans-serif;
  overflow-x: hidden;
}

/* =====================
   SKELETON LOADING
   ===================== */
.song-skeleton,
.artist-skeleton,
.history-song-skeleton,
.history-artist-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: inline-block;
  width: 100%;
  height: 1em;
}

.artist-skeleton      { width: 70%; }
.history-song-skeleton   { width: 80%; }
.history-artist-skeleton { width: 60%; }

/* =====================
   ARTWORK LOADING
   ===================== */
.loading-artwork-main {
  position: relative;
  width: 100%;
  height: 100%;
}

.artwork-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-artwork-main.loading .artwork-loading-spinner {
  opacity: 1;
}

/* =====================
   BUTTON LOADING
   ===================== */
.btn-play {
  position: relative;
  overflow: hidden;
}

.btn-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-play.loading .btn-loading-spinner { opacity: 1; }
.btn-play.loading i,
.btn-play.loading span { opacity: 0; }

/* =====================
   COVER HISTORIC LOADING
   ===================== */
.cover-historic {
  position: relative;
}

.cover-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cover-historic.loading .cover-loading-spinner { opacity: 1; }

/* =====================
   FONDO DESENFOCADO
   ===================== */
.cover-site {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 1;
}

#bgCover {
  height: 100%;
  width: 100%;
  position: absolute;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(0.3);
  -webkit-filter: blur(30px) brightness(0.3);
  transition: all 0.5s ease;
  transform: scale(1.1);
  z-index: 1;
}

.bg-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.9) 100%);
  z-index: 2;
}

/* =====================
   MAIN LAYOUT
   ===================== */
main {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1100px;
  padding: 30px;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.5s forwards;
}

.container {
  width: 100%;
}

/* =====================
   PLAYER INTERFACE
   ===================== */
.player-interface {
  display: flex;
  align-items: center;
  gap: 60px;
  width: 100%;
}

.player-left {
  flex-shrink: 0;
}

/* =====================
   ARTWORK PRINCIPAL
   ===================== */
.main-artwork {
  width: 450px;
  height: 450px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255,255,255,0.3);
}

.main-artwork:hover {
  transform: scale(1.02);
}

#currentCoverArt {
  width: 100%;
  height: 100%;
  background: url("../img/cover.webp") no-repeat center;
  background-size: cover;
  transition: background-image 1s ease;
}

/* =====================
   PLAYER DERECHO
   ===================== */
.player-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* =====================
   SONG INFO
   ===================== */
.song-info {
  margin-bottom: 40px;
  text-align: left;
}

.current-song {
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 15px 0;
  letter-spacing: 1px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-artist {
  font-size: 24px;
  font-weight: 400;
  color: #00d5ff;
  margin: 0;
  text-transform: capitalize;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================
   PLAYER CONTROLS
   ===================== */
.player-controls {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: flex-start;
}

/* =====================
   BOTÓN PLAY
   ===================== */
.btn-play {
  background: linear-gradient(135deg, #52ff02 0%, #8df900 100%);
  border: none;
  color: #000;
  padding: 18px 45px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(153,255,1,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 160px;
  justify-content: center;
  height: 60px;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(153,255,1,0.3);
}

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

/* =====================
   VOLUMEN
   ===================== */
.volume-control {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 400px;
}

.volume-icon {
  font-size: 22px;
  color: #ccc;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.volume-icon:hover {
  color: #fff;
}

.volume-slide {
  flex: 1;
}

.volume-indicator {
  font-size: 16px;
  color: #ff0202;
  min-width: 55px;
  text-align: right;
}

/* =====================
   ACTION BUTTONS
   ===================== */
.action-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 25px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Poppins", sans-serif;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.btn-secondary i {
  font-size: 16px;
}

/* =====================
   RANGE INPUT
   ===================== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* =====================
   MODALES
   ===================== */
.modal-content {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 15px;
}

.modal-header {
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.modal-footer {
  border-top: 1px solid rgba(255,255,255,0.15);
}

.modal-title {
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
}

.btn-close {
  filter: invert(1);
  opacity: 0.8;
}

.btn-close:hover {
  opacity: 1;
}

.modal-backdrop {
  background-color: rgba(0,0,0,0.85);
}

/* =====================
   HISTORIAL
   ===================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 60px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.history-item:hover {
  background: rgba(255,255,255,0.1);
}

.cover-historic {
  width: 80px;
  height: 80px;
  background: url("../img/cover.webp") no-repeat center;
  background-size: cover;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.music-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.music-info .song {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-info .artist {
  font-size: 14px;
  color: #aaa;
  text-transform: capitalize;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================
   LETRAS
   ===================== */
.lyric-content {
  font-size: 15px;
  line-height: 1.9;
  color: #ddd;
  padding: 10px 0;
}

.lyric-content p {
  margin: 0;
}

.led-live-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.75);
  padding: 5px 10px 5px 8px;
  border-radius: 20px;
  z-index: 10;
  overflow: hidden;
}

.led-live-badge span {
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-transform: uppercase;
}

/* =====================
   LED LIVE
   ===================== */
.led-live {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: led-breathe 3s ease-in-out infinite;
}

@keyframes led-breathe {
  0%   { background: #ffffff; box-shadow: 0 0 4px 1px rgba(255,255,255,0.5); }
  40%  { background: #ff2222; box-shadow: 0 0 8px 3px rgba(200,0,0,0.4); }
  60%  { background: #ff2222; box-shadow: 0 0 12px 4px rgba(200,0,0,0.6); }
  100% { background: #ffffff; box-shadow: 0 0 4px 1px rgba(255,255,255,0.5); }
}

.led-live::before,
.led-live::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(200, 0, 0, 0.5);
  opacity: 0;
  animation: led-soft-wave 3s ease-out infinite;
}

.led-live::after {
  animation-delay: 1.5s;
}

@keyframes led-soft-wave {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(4);   opacity: 0; }
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  main {
    max-width: 100%;
    padding: 15px;
  }

  .player-interface {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .player-right {
    align-items: center;
  }

  .song-info {
    text-align: center;
    margin-bottom: 30px;
  }

  .player-controls {
    align-items: center;
    width: 100%;
  }

  .main-artwork {
    width: 280px;
    height: 280px;
  }

  .current-song   { font-size: 28px; }
  .current-artist { font-size: 18px; }

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

  .volume-control {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .main-artwork {
    width: 250px;
    height: 250px;
  }

  .current-song   { font-size: 22px; }
  .current-artist { font-size: 15px; }

  .action-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .btn-secondary {
    justify-content: center;
  }
}

/* =====================
   ANIMACIONES
   ===================== */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes spin {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

/* Clases de animación (compatibles con animate.css manual) */
.animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.flipInY {
  animation-name: flipInY;
}

.bounceInLeft {
  animation-name: bounceInLeft;
}

.slideInRight {
  animation-name: slideInRight;
}

@keyframes flipInY {
  from { transform: perspective(400px) rotateY(90deg); opacity: 0; }
  40%  { transform: perspective(400px) rotateY(-20deg); }
  60%  { transform: perspective(400px) rotateY(10deg); }
  80%  { transform: perspective(400px) rotateY(-5deg); }
  to   { transform: perspective(400px); opacity: 1; }
}

@keyframes bounceInLeft {
  from, 60%, 75%, 90%, to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1.0);
  }
  0%  { opacity: 0; transform: translate3d(-3000px, 0, 0); }
  60% { opacity: 1; transform: translate3d(25px, 0, 0); }
  75% { transform: translate3d(-10px, 0, 0); }
  90% { transform: translate3d(5px, 0, 0); }
  to  { transform: none; }
}

@keyframes slideInRight {
  from { transform: translate3d(100%, 0, 0); visibility: visible; }
  to   { transform: translate3d(0, 0, 0); }
}
