/* Block wrapper styles */
.wp-block-tomato-toplist {
    margin: 1em 0;
}

.wp-block-tomato-toplist-placeholder,
.wp-block-tomato-toplist-error {
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    background-color: #f9f9f9;
    color: #666;
    font-style: italic;
}

.wp-block-tomato-toplist-error {
    border-color: #dc3232;
    background-color: #ffeaea;
    color: #dc3232;
}

/* fix for astra theme */
.casino-toplist-container {
    border: none;
    & .logo .ratings a, & .cta a {
        text-decoration: none;
    }
    & table, & tr, & tr td, & tr th {
        border: none;
    }
}
/* end fixes for astra */

.casino-toplist-container {
    width: var(--parent-width, 100%);
    container-type: inline-size;
    container-name: casino-toplist-container;
    & table {
        border-collapse: collapse;
        margin: 0 auto;
        width: 100%;
    }
    & thead {
        display: none;
    }
    & tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    & .logo {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        padding-top: 2rem;
    }
    & .logo .star {
        font-weight: 600;
    }
    & .logo .star.filled::before, & .logo .star.half_4::before {
        content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffc107' d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
    }
    & .logo .star.half_3::before {
        content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='75%25' stop-color='%23ffc107'/%3E%3Cstop offset='75%25' stop-color='%23e0e0e0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
    }
    & .logo .star.half_2::before {
        content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='50%25' stop-color='%23ffc107'/%3E%3Cstop offset='50%25' stop-color='%23e0e0e0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
    }
    & .logo .star.half_1::before {
        content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='25%25' stop-color='%23ffc107'/%3E%3Cstop offset='25%25' stop-color='%23e0e0e0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
    }
    & .logo .star::before, & .logo .star.half_0::before {
        content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23e0e0e0' d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
    }
    & .logo img {
        max-height: 48px;
        display: block;
        width: auto;
    }
    & .logo .ratings .brand-name {
        display: block;
        margin: 0.35rem 0 0;
        width: 100%;
        text-align: center;
        font-weight: 600;
        font-size: 0.9rem;
        line-height: 1.2;
        overflow-wrap: break-word;
    }
    & table tr {
        position: relative;
        display: flex;
        align-items: center;
        flex-direction: column;
        border-radius: 25px;
        border-top-left-radius: 0;
        border: 3px solid #33333311;
        padding: 10px;
        padding-bottom: 36px;
        box-shadow: 2px 2px 10px 4px #33333311;
        background: #fff;

        &.casino-highlight {
            border: 3px solid rgba(255 255 255 / 0%);
            z-index: 1;
            border-top-left-radius: 0;
            background: linear-gradient(to right, #ffd543, #ffff4d, #ffd543);

            &::after {
                content: '';
                position: absolute;
                z-index: -1;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: linear-gradient(to bottom, rgba(255 213 67 / 40%), #fff 80%);
                border-radius: 22px;
                border-top-left-radius: 0;
                background-color: #fff;
            }
        }
    }
    & table tr::before {
        content: attr(data-index);
        background: #003195;
        color: white;
        font-weight: 1000;
        position: absolute;
        top: 0;
        left: 0;
        width: 38.159px;
        height: 38.159px;
        text-align: center;
        align-content: center;
        border-radius: 0px 0px 8.251px 0px;
    }
    & table td {
        display: flex;
        align-items: center;
        justify-content: center;
        &  a {
            text-decoration: none;
            color: inherit;
        }
    }
    & .payment-delay {
        min-width: 80%;
        border: 1px solid rgba(130, 171, 255, 0.3);
        padding: 10px 0;
        flex-direction: column;
        align-items: center;
        font-size: 1.1em;
        font-weight: 600;
        color: #222;
        border-radius: 12.376px;
        background: #f6f9ff;
        text-align: center;
        min-height: 100%;
        margin: 10px 0px;
        &  span {
            display: block;
            font-weight: 400;
            font-size: 14px;
            &:first-child{
                font-weight: 600;
                font-size: 18px;
                &::before {
                    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23003195' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
                    font-weight: bold;
                    vertical-align: sub;
                }
            }
        }
    }

    & .pros {
        font-size: 0.98em;
        color: #444;
        & ul, & ol {
            list-style: none;
            padding-left: 0;
        }
        & li {
            list-style: none;
            padding: 0 0 0 1.7em;
            position: relative;
        }
        & li::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 1.5em;
            height: 1.5em;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23329f40' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
            background-size: contain;
            background-repeat: no-repeat;
        }
    }
    & .bonus {
        font-size: 1.1rem;
        font-weight: 800;
        color: #000;
        text-align: center;
        line-height: 1.6rem;
        width: 80%;
        padding-bottom: 32px;
    }
    & .cta {
        width: 80%;
        /* Fix for Mercury theme's default padding causing button alignment issues */
        padding: 0;
        & a {
            display: inline-block;
            border-radius: 32px;
            background: linear-gradient(180deg, #329f40 0%, #078116 100%);
            color: #fff !important;
            font-weight: 700;
            padding: 1rem 1.5rem;
            font-size: 1.1em;
            box-shadow: 0 2px 8px 0 rgba(31, 166, 60, 0.12);
            transition: background 0.2s, box-shadow 0.2s;
            border: none;
            cursor: pointer;
            text-align: center;
            width: 100%;
            box-sizing: border-box;
            &:hover {
                background: linear-gradient(90deg, #17912f 0%, #27b33a 100%);
                box-shadow: 0 4px 16px 0 rgba(31, 166, 60, 0.18);
            }
            &.disabled {
                background: #eee;
                color: #aaa;
                cursor: not-allowed;
            }
        }
    }

    @media (min-width: 900px) {
        &.alignwide, &.custom {
            max-width: var(--custom-width, var(--wp--style--global--wide-size, 1340px));
            & td{
                flex: 0 0 200px;
                &.payment-delay{
                    flex-grow: 1;
                }
                &.bonus{
                    flex-grow: 2;
                }
            }
        }

        & .pros {
            flex: 0 0 180px;
            padding-left: 10px;
        }
        & .payment-delay {
            min-width: inherit;
        }
        & .logo {
            padding-right: 12px;
            flex-direction: column;
            width: inherit;
        }
        & .logo img {
            max-width: 100%;
        }
        & .payment-delay {
            flex-direction: column;
        }
        & .cta {
            width: auto;
            padding: 0 30px 0 37px;
            & a{
                width: 90%;
            }
        }
        & table {
            font-size: 0.8em;
        }
        & table tr {
            flex-direction: row;
            align-items: stretch;
            padding-bottom: 10px;
        }
        & table tr:not(:last-child) {
            margin-bottom: 18px;
        }
        & table td {
            flex: 1;
            border-bottom: none;
            background: none;
            box-sizing: content-box;

        }
        & .small td {
            flex: 1;
        }
        & .cta a {
            padding: 1rem 0;
            max-width: 250px;
        }
        & .bonus {
            padding: 0 0 0 37px;
            flex: 0 0 200px;
            width: auto;
        }
        @container casino-toplist-container (max-width: 949px) {
            & .pros {
                display: none;
            }
        }
        @container casino-toplist-container (max-width: 770px) {
            & .bonus {
                padding: 0px 5px;
            }
            & .cta {
                padding: 0px;
            }
        }
        @container casino-toplist-container (max-width: 700px) {
            & .payment-delay {
                & span:first-child {
                    font-size: .8rem;
                }
                & span:last-child {
                    font-size: .7rem;
                }
            }
        }
    }
}
/* Fixes weird issue on parasite */
.casino-toplist-container td br {
    display: none;
}

/* Default: Mobile view */
#wp-block-tomato-toplist-regulated {
  display: block;
}

#wp-block-tomato-toplist-unregulated {
  display: none;
}
