@import '../../../../assets/scss/abstracts/variables';
@import '../../../../assets/scss/abstracts/mixins';

@property --color-picks-vs-wait-bg {syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .8);}
@property --color-picks-vs-filter-select-box-shadow {syntax: "<color>"; inherits: true; initial-value: rgba(0, 0, 0, .15);}
@property --color-picks-vs-filter-select {syntax: "<color>"; inherits: true; initial-value: #3a96e0;}
@property --color-picks-vs-filter-select-bg  {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-filter-button {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-filter-button-link-info {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-filter-button-link-info-bg {syntax: "<color>"; inherits: true; initial-value: #0160ac;}
@property --color-picks-vs-filter-button-link-info-border {syntax: "<color>"; inherits: true; initial-value: #3a96e0;}
@property --color-picks-vs-filter-button-link-default {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-filter-button-link-default-bg {syntax: "<color>"; inherits: true; initial-value: #3a96e0;}
@property --color-picks-vs-filter-button-link-default-hover {syntax: "<color>"; inherits: true; initial-value: #3a96e0;}
@property --color-picks-vs-filter-button-link-default-hover-bg {syntax: "<color>"; inherits: true; initial-value: #cccccc;}
@property --color-picks-vs-picks-message-bg {syntax: "<color>"; inherits: true; initial-value: #f79e9e;}
@property --color-picks-vs-picks-message-border {syntax: "<color>"; inherits: true; initial-value: #891010;}
@property --color-picks-vs-picks-message-span {syntax: "<color>"; inherits: true; initial-value: #891010;}
@property --color-picks-vs-picks-pick-bg {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-picks-pick-teams-vs-logo-span {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-picks-pick-teams-vs-name-bg  {syntax: "<color>"; inherits: true; initial-value: #0160ac;}
@property --color-picks-vs-picks-pick-teams-vs-name-span  {syntax: "<color>"; inherits: true; initial-value: #ffffff;}
@property --color-picks-vs-picks  {syntax: "<color>"; inherits: true; initial-value: #0160ac;}

.rdg-blocks .rdg-picks-vs {
    &.full {
        width: calc(var(--vw, 1vw) * 100);
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        max-width: 99.55vw;

        .container.content {
            padding-left: 20px;
            padding-right: 20px;
        }
    }

    .container.content {
        width: 100%;
        display: flex;
        flex-direction: column;

        #wait {
            display: none;
            position: fixed;
            z-index: 1000;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            background: var(--color-picks-vs-wait-bg) url('../../assets/images/spinner.gif') 50% 50% no-repeat;
        }

        .filter {
            gap: 1rem;
            display: flex;
            padding-bottom: 2rem;

            @media (max-width: $breakpoint-md) {
                & {
                    flex-direction: column;
                }
            }

            .categories {
                display: flex;
                align-items: center;
                justify-content: var(--category-align);

                &.w-100 {
                    width: 100%;

                    .select {
                        @media (max-width: $breakpoint-md) {
                            & {
                                width: 60%;
                            }
                        }

                        @media (max-width: $breakpoint-sm) {
                            & {
                                width: 100%;
                            }
                        }
                    }
                }

                &.w-50 {
                    width: 50%;

                    @media (max-width: $breakpoint-md) {
                        & {
                            width: 100%;
                            justify-content: center;
                            padding-bottom: 1rem;
                        }
                    }

                    .select {
                        @media (max-width: $breakpoint-sm) {
                            & {
                                width: 100%;
                            }
                        }
                    }
                }

                .select {
                    width: var(--category-select-width);
                    display: flex;
                    position: relative;
                    border-radius: .5rem;
                    overflow: hidden;
                    box-shadow: 1px 5px 14px 0 var(--color-picks-vs-filter-select-box-shadow);
                    min-height: 2rem;

                    &::after {
                        font-family: 'Font Awesome 5 Free';
                        content: '\f078';
                        display: flex;
                        position: absolute;
                        align-items: center;
                        justify-content: center;
                        top: 0;
                        right: 0;
                        width: 3rem;
                        height: calc(100% - .8rem);
                        color: var(--color-white);
                        background-color: var(--color-primary-dark-light);
                        pointer-events: none;
                        margin: .4rem;
                        border-radius: .5rem;
                    }

                    select {
                        border: 0;
                        outline: 0;
                        appearance: none;
                        box-shadow: none;
                        flex: 1;
                        padding: 14px;
                        cursor: pointer;
                        background-image: none;
                        color: var(--color-picks-vs-filter-select);
                        background-color: var(--color-picks-vs-filter-select-bg);
                        font-weight: 700;

                        /* Remove IE arrow */
                        &::-ms-expand {
                            display: none;
                        }

                        option {
                            font-weight: 700;
                        }
                    }
                }
            }

            .sub-categories {
                display: flex;
                align-items: center;
                justify-content: var(--sub-category-align);

                &.w-100 {
                    width: 100%;

                    @media (max-width: $breakpoint-md) {
                        & {
                            .buttons {
                                a {
                                    min-width: inherit;
                                    padding: .5rem 1rem;
                                }
                            }
                        }
                    }

                    @media (max-width: $breakpoint-sm) {
                        & {
                            .buttons {
                                width: 100%;
                                flex-direction: column;
                            }
                        }
                    }
                }

                &.w-50 {
                    width: 50%;

                    @media (max-width: $breakpoint-xl) {
                        & {
                            .buttons {
                                a {
                                    min-width: inherit;
                                    padding: .5rem 1rem;
                                }
                            }
                        }
                    }

                    @media (max-width: $breakpoint-md) {
                        & {
                            width: 100%;
                            justify-content: center;
                        }
                    }

                    .buttons {
                        @media (max-width: $breakpoint-sm) {
                            & {
                                width: 100%;
                                flex-direction: column;
                            }
                        }
                    }
                }

                .buttons {
                    display: flex;
                    justify-content: var(--align);
                    flex-wrap: wrap;
                    gap: 1rem;

                    a {
                        padding: .8rem 1.5rem;
                        color: var(--color-picks-vs-filter-button);
                        border-radius: .4rem;
                        min-width: 10rem;
                        text-align: center;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        transition: .2s background-color ease-in-out, .2s color ease-in-out, .2s border-color ease-in-out, .2s opacity ease-in-out, .2s box-shadow ease-in-out;
                        text-decoration: none;

                        i {
                            padding-left: .5rem;
                        }

                        &.link-info {
                            background-color: var(--color-picks-vs-filter-button-link-info-bg);
                            border-top: 3px solid var(--color-picks-vs-filter-button-link-info-border);
                            color: var(--color-picks-vs-filter-button-link-info);
                        }

                        &.link-default {
                            color: var(--color-picks-vs-filter-button-link-default);
                            background-color: var(--color-picks-vs-filter-button-link-default-bg);

                            &:hover {
                                color: var(--color-picks-vs-filter-button-link-default-hover) !important;
                                background-color: var(--color-picks-vs-filter-button-link-default-hover-bg);
                            }
                        }
                    }
                }
            }
        }

        @include title;

        .title {
            margin-left: .6rem;
        }

        .picks {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 1.2rem;

            @media (max-width: 1285px) {
                & {
                    justify-content: center;
                }
            }

            .message {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                padding: 1.5rem;
                border-radius: .5rem;
                background-color: var(--color-picks-vs-picks-message-bg);
                border: 1px solid var(--color-picks-vs-picks-message-border);

                span {
                    text-align: center;
                    color: var(--color-picks-vs-picks-message-span);
                }
            }

            .pick {
                display: flex;
                flex-direction: column;
                width: 100%;
                border-radius: .5rem;
                padding-top: 1rem;
                padding-bottom: 1.5rem;

                @media (max-width: 450px) {
                    & {
                        width: 100%;
                        min-width: initial;
                    }
                }

                &.color {
                    background-color: var(--color-picks-vs-picks-pick-bg);
                }

                .pick-header {
                    display: flex;
                    flex-direction: column;

                    .content {
                        width: 100%;
                        display: flex;
                        padding: .5rem;

                        .sport {
                            width: 20%;
                        }

                        .date-time {
                            width: 60%;
                            display: flex;
                            justify-content: center;
                            text-align: center;
                        }

                        .status {
                            width: 20%;
                            display: flex;
                            justify-content: end;
                        }
                    }
                }

                .pick-body {
                    display: flex;
                    flex-direction: column;
                    padding: 0 .5rem;

                    .teams {
                        display: flex;

                        .team {
                            display: flex;
                            align-items: center;
                            justify-content: flex-start;
                            flex-direction: column;

                            &:nth-last-of-type(1), &:nth-last-of-type(3) {
                                width: 38%;
                            }

                            &:nth-last-of-type(2) {
                                width: 24%;
                            }

                            .team-logo {
                                height: 100px;

                                img {
                                    max-width: 90px;
                                    max-height: 90px;

                                    @media (max-width: 450px) {
                                        & {
                                            max-width: 70px;
                                            max-height: 70px;
                                        }
                                    }
                                }
                            }

                            .team-name {
                                padding: 0 .3rem;
                                text-align: center;
                                height: 100%;
                                display: flex;
                                min-height: 3.5rem;
                            }
                        }

                        .team-vs {
                            display: flex;

                            .vs-logo {
                                width: 100%;
                                height: 100px;
                                display: flex;
                                align-items: center;
                                justify-content: center;

                                @media (max-width: 450px) {
                                    & {
                                        height: 80px;
                                    }
                                }

                                span {
                                    display: flex;
                                    justify-content: center;
                                    align-items: center;
                                    height: 1.7rem;
                                    width: 1.7rem;
                                    color: var(--color-picks-vs-picks-pick-teams-vs-logo-span);
                                    border-radius: 50%;
                                    background-color: var(--color-picks-vs-picks);
                                }
                            }

                            a {
                                width: 100%;
                            }

                            .vs-name {
                                width: 100%;
                                display: flex;
                                justify-content: center;
                                border-radius: .3rem;
                                padding: .4rem;
                                background-color: var(--color-picks-vs-picks-pick-teams-vs-name-bg);

                                span {
                                    text-align: center;
                                    color: var(--color-picks-vs-picks-pick-teams-vs-name-span);
                                    text-transform: uppercase;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

.acf-block-preview {
    .rdg-picks-vs {
        &.full {
            width: 100% !important;
            position: initial !important;
            left: initial !important;
            right: initial !important;
            margin-left: initial !important;
            margin-right: initial !important;
            max-width: initial !important;
        }
    }
}
