@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* --- RESETEO UNIVERSAL & BASES --- */
* {
    box-sizing: border-box;
    /* CLAVE: Evita que los paddings agranden los elementos */
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #030303;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* Altura dinámica real en móviles */
    user-select: none;

    /* SOPORTE PARA MÓVILES MODERNOS (NOTCH/ISLA DINÁMICA) */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* --- LOADING --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

#loading-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.loader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.view {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;

    /* CAMBIO: Quitamos padding general para manejarlo en los hijos */
    padding: 0;

    position: absolute;
    top: 0;
    left: 0;
    background: #030303;
    z-index: 1;

    /* CAMBIO: Quitamos el padding-bottom aquí, lo pondremos en el grid */
    padding-bottom: 0;
}

.view.active-view {
    display: flex;
    z-index: 10;
}

/* --- HOME --- */
#artist-selection-view {
    padding: 0;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #030303;
    position: sticky;
    top: 0;
    z-index: 20;
    height: 70px;
    /* Un poco más alto para que no se vea apretado */
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.brand-logo span {
    font-weight: 900;
    font-size: 1.4em;
    letter-spacing: -1px;
}

.search-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centramos el icono cuando está cerrado */
    background: #1f1f1f;
    border-radius: 50px;
    padding: 8px;
    /* Padding uniforme */
    width: 45px;
    /* Un poco más ancho para que respire */
    min-width: 45px;
    /* Evita que se aplaste */
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.search-minimal:focus-within {
    width: 200px;
    justify-content: flex-start;
    padding-left: 15px;
}

.search-minimal i {
    color: #fff;
    font-size: 1.1em;
    min-width: 20px;
    text-align: center;
}

.search-minimal input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    margin-left: 8px;
    outline: none;
    font-size: 0.9em;
}

#album-search-input {
    background-color: transparent !important;
    /* Forzamos transparencia */
    background: transparent !important;
    border: none;
    color: white;
    width: 100%;
    font-size: 1em;
    outline: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    /* Quita sombras nativas de Android/iOS */
}

/* --- CONTENIDO PRINCIPAL --- */
.home-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 20px;
    /* Espacio lateral constante */
    padding-bottom: 0px !important;
}

/* Espaciador invisible final */
.home-content::after {
    content: "";
    display: block;
    min-height: 80px;
    /* Suficiente para el mini player */
    width: 100%;
    background: transparent;
    flex-shrink: 0;
}

.section-title {
    font-size: 1.3em;
    margin-bottom: 18px;
    margin-top: 15px;
    /* Más aire arriba */
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- RECOMENDACIONES (GRID HORIZONTAL) --- */
#recommendations-grid {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    /* Tarjetas ligeramente más anchas */
    gap: 12px;
    /* Más espacio entre tarjetas */

    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 10px;
    margin-bottom: 30px;
    /* Separación con la siguiente sección */
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

#recommendations-grid::-webkit-scrollbar {
    display: none;
}

.rec-card {
    background: #181818;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    scroll-snap-align: start;
    width: 100%;
    transition: background 0.2s;
}

.rec-card:active {
    background: #2a2a2a;
}

.rec-card img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 8px;
    display: block;
}

.rec-card h4 {
    font-size: 0.9em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-card p {
    margin: 4px 0 0 0;
    font-size: 0.75em;
    color: #aaa;
}

/* --- ARTISTAS --- */
.artist-grid {
    display: flex;
    gap: 20px;
    /* Más separación entre círculos */
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.artist-grid::-webkit-scrollbar {
    display: none;
}

.artist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;

    /* ESTO ES CLAVE: Evita que se aplasten */
    min-width: 90px;
    width: 90px;
    flex-shrink: 0;

    scroll-snap-align: start;
}

.artist-img-container {
    width: 90px;
    height: 90px;
    /* Asegura círculo perfecto */
    border-radius: 50%;
    overflow: hidden;
    background: #181818;
    /* Fondo por si la imagen tarda */
}

.artist-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-card h3 {
    margin: 0;
    font-size: 0.9em;
    text-align: center;
    max-width: 100px;
    line-height: 1.2;
}

/* --- FILAS DE ÁLBUMES (HOME) --- */
.home-album-section {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

/* Quitamos margen solo al último visible */
.home-album-section:last-child {
    margin-bottom: 0 !important;
}

.home-album-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    cursor: pointer;
}

.home-album-header img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.home-album-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
}

.home-album-header p {
    margin: 2px 0 0 0;
    font-size: 0.85em;
    color: #aaa;
}

