/* =========================================
   PÁGINA DE INICIO (HOME)
========================================== */

/* --- BANNERS --- */
.banner-semanal, .banner-secc {
    background: linear-gradient(10deg, #1A1A3A 0%, #56008F 50%, #000000 100%);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.banner-semanal h2, .banner-secc h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.banner-grad {
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    background: linear-gradient(90deg, #1A1A3A, #000000, #2F0675, #1A1A3A);
    background-size: 300% 100% !important;
    animation: movimientoBanner 10s ease infinite;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    overflow: hidden;
    color: white;
}

.banner-grad h2 {
    color: white;
    margin: 0;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@keyframes movimientoBanner {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- SECCIÓN POPULAR --- */
.seccion-popular {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-tarjeta);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    gap: 2rem;
}

.seccion-popular h2 { margin-top: 0; }
.popular-galeria { flex-grow: 1; }

.galeria-items {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.item-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 10px;
    border: 1.2px solid var(--color-borde);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    height: 200px;
    text-align: center;
    background-color: #000;
}

.item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.item-card .content {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-texto-principal);
    padding: 1rem;
    transition: bottom 0.4s ease-in-out;
    box-sizing: border-box; 
}

.item-card:hover .content { bottom: 0; }
.item-card:hover img { transform: scale(1.1); }

.item-card .content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: #fff;
}

.item-card .content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-texto-principal);
}

.popular-tienda .btn-tienda {
    background-color: var(--color-acento-purpura);
    color: white;
    border: none;
    padding: 9.5rem 2.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
}

/* --- CONTENIDO DIVIDIDO (FEED) --- */
.contenido-dividido {
    display: grid;
    grid-template-columns: 2fr 1fr;  
    gap: 2rem;
}

.columna-aleatorio, .columna-nuevo {
    background-color: var(--color-tarjeta);
    padding: 1.5rem;
    border-radius: 8px;
}

.columna-aleatorio h2, .columna-nuevo h2 { margin-top: 0; }

.feed-item {
    background: var(--color-tarjeta);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-borde);
}

.columna-aleatorio .feed-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.feed-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
}

.feed-item-header img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.feed-info {
    display: grid;
    grid-template-columns: 1fr auto; 
    grid-template-rows: auto auto;
    grid-template-areas: 
      "titulo  rating"
      "artista rating";
    align-items: center;
    flex-grow: 1;
    gap: 0 10px;
}

.feed-info h3 { grid-area: titulo; margin: 0; }
.feed-info p { grid-area: artista; margin: 0; }
.feed-info .rating { grid-area: rating; justify-self: end; }

/* Acordeón de Detalles (Album) en Home */
.album-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.3s ease;
    padding: 0 15px; 
    border-top: 1px solid var(--color-borde);
}

.album-details.activo {
    max-height: 400px;
    padding: 10px 15px 15px 15px; 
}

.album-details ul { 
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.album-details li {
    margin-bottom: 5px;
    color: var(--color-texto-secundario);
}

.toggle-details {
    cursor: pointer;
    transition: transform 0.2s ease-out;
}

.toggle-details:active { transform: scale(0.97); }

/* Columna Nuevo (Items pequeños) */
.nuevo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-borde);
}

.nuevo-item:last-child { border-bottom: none; }

.nuevo-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
/* =========================================
   TARJETAS HÍBRIDAS (TENDENCIAS)
========================================== */

