/* Scroll para la ventana de presentación de álbumes igual que canciones */
#albums-section .playlist-scroll {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}
#albums-section .playlist-scroll::-webkit-scrollbar {
    width: 8px;
    background: #18181b;
}
#albums-section .playlist-scroll::-webkit-scrollbar-thumb {
    background: #7a1a1a;
    border-radius: 4px;
}
#albums-section .playlist-scroll::-webkit-scrollbar-thumb:hover {
    background: #fff;
}
/* Scroll para la lista de canciones */
#recomendada-section .music-list {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}
/* Estilo de scrollbar para canciones */
#recomendada-section .music-list::-webkit-scrollbar {
    width: 8px;
    background: #18181b;
}
#recomendada-section .music-list::-webkit-scrollbar-thumb {
    background: #7a1a1a;
    border-radius: 4px;
}
#recomendada-section .music-list::-webkit-scrollbar-thumb:hover {
    background: #fff;
}
/* --- Estilos para sección de álbumes --- */
.album-list.grid-2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.2em 3em;
    width: 100%;
    justify-items: center;
    align-items: start;
    background: none;
    padding: 0.5em 0 1.5em 0;
}
.album-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: filter 0.18s, box-shadow 0.18s;
    width: 150px;
    max-width: 100%;
}
.album-item:hover {
    filter: brightness(1.08) drop-shadow(0 4px 16px #7a1a1a33);
}
.album-cover-wrap {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #18181b;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px #23232655;
    margin-bottom: 0.7em;
}
.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 0 8px #000a inset;
}
.album-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2em;
    justify-content: flex-start;
    width: 100%;
    margin-top: 0.2em;
}
.album-title {
    color: #fff;
    font-size: 1em;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 0.1em;
    text-align: center;
    width: 100%;
    white-space: normal;
    word-break: break-word;
}
.album-artist {
    color: #cccccc;
    font-size: 0.92em;
    font-family: inherit;
    font-weight: normal;
    text-align: center;
    width: 100%;
    margin-bottom: 0.2em;
    white-space: normal;
    word-break: break-word;
}
.album-link {
    color: #fff;
    background: none;
    border-radius: 4px;
    padding: 0.2em 0.7em;
    text-decoration: underline;
    font-size: 0.97em;
    font-family: inherit;
    border: none;
    transition: color 0.18s;
    text-align: center;
    width: fit-content;
    margin-top: 0.2em;
}
.album-link:hover {
    color: #7a1a1a;
    background: none;
}
/* --- Estilos generales y para MUSICA --- */
body.bg-musica {
    background: url('../img/backround/bg_candles.gif') no-repeat center center fixed;
    background-size: cover;
}
body {
    background: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}
.card {
    border-radius: 0;
    box-sizing: border-box;
}


/* --- Layout principal --- */
.music-layout {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 100vh;
    width: 100vw;
    padding-left: 32px;
    padding-right: 32px;
    box-sizing: border-box;
}
.music-layout .nav-card {
    margin: 28px 32px 40px 0; /* Un poco más arriba */
    min-height: 400px;
    background: #000;
    border: 2px solid #fff;
    border-right: 4px double #7a1a1a;
    width: 180px;
    min-width: 140px;
    padding: 1.5rem 1rem;
    font-size: 0.98rem;
}
.music-layout .nav-card h2 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid #fff;
    padding-bottom: 0.3rem;
    letter-spacing: 1px;
    font-weight: normal;
}
.music-layout .nav-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.music-layout .nav-card li {
    margin-bottom: 1.1rem;
}
.music-layout .nav-card a {
    color: #fff;
    text-decoration: underline;
    font-size: 1rem;
    border-bottom: 1px dotted #7a1a1a;
    padding: 2px 2px;
    border-radius: 2px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: color 0.2s, background 0.2s, border-bottom 0.2s;
}
.music-layout .nav-card a:hover {
    color: #7a1a1a;
    background: #fff1;
    border-bottom: 1px solid #fff;
}


/* Música recomendada: lista simple y minimalista */
.music-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
}

