/* ======================================================
   1. VARIABLES Y ESTILOS BASE
   ====================================================== */
:root {
    --spotify-green: #1DB954;
    --spotify-light-black: #121212;
    --spotify-black: #040404;
    --spotify-med-black: #181818;
    --spotify-dark-gray: #282828;
    --spotify-light-gray: #b3b3b3;
    --spotify-med-gray: #535353;
}

body {
    background-color: var(--spotify-light-black);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0 0 90px 0; /* Margen inferior para el reproductor */
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.btn-primary {
    display: inline-block;
    background: var(--spotify-green);
    color: var(--spotify-black) !important;
    padding: 10px 24px;
    border-radius: 500px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.2s;
}
.btn-primary:hover {
    transform: scale(1.05);
}

/* ======================================================
   2. HEADER Y NAVEGACIÓN
   ====================================================== */
.main-header {
    background-color: var(--spotify-black);
    padding: 20px 40px;
}
.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}
.logo i {
    color: var(--spotify-green);
}
.main-nav {
    display: inline-block;
    margin-left: 30px;
}
.main-nav a {
    color: var(--spotify-light-gray);
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.2s;
}
.main-nav a:hover {
    color: #fff;
}

/* ======================================================
   3. CONTENIDO PRINCIPAL Y TARJETAS
   ====================================================== */
.main-content {
    padding: 20px 40px;
}
.main-view h1 {
    font-size: 28px;
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.card {
    background-color: var(--spotify-med-black);
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}
.card:hover {
    background-color: var(--spotify-dark-gray);
}
.card img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.card-info {
    margin-top: 10px;
}
.card-title {
    display: block;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-subtitle {
    display: block;
    color: var(--spotify-light-gray);
    font-size: 14px;
    margin-top: 5px;
}

/* ======================================================
   4. PÁGINAS ESPECÍFICAS
   ====================================================== */

/* --- Página de Álbum --- */
.album-header {
    display: flex;
    align-items: flex-end;
    gap: 25px;
    padding: 60px 40px;
    background: linear-gradient(rgba(0,0,0,0.6), #121212 90%);
}
.album-cover {
    width: 230px;
    height: 230px;
    box-shadow: 0 4px 60px rgba(0,0,0,0.5);
    border-radius: 4px;
    flex-shrink: 0;
}
.album-details span {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}
.album-details h1 {
    font-size: 3.5rem;
    margin: 10px 0;
}
.album-details p {
    color: var(--spotify-light-gray);
    margin: 0;
    font-weight: 500;
}
.back-to-home {
    display: inline-block;
    color: var(--spotify-light-gray);
    font-weight: bold;
    margin-bottom: 20px;
}
.back-to-home:hover {
    color: #fff;
}
.back-to-home i {
    margin-right: 8px;
}

/* --- Lista de Canciones --- */
.songs-list-container {
    padding: 20px 40px;
}
.songs-table {
    width: 100%;
    border-collapse: collapse;
}
.songs-table th, .songs-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.songs-table th {
    color: var(--spotify-light-gray);
    font-size: 14px;
}
.songs-table td {
    color: var(--spotify-light-gray);
}
.song-row:hover {
    background-color: rgba(255,255,255,0.1);
    cursor: pointer;
}
.song-title {
    color: #fff;
    font-weight: 500;
}
.song-artist {
    display: block;
    font-size: 14px;
    color: var(--spotify-light-gray);
}
.song-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 15px;
}

/* --- Página de Artista --- */
.artist-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 40vh;
    padding: 40px;
    box-sizing: border-box;
    position: relative;
}
.artist-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 1;
}
.artist-photo {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.artist-details {
    position: relative;
    z-index: 2;
}
.artist-details span {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}
.artist-details h1 {
    font-size: 4rem;
    margin: 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* --- Página de Búsqueda --- */
.search-bar-container {
    background-color: var(--spotify-med-gray);
    padding: 15px;
    border-radius: 500px;
    position: relative;
    max-width: 400px;
}
.search-bar-container i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--spotify-light-gray);
}
.search-bar-container input {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    width: 100%;
    padding-left: 40px;
    outline: none;
}
.search-results {
    margin-top: 40px;
}
.results-section {
    margin-bottom: 40px;
}

/* ======================================================
   5. COMPONENTES FIJOS (REPRODUCTOR, MODAL)
   ====================================================== */

/* --- Reproductor de Audio --- */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background-color: var(--spotify-med-black);
    border-top: 1px solid var(--spotify-dark-gray);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}
.album-info { display: flex; align-items: center; gap: 15px; }
.album-info img { width: 56px; height: 56px; }
.song-details { display: flex; flex-direction: column; }
#player-song-title { color: #fff; font-weight: 500; }
#player-artist-name { color: var(--spotify-light-gray); font-size: 12px; }
.player-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.player-controls .buttons { display: flex; align-items: center; gap: 20px; }
.player-controls button { background: none; border: none; color: var(--spotify-light-gray); font-size: 18px; cursor: pointer; }
.player-controls button:hover { color: #fff; }
#play-pause-btn { font-size: 32px; color: #fff; }
.progress-container { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--spotify-light-gray); font-size: 12px; }
.progress-bar { background-color: var(--spotify-med-gray); height: 4px; border-radius: 2px; flex-grow: 1; cursor: pointer; }
.progress { background-color: #fff; height: 100%; width: 0%; border-radius: 2px; }

/* --- Modal de Video --- */
.video-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
}
.close-modal {
    position: absolute;
    top: -30px;
    right: 0;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ======================================================
   6. BLOQUE RESPONSIVE (MÓVIL)
   ====================================================== */
@media (max-width: 768px) {
    .main-header { padding: 15px 20px; }
    .main-nav { display: none; }
    
    .main-content { padding: 15px; }
    .grid-container { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }

    /* --- Ajustes de la PÁGINA DE ÁLBUM (Tu Petición) --- */
    .album-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 30px 20px;
    }
    .album-cover {
        width: 200px;
        height: 200px;
        margin-bottom: 20px;
    }
    .album-details {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .album-details h1 {
        font-size: 2.2rem;
    }
    .back-to-home {
        margin-bottom: 15px;
    }
    #download-album-btn {
        margin-top: 15px;
    }
    .songs-list-container {
        padding: 0 15px;
    }

    /* --- Ajustes de la PÁGINA DE ARTISTA --- */
    .artist-details h1 {
        font-size: 2.5rem;
    }

    /* --- Ajustes del REPRODUCTOR --- */
    .audio-player {
        grid-template-columns: 1fr 1fr;
        height: 120px;
        padding: 10px;
    }
    .player-controls {
        grid-column: 1 / span 2;
        order: 2;
    }
    .album-info {
        order: 1;
    }
    .volume-controls {
        order: 1;
    }
}