.item-card-hibrida {
    width: 180px; /* OBLIGAMOS a que todas midan exactamente esto */
    min-width: 180px; 
    flex: 0 0 auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* Contenedor de la imagen y el overlay */
.portada-contenedor {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Mantiene la portada siempre cuadrada */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.portada-contenedor img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

/* El cuadro negro semitransparente con los detalles extra */
.overlay-detalles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.3s ease;
    color: white;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

.overlay-detalles .estrellas { color: var(--color-acento-purpura); margin-bottom: 5px; }
.overlay-detalles .puntuacion { font-size: 0.8rem; margin-bottom: 10px; }
.overlay-detalles .tiempo { font-size: 0.8rem; color: #ccc; margin: 0 0 10px 0; }
.overlay-detalles .tags-info { font-size: 0.75rem; color: var(--color-acento-azul); display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;}

/* Información que SIEMPRE se ve (Título y artista) */
.info-basica {
    margin-top: 10px;
    text-align: left;
    width: 100%;
    overflow: hidden; /* El secreto para que el Flexbox no se estire */
}
.info-basica h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-texto-principal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Ahora sí aparecerán los "..." */
    display: block;
}

.info-basica p {
    margin: 3px 0 0 0;
    font-size: 0.85rem;
    color: var(--color-texto-secundario);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   LA REGLA DE ORO (SOLO HOVER EN PC)
========================================== */
@media (min-width: 1024px) {
    .item-card-hibrida:hover .portada-contenedor img {
        transform: scale(1.1); /* Zoom a la imagen */
    }
    
    .item-card-hibrida:hover .overlay-detalles {
        opacity: 1; /* Revela los detalles */
    }
    .item-card-hibrida {
        /* Magia matemática: 100% / 5 tarjetas = 20%. 
           Le restamos 12px para compensar los 15px de separación (gap) entre ellas */
        width: calc(20% - 12px);
        min-width: calc(20% - 12px);
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}
/* =========================================
   CARRUSEL INTERACTIVO (ESCRITORIO)
========================================== */
.carrusel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    gap: 10px;
    width: 100%;
}

.galeria-items {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth; /* Hace que el movimiento al hacer clic sea fluido */
    flex: 1; /* Ocupa todo el espacio entre los botones */
    padding: 10px 0;
    
    /* Ocultar la barra de scroll nativa para un look más limpio */
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;  /* IE y Edge */
    scrollbar-width: none;  /* Firefox */
}

.galeria-items::-webkit-scrollbar {
    display: none; /* Chrome, Safari y Opera */
}

/* Estilo de los botones laterales */
.btn-carrusel {
    background: transparent;
    border: none;
    color: var(--color-texto-secundario);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 0 10px;
    z-index: 5;
}

.btn-carrusel:hover {
    color: var(--color-texto-principal);
    transform: scale(1.2);
}

/* Ocultar botones en móviles (las PWA usan el dedo para hacer swipe) */
@media (max-width: 768px) {
    .btn-carrusel {
        display: none;
    }
}
/* =========================================
   CONTENIDO: TEMÁTICA SEMANAL
========================================== */
.contenido-tematica {
    display: grid;
    grid-template-columns: 1fr; /* Móvil por defecto: 1 columna */
    gap: 2rem;
    align-items: center;
}

.tematica-info h4 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--color-texto-principal);
}

.tematica-info p {
    color: var(--color-texto-secundario);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-tematica {
    background-color: var(--color-acento-purpura);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-tematica:hover {
    transform: scale(1.05);
    background-color: #9000cc;
}

.tematica-grid-albums {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2x2 en cuadrícula */
    gap: 15px;
}

.tematica-item {
    background-color: #101016;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.tematica-item img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.tematica-item-info {
    padding: 10px;
}

.tematica-item-info h5 {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tematica-item-info p {
    margin: 3px 0 0 0;
    font-size: 0.75rem;
    color: var(--color-texto-secundario);
}

/* =========================================
   BLOQUES FULL WIDTH (Para toda la pantalla)
========================================== */
.bloque-full-width {
    width: 100%;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-borde);
}

.sub-seccion-tematica {
    margin-top: 2.5rem;
}

/* --- EL BANNER GIGANTE --- */
.banner-tematico-gigante {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, rgba(86, 0, 143, 0.8) 0%, rgba(26, 26, 58, 0.9) 100%), url('https://images.unsplash.com/photo-1514525253161-7a46d19cd819?q=80&w=2000&auto=format&fit=crop') center/cover no-repeat;
    border-radius: 16px;
    display: flex;
    align-items: flex-end; /* Texto abajo */
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 3rem;
}

.banner-contenido {
    max-width: 800px;
}

.tag-semana {
    background-color: var(--color-acento-purpura);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: inline-block;
}

.banner-tematico-gigante h2 {
    font-size: 3.5rem;
    margin: 10px 0;
    color: white;
    text-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.banner-tematico-gigante p {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin: 0;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* --- FILA DE ARTISTAS --- */
.artistas-fila {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: none; /* Oculta scrollbar */
}
.artistas-fila::-webkit-scrollbar { display: none; }

.artista-circulo {
    text-align: center;
    cursor: pointer;
    min-width: 120px;
    transition: transform 0.3s ease;
}

.artista-circulo:hover {
    transform: translateY(-10px);
}

.artista-circulo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.artista-circulo:hover img {
    border-color: var(--color-acento-purpura);
}

.artista-circulo p {
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.95rem;
}

/* --- TARJETAS DE RESEÑA --- */
.resenas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.resena-card {
    background-color: var(--color-tarjeta);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-borde);
    transition: transform 0.2s ease;
}

.resena-card:hover {
    transform: translateY(-5px);
    border-color: #555;
}

.resena-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.resena-header img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.resena-header h5 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.resena-header span {
    font-size: 0.8rem;
    color: var(--color-texto-secundario);
}

.resena-texto {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ddd;
    font-style: italic;
    margin: 0;
}

/* --- PLAYLIST CARDS --- */
.lista-comunidad-card {
    background-color: var(--color-tarjeta);
    border-radius: 12px;
    width: 200px; /* Más grandes en PC */
    min-width: 200px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.lista-comunidad-card:hover {
    border-color: var(--color-acento-azul);
    transform: scale(1.05);
}

.lista-comunidad-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.lista-detalles {
    padding: 10px 12px 12px;
}

.lista-detalles h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-texto-principal);
}

.lista-detalles .creador {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-texto-secundario);
}

/* =========================================
   MEDIA QUERIES (Ajustes Móviles)
========================================== */
@media (max-width: 768px) {
    .banner-tematico-gigante {
        height: 250px;
        padding: 1.5rem;
    }
    .banner-tematico-gigante h2 { font-size: 2rem; }
    .banner-tematico-gigante p { font-size: 0.9rem; }
    
    .artista-circulo { min-width: 90px; }
    .artista-circulo img { width: 90px; height: 90px; }
    
    .resenas-grid { grid-template-columns: 1fr; /* 1 columna en móvil */ }
    .lista-comunidad-card { width: 150px; min-width: 150px; }
}
/* =========================================
   ANIMACIONES DE SCROLL (INTERSECTION OBSERVER)
========================================== */

/* 1. Estado inicial oculto para los textos del banner */
.banner-contenido .tag-semana,
.banner-contenido h2,
.banner-contenido p {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1); /* Curva suave y premium */
}

