/* Snappy Vinyl - Content Popup Styles
    Ported from PrimeReact to Native HTML5 Dialog
*/

/* --- 1. The Dialog Container & Backdrop --- */
dialog.content-popup {
    border: none;
    padding: 0;
    max-width: 1200px;
    width: 95%; /* Better fit for smaller screens */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background-color: #fff;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* --- 2. Header (Flexbox alignment) --- */
.content-popup .header-content {
    border-bottom: 1px solid #ddd;
    padding: 15px 20px;
    background-color: #fff;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-popup .popup-title {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
    color: #1d1d1d;
}

.content-popup .close-popup {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #696969;
    padding: 5px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

    .content-popup .close-popup:hover {
        color: #000;
    }

/* --- 3. Main Body & Scroll Logic --- */
.content-popup .popup-main-content {
    padding: 0; /* Let inner content handle padding for sticky headers */
    font-size: 14px;
    border-bottom: 3px solid #669933;
    background: #fff;
}

.content-popup .popup-body {
    /* Mimics the height limits from the React version */
    height: calc(100vh - 250px);
    max-height: 750px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.content-popup .popup-head {
    padding: 5px 8px;
    background-color: #f5f5f5;
    float: left;
    position: sticky;
    left: 0;
    top: 0;
    display: flex;
    gap: 8px;
}

    .content-popup .popup-head .alpha-filter {
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

.content-popup .filter-popup .popup-head .alpha-filter {
    border-right: 1px solid #fff;
    padding-right: 8px;
}

.content-popup .popup-head .alpha-filter li {
    width: 100%;
    height: 24px;
}

.content-popup .popup-head .alpha-filter button {
    border: none;
    width: 100%;
    background-color: transparent;
    color: #696969;
    font-size: 14px;
    position: relative;
    padding: 0 5px;
    margin: 5px 0;
    text-transform: uppercase;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -ms-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}

    .content-popup .popup-head .alpha-filter button.active,
    .content-popup .popup-head .alpha-filter button:hover {
        background-color: #669933;
        border-radius: 10px;
        color: #000;
    }

.content-popup .popup-head .alpha-filter li:last-child button:after {
    display: none;
}

.content-popup .popup-head .filter-list {
    padding: 20px 0;
}

    .content-popup .popup-head .filter-list ul {
        margin-bottom: 30px;
    }

    .content-popup .popup-head .filter-list li:last-child ul {
        margin-bottom: 0;
    }

    .content-popup .popup-head .filter-list a {
        display: inline-block;
        color: #000;
        padding: 0px 15px 0 5px;
        margin-bottom: 8px;
        position: relative;
    }

        .content-popup .popup-head .filter-list a:before {
            content: "";
            width: 0;
            height: 2px;
            background-color: #669933;
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            -webkit-transition: all 0.3s ease-in-out;
            -moz-transition: all 0.3s ease-in-out;
            -ms-transition: all 0.3s ease-in-out;
            transition: all 0.3s ease-in-out;
        }

        .content-popup .popup-head .filter-list a:hover:before {
            width: 100%;
        }

        .content-popup .popup-head .filter-list a:after {
            content: "\f101";
            font-family: fontawesome;
            position: absolute;
            right: 0;
        }

/* --- 5. Middle Sort Bar --- */
.content-popup .sortby-container {
    text-align: center;
    padding: 15px 10px 5px;
    background: #fff;
}

    .content-popup .sortby-container button {
        border: none;
        font-size: 13px;
        background-color: transparent;
        border-bottom: 2px solid transparent;
        margin: 0 15px;
        padding-bottom: 2px;
        color: #1d1d1d;
        cursor: pointer;
        transition: all 0.3s ease-in-out;
    }

        .content-popup .sortby-container button.active,
        .content-popup .sortby-container button:hover {
            border-color: #669933;
        }

/* --- 6. Data List (4 Columns) --- */
.content-popup ul.data-list {
    column-count: 4;
    column-gap: 20px;
    padding: 20px 25px;
    margin: 0;
    list-style: none;
}

/* For smaller genre popups, drop to 3 columns */
.content-popup .filter-popup ul.data-list {
    column-count: 3;
}

.content-popup ul.data-list li {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    break-inside: avoid; /* Prevents item splitting between columns */
    transition: all 0.3s ease-in-out;
    border-radius: 4px;
}

    .content-popup ul.data-list li:nth-child(odd) {
        background-color: #f9f9f9;
    }

    .content-popup ul.data-list li:hover {
        background-color: #669933 !important;
    }

.content-popup ul.data-list a {
    font-size: 14px;
    color: #696969;
    text-decoration: none;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-popup ul.data-list i {
    font-size: 11px;
    background-color: #ddd;
    color: #696969;
    border-radius: 50%;
    height: 22px;
    width: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 7. Footer & Pagination --- */
.content-popup .popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

    .content-popup .popup-footer span {
        font-size: 13px;
        font-weight: 600;
    }

    .content-popup .popup-footer button {
        border: none;
        background: transparent;
        font-weight: bold;
        font-size: 14px;
        cursor: pointer;
        padding: 5px 0;
        border-bottom: 2px solid transparent;
        transition: all 0.3s ease-in-out;
    }

        .content-popup .popup-footer button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .content-popup .popup-footer button:hover:not(:disabled) {
            border-color: #669933;
        }

/* --- 8. Responsive Fixes --- */
@media (max-width: 992px) {
    .content-popup ul.data-list {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .content-popup ul.data-list {
        column-count: 1;
    }

    .content-popup .popup-head {
        display: none;
    }
    /* Hide alpha on mobile to save space */
}
