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

@property --color-rdg-sports-picks-title-bg {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-rdg-sports-picks-title-border {syntax: "<color>";inherits: true;initial-value: #3a96e0;}
@property --color-rdg-sports-picks-vs-logo {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-rdg-sports-picks-vs-name {syntax: "<color>";inherits: true;initial-value: #0160ac;}

.rdg-blocks .rdg-sports-picks {
    .preview-thumbs {
        background-image: url('../images/rdg-sport-picks-template-preview.jpg');
    }

    &.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;

        @include title;
        
        .picks {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1.2rem;

            .pick {
                display: flex;
                flex-direction: column;
                width: 20rem;
                border-radius: .5rem;
                background-color: var(--color-white);

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

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

                    .title {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        min-height: 2.5rem;
                        border-top-left-radius: .5rem;
                        border-top-right-radius: .5rem;
                        border-bottom: .2rem solid;
                        color: var(--color-white);
                        padding: .3rem;
                        text-align: center;
                        background-color: var(--color-rdg-sports-picks-title-bg) !important;
                        border-color: var(--color-rdg-sports-picks-title-border) !important;
                    }

                    .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 .8rem .5rem;

                    .teams {
                        display: flex;

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

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

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

                            .team-logo {
                                img {
                                    max-width: 80px;
                                    max-height: 80px;

                                    @media (max-width: $breakpoint-sm) {
                                        & {
                                            max-width: 60px;
                                            max-height: 60px;
                                        }
                                    }

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

                            .team-name {
                                padding: .3rem;
                                text-align: center;
                            }
                        }

                        .team-vs {
                            display: flex;

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

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

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

                                span {
                                    text-align: center;
                                    color: var(--color-white);
                                }
                            }
                        }
                    }

                    .numbers {
                        display: flex;
                        flex-direction: column;
                        text-align: center;
                        margin-top: 1rem;

                        .number {
                            border-top: 1px solid var(--color-gray-line);
                            min-height: 2rem;
                            padding: .4rem 0;
                            
                            &:last-of-type {
                                border-bottom: 1px solid var(--color-gray-line);
                            }
                        }
                    }
                }

                .pick-footer {
                    display: flex;
                    justify-content: end;
                    padding: 1rem .5rem .5rem .5rem;
                    margin-top: auto;

                    @include link-style;

                    a {
                        color: var(--color-primary-dark-light);

                        &:hover {
                            color: var(--color-primary);
                        }
                    }
                }
            }
        }

        .buttons {
            padding-top: 1rem;
            display: flex;
            justify-content: center;
            gap: 1rem;

            @media (max-width: 350px) {
                & {
                    flex-direction: column;
                }
            }

            @include buttons-links;
        }
    }
}

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

        .picks {
            .pick {
                .pick-header {
                    .title {
                        background-color: var(--color-primary-dark-light);
                        border-color: var(--color-primary);
                    }
                }

                .pick-body {
                    .teams {
                        .team-vs {
                            .vs-logo {
                                span {
                                    background-color: var(--color-primary-dark-light);
                                }
                            }

                            .vs-name {
                                background-color: var(--color-primary-dark-light);
                            }
                        }
                    }
                }
            }
        }

        .buttons {
            a {
                text-decoration: none;
            }
        }
    }
}