.music-list li {
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.music-link {
    display: block;
    width: 100%;
    max-width: 650px; /* Más angosto */
    margin: 0 auto;
    padding: 0.8em 0.7em; /* Menos padding lateral */
    color: #fff;
    background: #18181b;
    border-radius: 7px;
    text-decoration: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.08em;
    letter-spacing: 0.5px;
    transition: background 0.18s, color 0.18s;
    border: 1.5px solid #232326;
    box-shadow: 0 2px 8px #23232633;
    text-align: left;
}

.music-link:hover,
.music-link:focus {
    background: #7a1a1a;
    color: #fff;
    border-color: #fff;
    outline: none;
}

/* Ventana principal más ancha y con tabs/ficheros verticales fuera del contenido */
.music-main-window {
    background: rgba(0,0,0,0.92);
    border: 2px double #fff;
    box-sizing: border-box;
    width: 100%;
    max-width: 820px;
    min-width: 340px;
    margin-top: 28px; /* Un poco más arriba */
    margin-left: 0;
    position: relative;
    overflow: visible; /* Cambiado para permitir que los tabs sobresalgan */
    padding: 2.2rem 2.2rem 2.7rem 2.2rem;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* Tabs verticales fuera de la ventana de contenido, unidos visualmente al borde blanco */
.music-tabs {
    position: absolute;
    top: 38px;
    left: calc(100% + 2px); /* Desplaza los botones 2px a la derecha para cubrir el borde blanco */
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    z-index: 10;
}

/* Botones con borde izquierdo blanco para simular unión al borde de la ventana */
.music-tab {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    background: #18181b;
    color: #fff;
    border: 2px solid #232326;
    border-left: 2px solid #fff; /* Borde izquierdo blanco para unión visual */
    border-right: 4px solid #7a1a1a;
    border-radius: 0 14px 14px 0;
    padding: 0.7em 1.5em 0.7em 1.1em;
    cursor: pointer;
    box-shadow: 2px 0 8px #23232633;
    transition: background 0.18s, color 0.18s, border 0.18s;
    outline: none;
    position: relative;
    min-width: 130px;
    text-align: left;
    margin-left: 0;
}
.music-tab:last-child {
    border-right: 4px solid #fff;
    border-left: 2px solid #fff;
    border-radius: 0 14px 14px 0;
    text-align: left;
    margin-left: 0;
}
.music-tab:not(.active-tab):hover {
    background: #232326;
    color: #fff;
    border-right: 4px solid #7a1a1a;
}
.music-tab.active-tab {
    background: #232326;
    color: #fff;
    font-weight: bold;
    border-right: 4px solid #fff;
    border-left: 2px solid #fff;
    z-index: 11;
}

/* Pequeño "rasgado" en el borde para dar sensación de fichero antiguo */
.music-tab::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 28px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        #7a1a1a 2px,
        #7a1a1a 4px
    );
    opacity: 0.5;
    border-radius: 0 8px 8px 0;
    pointer-events: none;
    z-index: 1;
}
.music-tab.active-tab::after {
    background: repeating-linear-gradient(
        90deg,
        #fff,
        #fff 2px,
        #7a1a1a 2px,
        #7a1a1a 4px
    );
    opacity: 0.7;
}


/* Responsive: tabs dentro del contenido en pantallas pequeñas */
@media (max-width: 1100px) {
    .music-main-window {
        max-width: 98vw;
        padding: 1.2rem 0.7rem 1rem 0.7rem;
        flex-direction: column;
    }
    .music-tabs {
        position: static;
        flex-direction: row;
        margin-left: 0;
        margin-top: 1em;
        align-items: flex-start;
        justify-content: flex-start;
        height: auto;
        left: 0;
        top: 0;
    }
    .music-tab,
    .music-tab:last-child {
        border-radius: 8px 8px 0 0;
        min-width: 90px;
        text-align: center;
        padding: 0.5em 1em;
        border-right: 2px solid #232326;
        border-left: 2px solid #232326;
    }
    .music-tab::after {
        display: none;
    }
}

/* Responsive para ventana principal y tabs verticales */
@media (max-width: 1100px) {
    .music-main-window {
        max-width: 98vw;
        padding: 1.2rem 0.7rem 1rem 0.7rem;
    }
    .music-tabs {
        top: 10px;
        right: 10px;
    }
    .music-content {
        min-height: 180px;
    }
    .music-list {
        max-width: 98vw;
    }
}

/* --- Album Modal Styles --- */
.album-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.album-modal.active {
    display: flex;
}

.album-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeInDark 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.album-modal-content {
    position: relative;
    background: #0a0a0a;
    border: 1px solid rgba(122, 26, 26, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: modalGentleIn 0.3s ease;
    z-index: 10000;
}

.album-modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
    pointer-events: none;
    opacity: 0;
}

