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

@property --color-consensus-base-dark {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-consensus-text {syntax: "<color>";inherits: true;initial-value: #ffffff;}
@property --color-consensus-pick-bg {syntax: "<color>";inherits: true;initial-value: #ffffff;}
@property --color-consensus-border {syntax: "<color>";inherits: true;initial-value: #3a96e0;}
@property --color-consensus-consensus {syntax: "<color>";inherits: true;initial-value: #eaf6ff;}
@property --color-consensus-consensus-text {syntax: "<color>";inherits: true;initial-value: #0160ac;}
@property --color-consensus-section-border {syntax: "<color>";inherits: true;initial-value: #CCC;}
@property --color-consensus-header {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-consensus-data {syntax: "<color>";inherits: true;initial-value: #b2b2be;}
@property --color-consensus-data-leyend-title {syntax: "<color>";inherits: true;initial-value: #111111;}
@property --color-consensus-columns-separate {syntax: "<color>";inherits: true;initial-value: #b8d5eb;}
@property --color-consensus-columns-values {syntax: "<color>";inherits: true;initial-value: #0056a1;}
@property --color-consensus-picks-color {syntax: "<color>";inherits: true;initial-value: #00bc00;}
@property --color-consensus-picks {syntax: "<color>";inherits: true;initial-value: #0160ac;}

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

    width: calc(var(--vw, 1vw) * 100);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 99.55vw;

    .container.content {
        width: 100%;
        display: flex;
        flex-direction: column;
        padding-left: 20px;
        padding-right: 20px;

        @include title;

        .picks {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 2rem;
    
            .pick {
                display: flex;
                flex-direction: column;
                width: 24rem;
                border-radius: .5rem;
                background-color: var(--color-consensus-pick-bg);
    
                @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-consensus-text);
                        padding: .3rem;
                        text-align: center;
                        background-color: var(--color-consensus-base-dark);
                        border-color: var(--color-consensus-border);
                    }
                }
    
                .pick-body {
                    display: flex;
                    flex-direction: column;
                    
    
                    .teams {
                        display: flex;
                        padding: .5rem;
    
                        .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: 100px;
                                    max-height: 100px;
    
                                    @media (max-width: $breakpoint-sm) {
                                        & {
                                            max-width: 80px;
                                            max-height: 80px;
                                        }
                                    }
                                }
                            }
                        }
    
                        .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-consensus-text);
                                    border-radius: 50%;
                                    background-color: var(--color-consensus-base-dark);
                                }
                            }
                        }
                    }
                    
                    .consensus {
                        display: flex;
                        justify-content: center;
                        color: var(--color-consensus-consensus-text);
                        background-color: var(--color-consensus-consensus);
                        padding: .3rem 0;
                    }

                    .sections {
                        display: flex;
                        flex-direction: column;
                        
                        .section {
                            display: flex;
                            flex-direction: column;
                            padding: .5rem 0;
                            border-bottom: 1px solid var(--color-consensus-section-border);

                            .header {
                                width: 100%;
                                display: flex;
                                flex-direction: row;
                                padding-bottom: .5rem;
                                color: var(--color-consensus-header);

                                .title {
                                    width: 29%;
                                    padding-left: .5rem;
                                }
    
                                .totals {
                                    width: 17%;
                                    text-align: right;
                                    padding-right: .5rem;
                                }
    
                                .public {
                                    width: 27%;
                                    text-align: center;
                                }
    
                                .sharp {
                                    width: 27%;
                                    text-align: center;
                                }
                            }

                            .data {
                                width: 100%;
                                display: flex;
                                flex-direction: row;
                                color: var(--color-consensus-data);

                                .leyend {
                                    width: 20%;
                                    display: flex;
                                    padding-left: .5rem;
                                    flex-direction: column;

                                    .leyend-items {
                                        display: flex;

                                        .value {
                                            padding-right: .5rem;
                                        }

                                        .title {
                                            color: var(--color-consensus-data-leyend-title);
                                        }
                                    }
                                }

                                .columns {
                                    width: 80%;
                                    display: flex;

                                    .totals, .public, .sharp {
                                        padding: 0 .5rem;
                                        border-right: 2px solid var(--color-consensus-columns-separate);

                                        .totals-items {
                                            width: 100%;
                                            display: flex;
                                            justify-content: space-between;

                                            .value, .title {
                                                width: auto;
                                            }

                                            &:first-of-type {
                                                .title {
                                                    color: var(--color-consensus-columns-values);
                                                }
                                            }
                                        }
                                    }
                                    
                                    .totals {
                                        width: 33%;
                                        text-align: center;
                                    }
        
                                    .public {
                                        width: 34%;
                                        text-align: center;
                                    }
        
                                    .sharp {
                                        width: 33%;
                                        text-align: center;
                                        border: none;
                                    }
                                }
                            }
                            
                        }
                    }
    

                    .picks-available {
                        display: flex;
                        align-items: center;
                        padding: .4rem 2rem;
                        border-bottom: 1px solid var(--color-consensus-section-border);
                        margin-bottom: .5rem;

                        i {
                            padding-right: .5rem;
                            color: var(--color-consensus-picks-color);
                        }

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

                .pick-footer {
                    display: flex;
                    justify-content: center;
                    padding: .3rem;
                    background-color: var(--color-consensus-base-dark);
                    border-bottom-left-radius: .5rem;
                    border-bottom-right-radius: .5rem;
    
                    @include link-style;
    
                    a {
                        color: var(--color-consensus-text);
    
                        &:hover {
                            color: var(--color-consensus-border);
                        }
                    }
                }
            }
        }
    }
}

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