/* fuentes */
@font-face {
  font-family: "expend";
  src: url("fonts/expend.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "circular";
  src: url("fonts/circular-medium.woff2") format("woff2");
  font-weight: 400;
  font-style: medium;
}
@font-face {
  font-family: "circular";
  src: url("fonts/circular-light.woff2") format("woff2");
  font-weight: 400;
  font-style: light;
}


:root {
  --bg: #000;
  --panel: #0f0f0f;
  --accent: #58477a;
  --wesstyle: #493b90;
  --muted: #8a8a8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font-family: 'circular', sans-serif;
}

/* HEADER */
.topbar {
  height: 60px;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #1a1a1a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: expend;
  font-size: 26px;
}

.logo {
  width: 10rem;
  align-items: center;
}
.brand-name {
  font-weight: 700;
  font-size: 24px;
}

.top-nav {
  display: flex;
  gap: 10px;

}

.nav-btn {
  padding: 6px 16px;
  border-radius: 30px;
  transition: 0.2s;
  font-family: 'circular', sans-serif;
  text-decoration: none;
}

.nav-btn.active {
  background: #493b90;
  color: #fff;
  font-size: 16px;
}

.nav-btn.outline {
  background: transparent;
  border: 1px solid #444;
  color: #fff;
}

.nav-btn:hover {
  opacity: 0.9;
}

/* LAYOUT */
.app {
  display: flex;
  flex-grow: 1; 
  align-items: stretch;
  height: calc(100vh - 60px); 
}

/* LEFT PANEL */
.left-panel {
  flex: 1;
  padding: 30px;
  overflow-y: auto; 
}
/* SIDEBAR */
.sidebar {
  width: 80px;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  border-right: 1px solid #1a1a1a;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-item {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.2s;
  padding: 2px;
}

.side-item img {
  width: 54px;
  margin-bottom: 6px;
}

.side-item:hover {
  color: var(--accent);
  transform: scale(1.05);
}

/* MAIN CONTENT */
.content {
  display: flex;
  flex: 1;
  height: 100%;
}

/* LEFT PANEL */
.left-panel {
  flex: 1;
  padding: 30px;
  height: 100%;
}

.section-header h3 {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}

.section-header h1 {
  margin: 5px 0 25px;
  font-size: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 4rem;
}

/* === ESTILOS DE ANIMACIÓN DE ENTRADA (NUEVO) === */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  cursor: pointer;
  transition: transform 0.2s ease;
  /* Estado inicial: oculto y ligeramente abajo */
  opacity: 0; 
  transform: translateY(20px); 
}

/* Clase que se añade con JS para activar la animación */
.card.animate {
  animation: fadeInSlideUp 0.4s ease-out forwards;
  /* Se elimina la transición de transform aquí para que la animación CSS tome el control */
  transition: none;
}
/* === FIN ANIMACIÓN === */


.card img {
  width: 100%;
  border-radius: 8px;
}

.card:hover {
  transform: scale(1.05);
}
.card h4, 
.card p {
  margin: 15px;
  top: 0px; 
}

.card p {
  margin-top: -15px; /* O a 0px si quieres pegarlo al h4 */
  color: var(--muted);
  font-size: 0.9rem;
}
/* RIGHT PANEL */
.right-panel {
  width: 400px;
  background: var(--panel);
  padding: 15px;
  border-left: 1px solid #1a1a1a;
  height: 100%; 
  display: flex; 
  flex-direction: column
}

