/* Page Background */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    background-color: #0A0A0A;
    font-family: Arial, Helvetica, system-ui, sans-serif;
    margin: 0;
    padding: 20px;
    color: #FFD400;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #000000;
    border: 2px solid #FFD400;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 212, 0, 0.1);
}

/* Header Styling */
.banner {
    background-color: #000000;
    padding: 10px 0;
    text-align: center;
}

#ratingPopup {
    scroll-margin-top: 20px;
}

.banner img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.header {
    background-color: #FFD400;
    color: #000000;
    padding: 2px 0;
    border-bottom: 2px solid #FFD400;
}

.header h2 {
    display: grid;
    grid-template-columns: 20% 26% 26% 18% 10%;
    gap: 0;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.header h2 > span {
    padding: 4px 12px;
    white-space: nowrap;
}

.header h2 > span:nth-child(1) { /* Release */
    text-align: left;
    padding-left: 14px;
}

.header h2 > span:nth-child(2) { /* Catalog */
    text-align: right;
}

.header h2 > span:nth-child(3) { /* Identification */
    text-align: left;
}

.header h2 > span:nth-child(4) { /* Acquisition Details */
    text-align: left;
    padding-left: 11px;
}

.header h2 > span:nth-child(5) { /* Personal Rating */
    text-align: right;
    padding-right: 12px;
    transform: translateX(-15px);
    position: relative;
}

.header h2 > span:nth-child(5)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #FFD400;
    transform: translateX(-6px);
}

/* Table Styling */
.cd-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #000000;
    color: #FFD400;
    table-layout: fixed; /* respect column widths */
}

.table-wrapper {
    max-height: none; /* allow full page height - no internal scrollbar */
    overflow: visible;
}

/* horizontal row separators */
.cd-row {
    border-bottom: 1px solid #FFD400;
}


.cd-row td {
    vertical-align: middle;
    padding: 8px 12px; /* reduced padding */
    text-align: left;
}

.cd-row td:last-child {
    border-right: none;
}

.col-release {
    flex: 2;
}

.col-catalog {
    flex: 1.2;
}

.col-identification {
    flex: 1.2;
}

.col-acquisition {
    flex: 0.9;
}

.col-release { width: 20%; }
.col-catalog { width: 26%; text-align: right; }
.col-catalog .field { text-align: right; }
.col-identification { width: 26%; }
.col-acquisition { width: 18%; }
.col-rating { width: 10%; text-align: right; white-space: nowrap; overflow: visible; padding-left: 12px; transform: translateX(-15px); position: relative; }
.col-rating::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #FFD400;
    transform: translateX(-6px);
}
.col-rating .rating {
    display: inline-block;
    white-space: nowrap;
    font-size: 16px; /* smaller to fit */
    letter-spacing: 1px;
}
.release-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Release container: thumbnail + text inline */
.release-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Album cover thumbnail sizing */
.album-cover {
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
    display: block;
    object-fit: cover;
    border: 1px solid #FFD400;
}

/* Field Styling */
.field {
    padding: 0;
    line-height: 1.4;
    color: #FFD400;
}

.album-title {
    font-weight: bold;
    font-size: 14px;
    color: #FFD400;
}

.artist-name {
    font-size: 12px;
    color: #FFD400;
    opacity: 0.9;
}

.label,
.catalog-number {
    font-size: 13px;
    color: #FFD400;
    margin-bottom: 4px;
}

.label strong,
.catalog-number strong {
    font-weight: bold;
}

.matrix,
.sids,
.year-region {
    font-size: 11px;
    color: #FFD400;
    line-height: 1.5;
}

.year-region {
    margin-top: 6px;
    padding-top: 0;
    border-top: none; /* removed separator line */
    opacity: 0.9;
}

.sids {
    margin-bottom: 4px;
}

.date,
.price {
    font-size: 13px;
    color: #FFD400;
    margin-bottom: 8px;
}

.price {
    font-weight: bold;
}

