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

@property --color-rdg-parlay-calculator-primary {syntax: "<color>"; inherits: true; initial-value: #1c4579;}
@property --color-rdg-parlay-calculator-border-container {syntax: "<color>"; inherits: true; initial-value: #e4e4e4;}
@property --color-rdg-parlay-calculator-border-input {syntax: "<color>"; inherits: true; initial-value: #c9c9c9;}
@property --color-rdg-parlay-calculator-border-invalid {syntax: "<color>"; inherits: true; initial-value: #ff0010;}
@property --color-rdg-parlay-calculator-border-eg {syntax: "<color>"; inherits: true; initial-value: #525252;}
@property --color-rdg-parlay-calculator-btn-hover {syntax: "<color>"; inherits: true; initial-value: #0160ac;}

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

    .calculator-container {
        border: 1px solid var(--color-rdg-parlay-calculator-border-container);
        border-radius: 8px;
        box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px,
            rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
        padding: 32px;
        display: flex;
        align-items: stretch;
        width: 100%;
        max-width: 875px;

        @media (max-width: $breakpoint-lg) {
            flex-direction: column;
            max-width: 538px;
        }

        button {
            font-weight: 600;
        }

        p {
            margin: 0;
            padding: 0;
        }

        input {
            padding: 16px;
            border: 1px solid var(--color-rdg-parlay-calculator-border-input);
            border-radius: 4px;
            font-size: 16px;
            font-weight: 600;
            background: var(--color-white);

            &:focus {
                outline: none;
                border: 1px solid var(--color-rdg-parlay-calculator-primary);
            }

            &:invalid {
                border: 2px solid var(--color-rdg-parlay-calculator-border-invalid);
            }
        }

        .form-label {
            font-size: 14px;
            font-weight: 600;
            line-height: 100%;
        }

        .delete-icon {
            cursor: pointer;
        }
    
        .eg-text {
            color: var(--color-rdg-parlay-calculator-border-eg);
            font-size: 10px;
            font-weight: 600;
        }

        .form-left {
            padding-right: 42px;
            flex: 2;

            @media (max-width: $breakpoint-lg) {
                padding-right: 0;
                padding-bottom: 32px;
            }

            .top-wrapper {
                display: flex;
                gap: 8px;
                align-items: start;
                margin-bottom: 16px;

                @media (max-width: $breakpoint-sm) {
                    flex-direction: column;
                    gap: 16px;
                }

                .odds,
                #betsContainer {
                    display: flex;
                    flex-direction: column;
                    gap: 8px;
                }

                .odds {
                    margin-right: 16px;

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

                    .custom-select {
                        position: relative;
                        display: inline-block;
                        width: 200px;

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

                        select {
                            appearance: none;
                            -webkit-appearance: none;
                            -moz-appearance: none;
                            width: 100%;
                            padding: 10px 40px 10px 15px;
                            font-size: 16px;
                            font-weight: 600;
                            padding: 16px;
                            background: var(--color-white);
                            border: 1px solid var(--color-rdg-parlay-calculator-border-input);
                            border-radius: 4px;
                            cursor: pointer;
                            box-sizing: border-box;

                            &:focus {
                                outline: none;
                                border: 1px solid var(--color-rdg-parlay-calculator-primary);
                            }

                            &:hover {
                                border: 1px solid var(--color-rdg-parlay-calculator-primary);
                            }
                        }

                        &::after {
                            content: "";
                            position: absolute;
                            top: 50%;
                            right: 15px;
                            transform: translateY(-50%);
                            width: 16px;
                            height: 16px;
                            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="%2323304a" stroke-width="3"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"/></svg>');
                            background-size: contain;
                            background-repeat: no-repeat;
                            pointer-events: none;
                        }
                    }
                }

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

                    input {
                        width: 120px;

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

                #addBetBtn {
                    background-color: var(--color-rdg-parlay-calculator-primary);
                    border-radius: 4px;
                    color: var(--color-white);
                    border: 1px solid var(--color-rdg-parlay-calculator-primary);
                    padding: 16px;
                    font-size: 16px;
                    cursor: pointer;
                    align-self: center;

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

                    img {
                        margin-bottom: -2px;
                        margin-left: 6px;
                    }
                }
            }

            .bottom-wrapper {
                .bets-wrapper {
                    margin-bottom: 16px;

                    .bets-tags {
                        display: flex;
                        align-items: center;
                        gap: 12px;
                        flex-wrap: wrap;
                        margin-top: 8px;

                        .bet-tag {
                            padding: 6px 12px;
                            border-radius: 100px;
                            background-color: var(--color-rdg-parlay-calculator-primary);
                            color: var(--color-white);

                            img {
                                margin-bottom: -2px;
                            }
                        }
                    }
                }

                .bet-amount {
                    display: flex;
                    flex-direction: column;
                    gap: 8px;
                }
            }
        }

        .form-right {
            padding-left: 42px;
            flex: 1;
            border-left: 1px solid var(--color-rdg-parlay-calculator-border-input);
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            @media (max-width: $breakpoint-lg) {
                padding-left: 0;
                padding-top: 32px;
                border-top: 1px solid var(--color-rdg-parlay-calculator-border-input);
                border-left: none;
            }

            .calculator-results {
                .to-win {
                    margin-bottom: 32px;

                    #toWinAmount {
                        margin-top: 8px;
                        font-size: 40px;
                        font-weight: 700;
                        line-height: 100%;
                        color: var(--color-black);
                    }
                }

                .payout {
                    #payoutAmount {
                        margin-top: 8px;
                        font-size: 40px;
                        font-weight: 700;
                        line-height: 100%;
                        color: var(--color-black);
                    }
                }
            }

            .buttons {
                margin-bottom: 23px;
                display: flex;
                gap: 8px;
                align-items: center;

                @media (max-width: $breakpoint-lg) {
                    margin-bottom: 0;
                    margin-top: 32px;
                }

                button {
                    padding: 12px 24px;
                    border-radius: 8px;
                    cursor: pointer;

                    @media (max-width: $breakpoint-lg) {
                        flex: 1;
                    }

                    @media (max-width: $breakpoint-sm) {
                        flex: 1;
                    }
                }

                #calculateBtn {
                    color: var(--color-white);
                    background-color: var(--color-rdg-parlay-calculator-primary);
                    border: 1px solid var(--color-rdg-parlay-calculator-primary);

                    &:hover {
                        background-color: var(--color-rdg-parlay-calculator-btn-hover);
                        border: 1px solid var(--color-rdg-parlay-calculator-btn-hover);
                    }
                }

                #resetBtn {
                    border: 1px solid var(--color-rdg-parlay-calculator-primary);
                    background-color: var(--color-white);
                    color: var(--color-rdg-parlay-calculator-primary);

                    &:hover {
                        background-color: var(--color-rdg-parlay-calculator-primary);
                        color: var(--color-white);
                    }
                }
            }
        }
    }
}

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