.home-songs-scroller {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-right: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.home-songs-scroller::-webkit-scrollbar {
    display: none;
}

.home-song-card {
    min-width: 120px;
    /* Un poco más grandes */
    width: 120px;
    flex-shrink: 0;
    scroll-snap-align: start;
    cursor: pointer;
}

.home-song-card img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 8px;
}

.home-song-card h4 {
    margin: 0;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #eee;
}

/* --- VISTA DE ÁLBUMES (DETALLE) --- */
.search-wrapper {
    background-color: #212121;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Borde sutil para definición */
}

.top-bar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 60px;
    /* Un poco más alto */

    /* NUEVO: Padding lateral para compensar lo que quitamos en .view */
    padding: 0 20px;

    margin-bottom: 10px;
}

.nav-icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.4em;
    cursor: pointer;
    padding: 10px;
    /* Área de toque más grande */
}

#album-view-title {
    font-size: 1.4em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#album-grid-container {
    /* FLEXIBILIDAD TOTAL */
    flex-grow: 1;
    min-height: 0;
    /* Clave para el scroll */

    /* SCROLL */
    overflow-y: auto;
    overflow-x: hidden;

    /* ESPACIADO INTERNO */
    padding: 0 20px;
    /* Recuperamos el margen lateral aquí */
    padding-bottom: 160px !important;
    /* MUCHO espacio final para el player */

    /* GRID (Por defecto) */
    display: grid;
    gap: 15px;
    scroll-behavior: smooth;
}

#album-grid-container:not(.artist-view-layout) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.album-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    align-items: flex-start;
    /* Alinea todo a la izquierda */
    width: 100%;
}

.album-item h4 {
    margin: 0;
    /* Importante: quita márgenes por defecto */
    margin-top: 2px;
    /* Opcional: un mini respiro si queda MUY pegado */
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1.2;
}

.album-item img {
    width: 100%;
    aspect-ratio: 1/1;
    /* Mantiene cuadrado perfecto */
    object-fit: cover;
    border-radius: 8px;
    background: #181818;
}

/* Lista de canciones en modo álbum */
#album-grid-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- CORRECCIÓN LISTA DE CANCIONES --- */
.album-item.song-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* Centrado vertical perfecto */
    padding: 12px 0;
    /* Más aire arriba y abajo */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Línea más sutil */
    width: 100%;
    gap: 15px;
    /* Espacio entre imagen y texto */
}

.album-item.song-row img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    flex-shrink: 0;
    /* Evita que la imagen se aplaste */
    object-fit: cover;
}

.song-info-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    /* Ocupa el espacio restante */
    overflow: hidden;
    /* Para textos largos */
    margin: 0;
    /* Quitamos margen viejo */
}

.song-info-list h4 {
    margin: 0;
    font-size: 1em;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info-list p {
    margin: 0;
    font-size: 0.85em;
    color: #aaa;
}

/* --- REPRODUCTOR (KARAOKE VIEW) --- */
#karaoke-view {
    padding: 0;
    position: fixed;
    z-index: 100;
    background: #030303;
}

.karaoke-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    transition: background-color 0.6s ease;
    z-index: -1;
}

.ytm-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    height: 60px;
    z-index: 200;
}

.player-nav-tabs {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 10px 0;
    z-index: 200;
    position: relative;
}

.tab-item {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95em;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-item.active-tab {
    color: #fff;
    border-bottom-color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.ytm-main-content {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    /* Ajustado */
    height: calc(100% - 340px);
    overflow: hidden;
}

#cover-display-area {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    transition: opacity 0.3s;
}

#cover-display-image {
    width: 85%;
    max-width: 350px;
    /* Limite para tablets */
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* --- LETRAS (LYRICS) --- */
#lyrics-display-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    flex-direction: column;
    padding: 0 40px;
    box-sizing: border-box;
    overflow-y: auto;
    align-items: center;
    text-align: center;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    z-index: 50;
    scrollbar-width: none;
}

#lyrics-display-area::-webkit-scrollbar {
    display: none;
}

#lyrics-display-area.show {
    display: flex;
}

.lyric-line {
    font-size: 1.8em;
    /* Un pelín más pequeño para evitar cortes en pantallas angostas */
    color: rgba(255, 255, 255, 0.5);
    margin: 20px 0;
    font-weight: 900;
    cursor: pointer;
    transition: 0.3s;
    word-wrap: break-word;
    width: 100%;
    line-height: 1.3;
}

.lyric-line.active {
    color: #ffffff;
    transform: scale(1.05);
    transform-origin: center;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

/* Espacios iniciales/finales para las letras */
.lyric-line:first-child {
    margin-top: 45vh;
}

.lyric-line:last-child {
    margin-bottom: 50vh;
}

/* --- CONTROLES FLOTANTES --- */
.ytm-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 340px;
    /* Altura fija para controles */
    padding: 20px 30px 50px 30px;
    /* Padding inferior seguro */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 500;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.4s ease;
}