/* Rating Stars */
.rating {
    font-size: 20px;
    color: #FFD400;
    letter-spacing: 2px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.star-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Sort Button Styling */
.sort-button {
    background: none;
    border: none;
    color: #000000;
    font-size: 12px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
    transition: transform 0.2s;
    text-shadow: none;
    filter: none;
}

.sort-button:hover {
    transform: none;
}

.sort-button.ascending::after {
    content: '';
}

.sort-button.descending {
    transform: rotate(180deg);
}

.release-header-controls {
    display: inline-block;
    gap: 2px;
    position: relative;
    overflow: visible;
    line-height: 1;
    vertical-align: top;
}

#release-header .sort-button,
#release-header .search-toggle-button {
    vertical-align: top;
}

.search-toggle-button {
    width: 12px;
    height: 12px;
    background: url('search.png') no-repeat center;
    background-size: contain;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    vertical-align: middle;
}

.search-toggle-button.active {
    filter: brightness(0.7);
}

.release-search-panel {
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    display: flex;
    align-items: center;
    width: 0;
    height: 14px;
    opacity: 0;
    overflow: hidden;
    transform: translate(-4px, 0);
    transition: width 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
    pointer-events: none;
}

.release-search-panel.open {
    width: 180px;
    opacity: 1;
    transform: translate(0, 0);
    pointer-events: auto;
}

.album-search-input {
    width: 100%;
    height: 100%;
    border: 1px solid #000000;
    background-color: #FFD400;
    color: #000000;
    font-size: 10px;
    line-height: 12px;
    padding: 0 4px;
    outline: none;
    box-sizing: border-box;
}

.album-search-input::placeholder {
    color: #000000;
    opacity: 0.8;
}

#sort-price-btn {
    width: 12px;
    height: 12px;
    background-image: url('mula.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    padding: 0;
}

/* Rating Popup Styling */
.rating-popup {
    display: none !important;
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-color: rgba(0, 0, 0, 0.4);
    margin: 0;
}

.rating-popup.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.rating-popup-content {
    background-color: #000000;
    margin: 0;
    padding: 16px 20px;
    border: 2px solid #FFD400;
    border-radius: 0;
    width: 95%;
    max-width: 1100px;
    box-shadow: inset 0 0 0 1px rgba(255, 212, 0, 0.3), 0 0 40px rgba(255, 212, 0, 0.3);
    position: relative;
}

.rating-close {
    background-color: #FFD400;
    color: #000000;
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 10px;
    border: 2px solid #FFD400;
    border-radius: 0;
    transition: all 0.1s;
    line-height: 1;
    display: inline-block;
    min-width: 30px;
    text-align: center;
    margin-top: 2px;
}

.rating-close:hover,
.rating-close:focus {
    background-color: #000000;
    color: #FFD400;
    border: 2px solid #FFD400;
}

.rating-popup-content h3 {
    margin: 0 0 14px 0;
    color: #FFD400;
    text-align: left;
    font-size: 14px;
    font-weight: bold;
    border: none;
    padding: 0;
    display: inline;
}

.rating-scale {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    clear: both;
    padding-top: 10px;
}

.rating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background-color: #FFD400;
    border: none;
    border-radius: 0;
    transition: background-color 0.1s;
    text-align: center;
    clip-path: polygon(50% 0%, 61% 35%, 100% 35%, 75% 57%, 80% 100%, 50% 75%, 20% 100%, 25% 57%, 0% 35%, 39% 35%);
    width: 110px;
    height: 60px;
    color: #000000;
}

.rating-item:hover {
    background-color: #FFF;
    box-shadow: 0 0 8px rgba(255, 212, 0, 0.6);
}

.rating-number {
    background-color: transparent;
    color: #000000;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    font-weight: bold;
    font-size: 22px;
    flex-shrink: 0;
    border: none;
}

.rating-label {
    color: #000000;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.1;
    white-space: normal;
    max-width: 70px;
    word-break: break-word;
}

/* Scrollbar Styling removed (using page scroll) */