/* --- Basic Settings & Font --- */
:root {
    --primary-color: #d9232d;
    --background-color: #121212;
    --surface-color: #1e1e1e; /* General background for containers */
    --card-background-color: #242424; /* Background for cards and rows */
    --text-color: #e0e0e0;
    --text-muted-color: #a0a0a0;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background-color);
    background-image: url('background.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Helper Classes & Accessibility --- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}


/* --- Header --- */
.site-header {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.site-title {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.site-title a {
    text-decoration: none;
    color: inherit;
}

.header-buttons button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.7rem 1.2rem;
    margin-left: 1rem;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.header-buttons button:hover {
    background-color: #b81c25;
}

/* --- Main Content & Container --- */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* --- Filter Section --- */
.filter-section {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-form input[type="text"],
.search-form select {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    background-color: #2c2c2c;
    color: var(--text-color);
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
}

.search-form input[type="text"] {
    flex-grow: 1;
}

.search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #b81c25;
}

.abc-list {
    text-align: center;
    word-spacing: 0.5rem;
}

.abc-list a {
    color: var(--text-muted-color);
    text-decoration: none;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    transition: color 0.3s, background-color 0.3s;
}

.abc-list a:hover {
    color: white;
}

.abc-list a.active {
    background-color: var(--primary-color);
    color: white;
}

/* --- Results Section --- */
.results-section {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title {
    color: white;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-muted-color);
    margin-right: auto;
    padding-left: 1rem;
}

.view-switcher {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.view-btn:hover {
    color: white;
    background-color: #2c2c2c;
}

.view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}


/* === GENERAL CARD STYLE === */
.record-card {
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
}

/* === DETAILS BUTTON === */
.details-btn {
    background-color: #383838;
    color: var(--text-color);
    border: 1px solid #555;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
}

.details-btn:hover {
    background-color: #444;
    border-color: #777;
}

/* === LISTEN BUTTONS === */
.listen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted-color);
    background-color: #383838;
    border: 1px solid #555;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.listen-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.listen-btn-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(3px);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    opacity: 1;
}

.listen-btn-overlay:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.listen-btn i {
    line-height: 1;
}


/* --- GRID VIEW --- */
.record-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.record-grid .record-card {
    flex-direction: column;
}

.record-grid .record-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.card-image-wrapper {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background-color: #2a2a2a;
}

.card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.record-grid .record-info { margin-bottom: 0.5rem; }
.record-title { font-size: 1.2rem; font-weight: 700; color: white; }
.record-artist { color: var(--text-muted-color); }
.record-grid .record-artist { margin-bottom: 0.8rem; }
.card-content p { font-size: 0.9rem; margin-bottom: 0.3rem; }
.record-actions-grid { margin-top: auto; }
.record-actions-grid .record-price { font-size: 1.3rem; font-weight: 700; color: var(--primary-color); }

.card-actions {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
}

/* --- LIST VIEW (REWORKED) --- */
.list-view { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
}
.list-view .record-card { 
    flex-direction: row; 
    align-items: center; 
    padding: 0.5rem 1rem;
    gap: 1.5rem; 
    border-radius: 5px; 
    border: 1px solid transparent; 
}
.list-view .record-card:hover { 
    transform: none; 
    box-shadow: none; 
    background-color: #333; 
    border-color: var(--border-color); 
}
.list-view .card-image-wrapper { 
    width: 60px; 
    height: 60px; 
    padding-top: 0; 
    flex-shrink: 0; 
    border-radius: 4px; 
    overflow: hidden; 
}
.list-view .card-content { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    padding: 0; 
    gap: 1.5rem; 
    min-width: 0;
}
.list-view .record-info { 
    flex: 1; 
    min-width: 0; 
}
.list-view .record-title { 
    font-size: 1.1rem; 
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-view .record-artist { 
    font-size: 0.9rem; 
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-view .record-actions-list { 
    display: flex; 
    align-items: center; 
    gap: 1.2rem;
    flex-shrink: 0; 
}
.list-view .record-format-tag {
    background-color: #333;
    color: var(--text-muted-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}
.list-view .record-condition-tag {
    background-color: #3a3a3a;
    color: var(--text-muted-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    min-width: 60px;
}
.list-view .record-price {
    margin: 0;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    width: 80px;
    text-align: right;
    white-space: nowrap;
}
.list-view .record-price::before {
    content: '€';
    margin-right: 0.25em;
}
.list-view .details-btn { 
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    width: auto;
}

/* --- HIDE ELEMENTS PER VIEW --- */
.list-view .grid-details, .list-view .record-actions-grid, .list-view .listen-btn-overlay { display: none; }
.record-grid .record-actions-list { display: none; }
.no-results { grid-column: 1 / -1; text-align: center; font-size: 1.2rem; padding: 3rem; background-color: var(--surface-color); border-radius: 8px; }


/* --- Modals GENERAL --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-in-out forwards;
    overflow-y: auto;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-20px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.modal-content {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    position: relative;
    animation: slideIn 0.4s ease-out;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: auto;
}
.modal-content.large { max-width: 900px; }
.modal-content:not(.large) { max-width: 600px; padding: 2rem; }

.close-modal {
    color: var(--text-muted-color);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.close-modal:hover { color: var(--primary-color); }


/* --- DETAILS MODAL STYLES --- */
.modal-body {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.modal-image-container {
    flex-basis: 300px;
    flex-shrink: 0;
}

.modal-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.modal-info-container {
    flex-grow: 1;
    min-width: 0;
}

#modal-title {
    font-size: 2rem;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.modal-artist-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted-color);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
.modal-details-grid p {
    margin: 0;
    font-size: 0.9rem;
}
.modal-details-grid p strong {
    color: var(--text-muted-color);
}
.modal-details-grid p span {
    color: var(--text-color);
}

.modal-description {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.modal-description h3 {
    margin-bottom: 0.5rem;
    color: white;
}

.modal-description p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted-color);
}

/* --- Pagination Styles --- */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: inline-block;
}

.pagination-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pagination-item {
    margin: 0;
}

.pagination-link,
.pagination-ellipsis {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    background-color: var(--card-background-color);
    text-decoration: none;
    border-left: 1px solid var(--border-color);
    transition: background-color 0.3s;
    font-weight: 700;
    font-size: 0.9rem;
}
.pagination-item:first-child .pagination-link {
    border-left: none;
}

.pagination-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination-item.active .pagination-link {
    background-color: var(--primary-color);
    color: white;
    cursor: default;
}

.pagination-item.disabled {
    pointer-events: none;
}
.pagination-item.disabled .pagination-link,
.pagination-item.disabled .pagination-ellipsis {
    color: #666;
    background-color: #202020;
}


/* --- Responsive Settings --- */
@media (max-width: 920px) {
    .modal-content.large {
        max-width: 500px;
    }
    .modal-body {
        flex-direction: column;
        gap: 1.5rem;
    }
    .modal-image-container {
        flex-basis: auto;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 1rem; }
    .search-form { flex-direction: column; }
    .container { padding: 0 1rem; }

    .list-view .record-card { 
        flex-direction: column; 
        align-items: stretch;
    }
    .list-view .card-image-wrapper { 
        width: 100%; 
        height: auto; 
        padding-top: 100%; 
        position: relative;
    }
    .list-view .card-content { 
        flex-direction: column; 
        align-items: flex-start; 
        width: 100%;
        gap: 0.5rem;
    }
    .list-view .record-actions-list { 
        flex-wrap: wrap; 
        width: 100%; 
        margin-top: 1rem; 
        justify-content: flex-end;
    }

    .modal-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.5rem; }
    .abc-list { word-spacing: 0; line-height: 2; padding: 0 0.5rem; }
    .abc-list a { margin: 0 0.1rem; }
    .record-grid { grid-template-columns: 1fr; }
    .modal-body { padding: 1.5rem; }
    #modal-title { font-size: 1.5rem; }

    .pagination-link, .pagination-ellipsis {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .results-count {
        width: 100%;
        text-align: center;
        padding: 0;
        margin-bottom: 1rem;
    }
}