.preview {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.preview-image {
  width: 90%;
  padding-bottom: 100%;
  height: 0;
  position: relative;
  border-radius: 8px;
    object-fit: cover;
    align-items: center;
    justify-content: center;
    cursor: pointer; 
}

.preview-image img {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; 

}

/* PLAYER */
.player {
  height: 60px;
  background: #101010;
  display: flex;
  align-items: center;
  justify-content: space-between; 
  padding: 0 24px; 
  border-top: 1px solid #1a1a1a;
  
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/* NUEVO ESTILO: Información de la pista a la izquierda */
.track-info {
    flex-basis: 33%; 
}

.track-info h2 {
    margin: 0;
    font-size: 1rem;
    text-align: left; 
}

.track-info p {
    margin: 4px 0 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: left;
    right: 0;
}

.track-cover {
    width: 45px; 
    height: 45px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 20px;
}

.track-cover img {
    width: 100%; 
    height: 100%;
    object-fit: cover;
}

/* El elemento de relleno para la derecha */
.track-placeholder {
    flex-basis: 33%;
    text-align: right; 
}

/* PLAYER CONTROLS (se mantiene) */
.player-controls {
  display: flex;
  align-items: center; 
  flex-basis: 33%; 
  justify-content: center;
}

.player-controls button {
  background: none;
  border: none;
  color: #fff;
  margin: 0 6px;
  padding: 0; 
  cursor: pointer;
  transition: 0.2s;
}

.player-controls button img {
  width: 16px; 
  display: block;
}

.player-controls .main-player-btn {
  background: #fff;
  width: 28px;
  height:28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 16px; 
}

.player-controls .main-player-btn img {
  width: 12px;
  transform: translateX(1px); 
}

.player-controls button:hover {
  opacity: 0.8; 
  color: initial; 
}

.player-controls button:hover img {
    opacity: 0.8;
}


/* LIGHTBOX (Modal para ver imagen completa) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2001;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

#lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* ESTILOS PARA LA BARRA DE DESPLAZAMIENTO (SCROLLBAR) */
/* Aplica solo al .left-panel */
.left-panel::-webkit-scrollbar {
  width: 12px;
}

.left-panel::-webkit-scrollbar-track {
  background: var(--bg);
}

.left-panel::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 4px; 
}

.left-panel::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}

/* ======================================= */
/* ====== MEDIA QUERIES PARA MÓVIL ======= */
/* ======================================= */
@media (max-width: 600px) {
  /* 1. OCULTAR ELEMENTOS NO DESEADOS */
  .sidebar {
    display: none;
  }

  /* **CRUCIAL:** Ocultar el panel derecho de vista previa (el reproductor grande) */
  .right-panel {
    display: none; 
    visibility: hidden; 
    width: 0;
  }
  
  /* 2. AJUSTAR EL CONTENEDOR PRINCIPAL Y EL PANEL DE CONTENIDO */
  .content {
    flex-direction: row; 
  }

  /* **CRUCIAL:** El panel izquierdo debe ocupar el 100% del espacio horizontal */
  .left-panel {
    flex: 1 1 100%; /* Ocupa todo el ancho disponible */
    padding: 20px 15px; /* Reducir padding en móvil */
    /* Ajusta la altura: Altura de la ventana - Topbar (60px) - Player (60px) */
    height: calc(100vh - 60px - 60px); 
    margin-bottom: 0; 
  }

  /* 3. FORMATO DE ÍTEMS */
  .grid {
    /* **CRUCIAL:** Una sola columna para que cada ítem ocupe todo el ancho */
    grid-template-columns: 1fr; 
    gap: 15px; 
    margin-bottom: 2rem; 
  }
  
  .card:hover {
    transform: none; /* Eliminar el zoom en hover para mejor UX táctil */
  }

  /* 4. AJUSTES EN EL ENCABEZADO Y REPRODUCTOR INFERIOR */
  .topbar {
    padding: 0 15px; 
  }
  
  .brand-name {
    font-size: 20px; 
  }
  
  .nav-btn {
    padding: 4px 10px; 
    font-size: 14px; 
  }
  
  .player {
    padding: 0 15px; 
    height: 60px; 
  }
  
  .track-placeholder {
    display: none; 
  }
  
  .track-cover {
    width: 40px; 
    height: 40px;
    margin-right: 10px;
  }

  .track-info h2 {
      font-size: 0.9rem;
  }

  .track-info p {
      font-size: 0.7rem;
  }
}