#karaoke-view.lyrics-mode .ytm-player-controls {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
}

#karaoke-view.lyrics-mode #cover-display-area {
    display: none;
}

#karaoke-view.lyrics-mode #lyrics-display-area {
    display: flex;
    padding-top: 0;
}

.song-info-row {
    display: flex;
    margin-bottom: 25px;
    align-items: flex-start;
}

.text-info h2 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-info p {
    margin: 5px 0 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
}

#seek-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    appearance: none;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 2px;
}

#seek-bar::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    margin-top: -5px;
    margin-bottom: 25px;
    font-weight: 500;
}

.main-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 10px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.9;
    transition: transform 0.1s;
}

.control-btn:active {
    transform: scale(0.9);
}

.control-btn.active {
    color: #fff;
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.control-btn.medium {
    font-size: 2.5em;
}

.control-btn.small {
    font-size: 1.5em;
}

.control-btn.large {
    width: 70px;
    height: 70px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    font-size: 1.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.control-btn.large.play::after {
    content: '►';
    margin-left: 4px;
}

.control-btn.large.pause::after {
    content: '❚❚';
}

/* --- PLAYLIST PANEL --- */
#playlist-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.98);
    z-index: 1001;
    transition: top 0.3s;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#playlist-panel.show {
    top: 0;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#close-playlist-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

#playlist-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: #141414;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease-out;
}

.playlist-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    margin-right: 15px;
    object-fit: cover;
    pointer-events: none;
}

.playlist-item .info {
    flex-grow: 1;
    pointer-events: none;
}

.playlist-item h4 {
    margin: 0 0 4px 0;
    font-size: 1em;
    color: #fff;
}

.playlist-item p {
    margin: 0;
    font-size: 0.8em;
    color: #aaa;
}

.playlist-item.active-playlist-item h4 {
    color: #3ea6ff;
}

.drag-handle {
    color: #666;
    padding: 15px;
    cursor: grab;
    margin-left: auto;
    font-size: 1.2em;
}

.swiped-delete {
    transform: translateX(-100%) !important;
    opacity: 0;
}

#mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    /* Un poco más alto para mejor toque */
    background: #212121;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;

    /* AUMENTAMOS EL PADDING A LOS LADOS */
    padding: 0 20px;

    z-index: 50;
    transition: transform 0.3s;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

#mini-player.hidden {
    transform: translateY(100%);
}

.mini-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    overflow: hidden;
}

#mini-cover {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
}

.mini-text h4 {
    margin: 0;
    font-size: 0.9em;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-text p {
    margin: 0;
    font-size: 0.8em;
    color: #aaa;
}

.mini-controls button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    padding: 10px;
}

.mini-progress-bar {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom) + 0px);
    /* Justo encima del borde */
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
}

#mini-progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
}

/* --- MENÚS & DROPDOWNS --- */
#custom-context-menu {
    position: fixed;
    background: #282828;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 10000;
    min-width: 220px;
    padding: 8px 0;
}

#custom-context-menu.hidden {
    display: none;
}

.context-menu-item {
    padding: 12px 20px;
    font-size: 0.95em;
    color: #eee;
    display: flex;
    align-items: center;
    gap: 15px;
}

.context-menu-item:hover {
    background: #3e3e3e;
}

.search-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 280px;
    max-height: 400px;
    background-color: #1f1f1f;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 5px 0;
}

.search-dropdown.hidden {
    display: none;
}

.search-result-item img {
    width: 45px !important;
    /* Ancho fijo */
    height: 45px !important;
    /* Alto fijo */
    min-width: 45px !important;
    /* Para que no se aplaste nunca */
    border-radius: 4px;
    object-fit: cover;
    /* Recorte cuadrado perfecto */
    margin-right: 12px;
    /* Separación del texto */
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Alineado a la izquierda */
    height: auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Corta cualquier cosa que se salga */
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #333;
}

.search-result-info h4 {
    margin: 0;
    font-size: 0.9em;
    color: #fff;
}

.search-result-info p {
    margin: 3px 0 0 0;
    font-size: 0.75em;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 700;
}

/* --- style.css --- */

/* Contenedor principal de la vista de artista */
.artist-view-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-bottom: 120px;
    /* Espacio para el player */
}