/* 2. Retrasos escalonados (El tag sale primero, luego el título, luego el texto) */
.banner-contenido h2 { transition-delay: 0.15s; }
.banner-contenido p { transition-delay: 0.3s; }

/* 3. La clase "visible" que inyectará JavaScript */
.banner-tematico-gigante.visible .tag-semana,
.banner-tematico-gigante.visible h2,
.banner-tematico-gigante.visible p {
    opacity: 1;
    transform: translateY(0);
}

/* 4. Efecto sutil de zoom en el banner al aparecer */
.banner-tematico-gigante {
    /* Agregamos una transición para que el fondo haga un zoom suave */
    transition: background-size 2s ease-out;
    background-size: 100% auto; /* Estado inicial */
}

.banner-tematico-gigante.visible {
    background-size: 110% auto; /* Estado final con zoom */
}
/* =========================================
   CAJAS CONTENEDORAS DE SECCIÓN
========================================== */
.caja-seccion {
    background-color: var(--color-tarjeta); /* Tu gris oscuro característico */
    border-radius: 12px; /* Los bordes redondeados de la imagen */
    padding: 1.5rem; /* El espacio interno para que no pegue a las orillas */
    margin-bottom: 2rem; /* Separación entre cada cuadro */
    /* Opcional: un borde súper sutil para darle más definición */
    
}

/* Quitamos el margen superior que tenían antes las sub-secciones porque la caja ya lo maneja */
.sub-seccion-tematica {
    margin-top: 0; 
}
/* =========================================
   MODIFICACIONES CARRUSEL DE RESEÑAS
========================================== */

/* 1. Nuevo fondo para que resalte y tamaño exacto de 3 por vista */
.review-card-wrap {
    background-color: #262739 !important; 
    
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    
    /* LA MAGIA: 100% del espacio, menos los dos espacios (30px), dividido en 3 */
    width: calc((100% - 30px) / 3);
    min-width: calc((100% - 30px) / 3); 
    
    flex: 0 0 auto;
    scroll-snap-align: start; /* Para el efecto magnético */
}

/* 2. Evitar que títulos muy largos empujen el nombre del usuario */
.album-info-wrap {
    max-width: 55%; /* Le da su espacio al perfil de la derecha */
}

.album-info-wrap h4, .album-info-wrap p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. El contenedor del Carrusel */
.resenas-carrusel {
    display: flex;
    gap: 15px; /* <- Asegúrate de que sea 15px */
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 10px 0;
    scrollbar-width: none; 
}

.resenas-carrusel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Móviles: Mostrar 1 sola tarjeta a la vez */
@media (max-width: 1024px) {
    .review-card-wrap {
        min-width: calc(100% - 10px); 
    }
}