@use '../../utils' as *;

/*----------------------------------------*/
/* How it works styles
/*----------------------------------------*/
.works-grid-bg-shape {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.how-it-works-shapes {
    .shape-one {
        position: absolute;
        right: -25px;
        top: -25%;
        z-index: -1;
    }
}

.how-it-works-item {
    position: relative;

    &::before {
        position: absolute;
        content: "";
        background-image: url(../images/how-it-works/01/left-up-arrow.png);
        bottom: -18px;
        width: 222px;
        height: 31px;
        background-repeat: no-repeat;
        background-position: right;
        right: -40px;

        @media #{$xs} {
            display: none;
        }
    }

    .icon {
        img {
            height: 60px;
        }
    }

    .inner {
        background: rgba($white, $alpha: 0.04);
        border-radius: 16px;
        padding: 45px 30px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
        text-align: center;

        @media #{$xl} {
            padding: 32px 20px;
        }

        @media #{$xs,$lg} {
            padding: 24px 20px;
        }

        &::before {
            position: absolute;
            content: "";
            inset: 0;
            @include border-radius(16px);
            padding: 2px;
            background: linear-gradient(90deg, rgba(91, 252, 196, 0.2) 0%, rgba(245, 147, 228, 0.2) 50%, rgba(113, 164, 240, 0.2) 100%);
            -webkit-mask: linear-gradient(var(--td-white) 0 0) content-box, linear-gradient(var(--td-white) 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            z-index: -1;
        }

        &::after {
            position: absolute;
            content: "";
            background: linear-gradient(90deg, rgba(91, 252, 196, 1) 0%, rgba(245, 147, 228, 1) 50%, rgba(113, 164, 240, 1) 100%);
            border-radius: 50%;
            opacity: 0.4;
            width: 98px;
            height: 98px;
            left: 62px;
            top: -36px;
            transform-origin: 0 0;
            transform: rotate(0deg) scale(-1, 1);
            filter: blur(20.5px);
        }
    }

    .arrow-shape {
        right: -20px;
        position: absolute;
        bottom: -45px;
    }

    .contents {
        .title {
            margin-bottom: 16px;
            font-size: 20px;

            @media #{$xs,$lg} {
                font-size: 18px;
            }
        }

        .description {
            font-size: 14px;
        }
    }
}

.how-it-works-items {
    [class*="col-"] {
        &:nth-child(odd) {
            .how-it-works-item {
                margin-top: 60px;
                margin-bottom: 18px;

                @media #{$xxs} {
                    margin-top: 0px;
                    margin-bottom: 30px;
                }
            }
        }

        &:nth-child(2n) {
            .how-it-works-item {
                margin-top: 30px;

                @media #{$xxs} {
                    margin-top: 0px;
                    margin-bottom: 30px;
                }

                &::before {
                    top: -16px;
                    bottom: auto;
                    background-image: url(../images/how-it-works/01/left-arrow.png);
                }

                .inner {
                    &::after {
                        left: auto;
                        right: 0;
                        transform: rotate(260deg) scale(-1, 1);
                    }
                }
            }
        }

        &:nth-child(4),
        &:nth-child(8),
        &:nth-child(12) {
            .how-it-works-item {
                &::before {
                    display: none;
                }
            }
        }

        &:last-child {
            .how-it-works-item {
                margin-bottom: 0;
            }
        }
    }
}