@import "../../../../assets/scss/abstracts/variables";

@property --color-rdg-hpr-border {syntax: "<color>";inherits: true;initial-value: #ccc;}
@property --color-rdg-hpr-p {syntax: "<color>";inherits: true;initial-value: #8392ab;}
@property --color-rdg-hpr-tr-bg {syntax: "<color>";inherits: true;initial-value: #fff;}
@property --color-rdg-hpr-tr-border {syntax: "<color>";inherits: true;initial-value: #ddd;}
@property --color-rdg-hpr-th-bg {syntax: "<color>";inherits: true;initial-value: #EEF4FC;}
@property --color-rdg-hpr-win {syntax: "<color>";inherits: true;initial-value: #54B936;}
@property --color-rdg-hpr-lose {syntax: "<color>";inherits: true;initial-value: #E10000;}
@property --color-rdg-hpr-draw {syntax: "<color>";inherits: true;initial-value: #7c7c7c;}
@property --color-rdg-hpr-p-black {syntax: "<color>";inherits: true;initial-value: #222;}
@property --color-rdg-hpr-btn-bg {syntax: "<color>";inherits: true;initial-value: #1C4579;}
@property --color-rdg-hpr-btn-bg-hover {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-rdg-hpr-td-before {syntax: "<color>";inherits: true;initial-value: #1C4579;}
@property --color-rdg-hpr-team {syntax: "<color>";inherits: true;initial-value: #0160ac;}


.hierarchy-child, option[value*="-child"] {
    font-weight: 700;
}

.rdg-blocks .rdg-handicapper-pick-results {
    .preview-thumbs {
        background-image: url("../images/rdg-handicapper-pick-results-preview.png");
    }

    p {
        margin: 0;
    }

    .hpr-container {
        table {
            border: 1px solid var(--color-rdg-hpr-border);
            border-collapse: collapse;
            margin: 0;
            padding: 0;
            width: 100%;
            table-layout: fixed;
            color: var(--color-rdg-hpr-p);

            @media screen and (max-width: 865px) {
                border: 0;
            }

            thead {
                @media screen and (max-width: 865px) {
                    border: none;
                    clip: rect(0 0 0 0);
                    height: 1px;
                    margin: -1px;
                    overflow: hidden;
                    padding: 0;
                    position: absolute;
                    width: 1px;
                }
            }

            caption {
                margin: 0.5em 0 0.75em;
            }

            tr {
                background-color: var(--color-rdg-hpr-tr-bg);
                border: 1px solid var(--color-rdg-hpr-tr-border);
                padding: 0.35em;

                @media screen and (max-width: 865px) {
                    border-bottom: 3px solid var(--color-rdg-hpr-border);
                }
            }

            th {
                font-size: 12px !important;
                font-weight: 700 !important;
                line-height: 16.34px !important;
                text-transform: uppercase !important;
                background-color: var(--color-rdg-hpr-th-bg);
            }

            th,
            td {
                padding: 1em;
                text-align: center;
            }

            td {
                text-wrap: balance;
                font-size: 14px;

                @media screen and (max-width: 865px) {
                    border-bottom: 1px solid var(--color-rdg-hpr-tr-border);
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    text-align: right;
                }

                .win, .lose, .draw {
                    padding: 8px 16px;
                    border-radius: 0.3rem;
                    font-weight: 600;
                    color: var(--color-white);
                }

                .win {
                    background-color: var(--color-rdg-hpr-win);
                }

                .lose {
                    background-color: var(--color-rdg-hpr-lose);
                }

                .draw {
                    background-color: var(--color-rdg-hpr-draw);
                }
            }

            th:nth-child(1), 
            td:nth-child(1) { 
                width: 7.5rem; 

                @media screen and (max-width: 865px) {
                    width: auto;
                }
            }

            th:nth-child(2), 
            td:nth-child(2) { 
                width: 8rem;
                
                @media screen and (max-width: 865px) {
                    width: auto;
                }
            }

            th:nth-child(4), 
            td:nth-child(4) { 
                width: 6rem;
                
                @media screen and (max-width: 865px) {
                    width: auto;
                }
            }

            th:nth-child(5), 
            td:nth-child(5) { 
                width: 6rem; 

                @media screen and (max-width: 865px) {
                    width: auto;
                }
            }

            th:nth-child(7), 
            td:nth-child(7) { 
                width: 7rem; 
                
                @media screen and (max-width: 865px) {
                    width: auto;
                }
            }

            .bet-type, .score, .description {
                color: var(--color-rdg-hpr-p-black);
                font-weight: 600;
            }

            .teams, .bet-type, .score, .description {
                font-weight: 600;
            }

            .sport {
                font-weight: 700;
            }

            .teams {
                .team-wrapper {  
                    display: flex; 
                    flex-wrap: wrap; 
                    gap: 5px; 
                    justify-content: center;
                    
                    @media screen and (max-width: 510px) {
                        display: block;
                    }
                    .team {
                        color: var(--color-rdg-hpr-team);
                    }
                }
            }

        }

        @media screen and (max-width: 865px) {
            table, th, td {
                border-right: none !important;
                color:var(--color-rdg-hpr-p-black) !important;
            }

            table td::before {
                content: attr(data-label);
                float: left;
                font-weight: bold;
                text-transform: uppercase;
                color: var(--color-rdg-hpr-td-before);
            }

            table td:last-child {
                border-bottom: 0;
            }

            .sport, .teams, .bet-type, .score, .description {
                color:var(--color-rdg-hpr-p-black) !important;
            }

        }

        .load-more {
            width: 100%;
            display: grid;
            place-content: center;

            #load-more {
                background-color: var(--color-rdg-hpr-btn-bg);
                color: var(--color-white);
                padding: 10px 20px;
                border-radius: 6px;
                cursor: pointer;
                font-weight: 600;
                margin-top: 20px;
                transition: all ease 0.3s;

                &:hover {
                    background-color: var(--color-rdg-hpr-btn-bg-hover);
                }
            }
        }
    }
}

.acf-block-preview {
    .rdg-handicapper-pick-results {
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
    }
}
