/* Reset Básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
}

.brutalist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 4px solid #fff;
    background-color: #111;
}

.brutalist-header h1 {
    font-family: Impact, sans-serif;
    font-size: 3rem;
    letter-spacing: 2px;
    color: #9b0125;
    text-shadow: 2px 2px 0px #fff;
}

.brutalist-btn {
    background-color: #9b0125;
    color: #fff;
    border: 3px solid #fff;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 4px 4px 0px #fff;
    transition: all 0.1s ease-in-out;
}

.brutalist-btn:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 0px 0px 0px #fff;
    transform: translate(4px, 4px);
}

#btn-add-album,
#btn-logout {
    font-family: Impact, sans-serif;
    letter-spacing: 1px;
}

/* BOTONES DEL HEADER */
.header-actions {
    display: flex;
    gap: 1rem;
}

.logout-btn {
    background-color: transparent;
    color: #aaa;
    border-color: #555;
    box-shadow: 4px 4px 0px #555;
}

.logout-btn:hover {
    background-color: #9b0125;
    border-color: #9b0125;
    color: #fff;
    box-shadow: 0px 0px 0px #9b0125;
}

/* Grid para los Álbumes */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.loading-text {
    font-size: 1.5rem;
    color: #9b0125;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Tarjetas */
.brutalist-card {
    border: 4px solid #fff;
    background-color: #111;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease-in-out;
}

.brutalist-card:hover {
    transform: translate(-5px, -5px);
    box-shadow: 5px 5px 0px #9b0125;
}

.card-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-bottom: 4px solid #fff;
    filter: grayscale(100%) contrast(120%);
    transition: filter 0.3s;
}

.brutalist-card:hover .card-cover {
    filter: grayscale(0%) contrast(100%);
}

.card-no-cover {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    color: #444;
    font-size: 1.5rem;
    border-bottom: 4px solid #fff;
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-family: Impact, sans-serif;
    font-size: 2rem;
    color: #9b0125;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.card-band {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1rem;
}

.card-year {
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: #aaa;
}

/* Botones de acción pequeños */
.card-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    /* Empuja los botones al fondo */
}

.btn-action {
    flex: 1;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    cursor: pointer;
}

.btn-action.edit:hover {
    background: #fff;
    color: #000;
}

.btn-action.delete:hover {
    background: #9b0125;
    border-color: #9b0125;
}

/* ESTILOS DEL MODAL Y FORMULARIO */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background-color: #111;
    padding: 2rem;
}

.modal-title {
    color: #9b0125;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #fff;
    padding-bottom: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #aaa;
}

.form-group input,
.form-group select {
    background-color: #000;
    color: #fff;
    border: 2px solid #555;
    padding: 0.8rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #9b0125;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions button {
    flex: 1;
}

/* PANTALLA DE LOGIN */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    /* Fondo totalmente negro */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Por encima de todo */
    transition: opacity 0.5s ease;
}

.login-card {
    width: 90%;
    max-width: 400px;
    padding: 3rem 2rem;
}

.error-msg {
    color: #9b0125;
    font-weight: bold;
    text-align: center;
    margin-top: 1rem;
    animation: blink 1s infinite;
}

/* BARRA DE CONTROLES (BÚSQUEDA) */
.controls-bar {
    display: flex;
    gap: 1rem;
    margin: 2rem 2rem 0 2rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.controls-bar input,
.controls-bar select {
    flex: 1;
    min-width: 200px;
    background-color: #000;
    color: #fff;
    border: 2px solid #555;
    padding: 1rem;
    font-family: Impact, sans-serif;
    letter-spacing: 1px;
    font-size: 1.2rem;
    font-weight: normal;
    /* Se quita el bold extra porque Impact ya es pesada */
    text-transform: uppercase;
}

.controls-bar input:focus,
.controls-bar select:focus {
    outline: none;
    border-color: #9b0125;
}

/* MODAL DE DETALLES DEL ÁLBUM */
.details-layout {
    max-width: 800px;
    position: relative;
}

.close-corner {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    border: none;
    color: #9b0125;
    background: transparent;
}

.close-corner:hover {
    color: #fff;
    background: #9b0125;
}

.details-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #555;
    padding-bottom: 2rem;
}

.detail-cover-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 4px solid #fff;
}

.detail-subtitle {
    color: #aaa;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.details-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-height: 40vh;
    overflow-y: auto;
}

.brutalist-list {
    list-style: none;
    margin-top: 1rem;
}

.brutalist-list li {
    padding: 0.8rem 0;
    border-bottom: 1px dashed #555;
    font-size: 0.9rem;
}

.rating-score {
    color: #9b0125;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* GRUPO DE BANDA (SELECT + BOTÓN) */
.band-input-group {
    display: flex;
    gap: 0.5rem;
}

.band-input-group select {
    flex: 1;
    /* Ocupa todo el espacio posible */
}

/* Indicador de click en portadas */
.clickable-cover {
    cursor: pointer;
}

/* FORMULARIO PARA CANCIONES */
.mini-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed #555;
}

.mini-form input {
    background-color: #000;
    color: #fff;
    border: 1px solid #555;
    padding: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
}

.mini-form input:focus {
    outline: none;
    border-color: #9b0125;
}

.mini-form-row {
    display: flex;
    gap: 0.5rem;
}

.mini-form-row input {
    flex: 1;
    width: 100%;
    /* Evita que se desborden */
}

.brutalist-btn-small {
    background-color: #9b0125;
    color: #fff;
    border: 1px solid #fff;
    font-weight: bold;
    cursor: pointer;
    padding: 0 1rem;
}

.brutalist-btn-small:hover {
    background-color: #fff;
    color: #000;
}

/* TEXTAREA DE RESEÑAS */
.brutalist-textarea {
    width: 100%;
    background-color: #000;
    color: #fff;
    border: 1px solid #555;
    padding: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
    resize: vertical;
    /* Permite estirarlo solo hacia abajo */
    margin-top: 0.5rem;
}

.brutalist-textarea:focus {
    outline: none;
    border-color: #9b0125;
}