/* Títulos de sección internos */
.artist-section-title {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

/* 1. LISTA DE CANCIONES SUGERIDAS (Vertical) */
.artist-top-tracks {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.artist-track-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.artist-track-item img {
    width: 45px;
    height: 45px;
    border-radius: 4px;
    margin-right: 15px;
    object-fit: cover;
}

.artist-track-item .info {
    display: flex;
    flex-direction: column;
}

.artist-track-item h4 {
    margin: 0;
    font-size: 0.95em;
    color: white;
}

.artist-track-item p {
    margin: 2px 0 0 0;
    font-size: 0.8em;
    color: #aaa;
}

.artist-albums-carousel {
    display: flex;
    gap: 15px;

    /* Scroll horizontal sí, vertical no */
    overflow-x: auto;
    overflow-y: hidden;

    /* SOLUCIÓN CLAVE: Altura mínima explícita */
    /* 140px (imagen) + 40px (texto) + espacios = ~200px */
    /* Ponemos 240px para ir sobrados y que no corte nada */
    min-height: 240px;

    /* Padding generoso arriba y abajo para que la sombra no se corte */
    padding: 20px 5px 40px 5px !important;

    width: 100%;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;

    /* Asegura que los items se alineen arriba y no se estiren */
    align-items: flex-start;
}

.artist-albums-carousel::-webkit-scrollbar {
    display: none;
}

.artist-album-card {
    min-width: 140px;
    width: 140px;
    flex-shrink: 0;
    /* Impide que se encojan */
    scroll-snap-align: start;

    display: flex;
    flex-direction: column;

    /* Importante: permite que el contenido salga si es necesario (sombras) */
    /* pero ya no generará scroll porque el padre lo tiene oculto */
    overflow: visible !important;
    height: auto !important;
    margin-bottom: 0 !important;
    /* Limpieza de márgenes */
}

.artist-album-card img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    object-fit: cover;
}

.artist-album-card h4,
.artist-album-title {
    /* Usamos ambas clases por seguridad */
    display: block !important;
    font-size: 0.85em !important;
    color: #ffffff !important;
    /* Blanco forzado */
    margin: 8px 0 0 0 !important;
    /* Separación de la imagen */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    opacity: 1 !important;
    z-index: 10;
    /* Aseguramos que esté encima de todo */
}

/* --- style.css --- */

/* NUEVA GRID DE CANCIONES (4 filas, scroll horizontal) */
.artist-songs-grid {
    display: grid;

    /* 1. Usamos '1fr' para que las 4 filas se repartan el espacio equitativamente */
    grid-template-rows: repeat(4, 1fr);

    grid-auto-flow: column;
    grid-auto-columns: 280px;
    gap: 12px;

    overflow-x: auto;
    overflow-y: hidden;
    /* Bloqueo total vertical */

    /* 2. SOLUCIÓN FINAL: Altura Fija y Obligatoria */
    /* 4 items x ~70px = 280px + gaps. Le damos 320px para ir sobrados. */
    height: 320px !important;
    min-height: 320px !important;

    /* Padding pequeño para proteger sombras */
    padding: 5px 5px 10px 5px;

    margin-bottom: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.artist-songs-grid::-webkit-scrollbar {
    display: none;
}

/* Ajuste para que las canciones se vean bien en la grid */
.artist-track-item {
    /* Aseguramos que ocupen el ancho de la columna */
    width: 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
    /* Un fondo sutil para separar visualmente */
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px;
    border: none;
    /* Quitamos bordes viejos */
}

/* --- HERO HEADER (Imagen Gigante Estilo YT Music) --- */
#hero-header-container {
    position: relative;
    width: 100%;
    height: 350px;
    /* Altura de la imagen */
    flex-shrink: 0;
    margin-bottom: -60px;
    /* Hacemos que el contenido empiece un poco antes para efecto visual */
    z-index: 0;
}

#hero-header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Capa extra de gradiente para asegurar que se funda con el negro de fondo */
.hero-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(3, 3, 3, 0) 0%, rgba(3, 3, 3, 0.4) 60%, #030303 100%);
    pointer-events: none;
}

/* Modificamos la barra superior para que sea transparente y esté encima */
.top-bar-nav {
    position: absolute;
    /* Flota sobre la imagen */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    /* Encima de la imagen */
    background: transparent;
    /* Transparente */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    /* Sombra al texto para que se lea */
    padding: 10px 20px;
}

.top-bar-nav h1 {
    font-size: 1.8em;
    /* Título más grande estilo Portada */
    font-weight: 800;
}

/* Ajuste al grid para que no se pegue demasiado */
#album-grid-container {
    position: relative;
    z-index: 2;
    /* Encima del gradiente */
    padding-top: 20px;
    /* Espacio tras el margen negativo */
}