/* ----------- Fz ----------- */

@mixin fz-10 {
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
    line-height: 12px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-12 {
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-14 {
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-16 {
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-20 {
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-24 {
    font-size: 24px;
    font-style: normal;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: -0.8px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-36 {
    font-size: 36px;
    font-style: normal;
    font-weight: 600;
    line-height: 40px;
    letter-spacing: -1.2px;
    font-variant-numeric: tabular-nums;
}

@mixin fz-48 {
    font-size: 48px;
    font-style: normal;
    font-weight: 600;
    line-height: 56px;
    letter-spacing: -1.5px;
    font-variant-numeric: tabular-nums;
}

/* ----------- Box Shadows ----------- */

@mixin shadow-small {
    box-shadow: 0px 4px 4px 0px rgba(60, 60, 60, 0.04);
}

@mixin shadow-medium {
    box-shadow: 0px 16px 32px -12px rgba(28, 32, 38, 0.1);
}

@mixin transition-default($props: opacity, $duration: 0.1s, $ease: ease-out) {
    transition-property: $props;
    transition-duration: $duration;
    transition-timing-function: $ease;
}

@mixin private-mode {
    width: fit-content;
    background: linear-gradient(
        93deg,
        rgba(142, 142, 147, 0.35) 31.73%,
        #ededed 79.89%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----------- Other ----------- */

@mixin custom-plyr($border-radius, $border) {
    ::v-deep(.plyr) {
        border-radius: $border-radius;
        border: $border;
        .plyr__video-wrapper {
            height: unset;
        }
        .plyr__control--overlaid {
            border-radius: 64px;
            border: 1px solid rgba(242, 242, 242, 0.25);
            background: rgba(255, 255, 255, 0.25);
        }
        .plyr__controls__item {
            color: $card-background;
        }
        .plyr__progress input {
            color: rgba(255, 255, 255, 0.25);
        }
        .plyr__volume input {
            color: rgba(255, 255, 255, 0.25);
        }
        .plyr__control:hover {
            background: rgba(255, 255, 255, 0.25);
        }
        @media screen and (min-width: 1920px) {
            .plyr__poster {
                background-size: cover;
            }
        }
    }
}

@mixin dashboard-widget {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-radius: 16px;
    border: 1px solid $border;
    background: $card-background;
    padding: 16px;
    @include shadow-small;
    position: relative;
    user-select: none;
}

@mixin dashboard-widget-inner {
    &__top {
        display: flex;
        justify-content: space-between;
        align-items: center;

        &__icon {
            color: $text-mid-emphasis;
        }
    }

    &__title-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    &__title {
        @include fz-16;
        font-weight: 500;
    }

    &__points {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding-top: 15px;
        border-top: 1px solid $border;
    }

    &__point {
        display: flex;
        gap: 4px;
        @include fz-14;
        font-weight: 500;
        text-wrap: nowrap;
        align-items: flex-end;

        &__title {
            color: $text-mid-emphasis;
        }

        &__line {
            flex: 1 0 auto;
            padding-bottom: 4px;
            border-top: 1px dashed $border;
        }
        &__value {
            &.-loss {
                color: $text-error-accent;
            }

            &.-win {
                color: $text-success-accent;
            }
        }
    }
    &__total-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;

        &__title {
            @include fz-14;
            font-weight: 500;
            color: $text-mid-emphasis;
        }

        &__total {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        &__value {
            @include fz-36;
            font-weight: 500;

            &.-positive {
                color: $text-success-accent;
            }

            &.-negative {
                color: $text-error-accent;
            }
        }
    }
}

@mixin dashboard-widget-dark {
    background: $dark-theme-gray-80;
    box-shadow: 0px 0px 25px 0px rgba(0, 0, 0, 0.07);
}

@mixin badge {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    height: 28px;

    border-radius: 6px;

    span {
        font-size: 12px;
        font-weight: 500;
    }

    &.-green {
        background-color: $color-green-900;

        span,
        svg {
            color: $color-green-500;
        }
    }

    &.-red {
        background-color: $color-red-900;

        span,
        svg {
            color: $color-red-500;
        }

        svg {
            transform: rotate(180deg);
        }
    }
}

@mixin dashboard-widget-inner-dark {
    &__title {
        color: $color-grey-100;
    }
    &__points {
        border-top: 1px solid $dark-theme-line;
    }
    &__point {
        &__line {
            border-top: 1px dashed $dark-theme-gray-60;
        }
        &__value {
            color: $color-grey-100;
            &.-loss {
                color: $color-red-500;
            }

            &.-win {
                color: $color-green-500;
            }
        }
    }

    &__total-wrapper {
        &__value {
            color: $color-grey-100;
            &.-positive {
                color: $color-green-500;
            }

            &.-negative {
                color: $color-red-500;
            }
        }
    }
}