.album-modal-content::after {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid rgba(122, 26, 26, 0.15);
    pointer-events: none;
}

@keyframes fadeInDark {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalGentleIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInSubtle {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutSubtle {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

.album-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s, transform 0.2s;
    z-index: 10001;
    line-height: 1;
}

.album-modal-close:hover {
    color: #7a1a1a;
    text-shadow: 0 0 12px rgba(122, 26, 26, 0.8);
    transform: scale(1.1);
}

.album-modal-cover-wrap {
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    border: 2px solid #232326;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(122, 26, 26, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.album-modal-cover-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    pointer-events: none;
}

.album-modal-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.05) saturate(0.9);
    transition: filter 0.3s;
}

.album-modal-content:hover .album-modal-cover {
    filter: contrast(1.1) saturate(1);
}

.album-modal-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    width: 100%;
}

.album-modal-title {
    color: #fff;
    font-size: 1.4rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.album-modal-artist {
    color: #999;
    font-size: 1.1rem;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    letter-spacing: 0.5px;
}

.album-modal-year {
    color: #666;
    font-size: 0.95rem;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    font-style: italic;
}

.album-modal-listen {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.9rem 2.5rem;
    background: linear-gradient(180deg, #1a0808 0%, #0d0404 100%);
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.05rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid #7a1a1a;
    box-shadow: 
        0 4px 16px rgba(122, 26, 26, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.album-modal-listen::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(122, 26, 26, 0.2),
        transparent
    );
    transition: left 0.4s ease;
}

.album-modal-listen:hover {
    background: linear-gradient(180deg, #2a0a0a 0%, #1a0606 100%);
    border-color: #fff;
    color: #fff;
    box-shadow: 
        0 6px 24px rgba(122, 26, 26, 0.5),
        0 0 30px rgba(122, 26, 26, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.album-modal-listen:hover::before {
    left: 100%;
}

/* Make album items clickable */
.album-item {
    cursor: pointer;
}

.album-item .album-link {
    display: none;
}

/* Responsive modal */
@media (max-width: 500px) {
    .album-modal-content {
        padding: 1.8rem 1.2rem;
        max-width: 95%;
    }
    
    .album-modal-cover-wrap {
        width: 180px;
        height: 180px;
    }
    
    .album-modal-title {
        font-size: 1.2rem;
    }
    
    .album-modal-listen {
        padding: 0.7rem 1.8rem;
        font-size: 0.95rem;
    }
}

/* --- Sort Controls Styles --- */
.section-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.section-header h1 {
    margin: 0;
    flex-shrink: 0;
}

.sort-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.9rem;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid rgba(122, 26, 26, 0.3);
    border-radius: 3px;
    box-shadow: none;
    position: relative;
}

.sort-controls::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    pointer-events: none;
    border-radius: 0;
}

.sort-controls label {
    color: #666;
    font-size: 0.85rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: normal;
    letter-spacing: 0px;
    margin: 0;
    white-space: nowrap;
    opacity: 0.7;
}

.sort-select {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92rem;
    font-weight: normal;
    color: #ccc;
    background: rgba(18, 18, 20, 0.5);
    border: 1px solid rgba(122, 26, 26, 0.2);
    border-radius: 3px;
    padding: 0.5rem 0.7rem;
    padding-right: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    box-shadow: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/csvg%3e");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 1.1em 1.1em;
    padding-right: 2.2rem;
    letter-spacing: 0px;
}

.sort-select:hover {
    border-color: rgba(122, 26, 26, 0.4);
    background-color: rgba(24, 24, 27, 0.6);
    color: #fff;
}

.sort-select:focus {
    border-color: rgba(122, 26, 26, 0.6);
    color: #fff;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(122, 26, 26, 0.3);
}

/* Estilo para las opciones del select */
.sort-select option {
    background: #18181b;
    color: #fff;
    padding: 0.4rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: normal;
    border: none;
    box-shadow: none;
}

.sort-select option:hover {
    background: rgba(122, 26, 26, 0.5);
    color: #fff;
    box-shadow: none;
}

.sort-select option:checked {
    background: rgba(122, 26, 26, 0.4);
    color: #fff;
    font-weight: normal;
}

/* Responsive: move sort controls below title on small screens */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .sort-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .sort-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.5rem;
    }
    
    .sort-select {
        width: 100%;
    }
}

