@import '~@equitysim/react-uikit/dist/styles/styleguide';

.c-ranking-sharpe-ratio-formula {
    $secondary-color: $grey-85;

    &__sharpe-ratio {
        margin: 0;
        padding: v-space(2) var(--container-padding-h);
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding-bottom: v-space(2);
        column-gap: 2.4rem;
        background-color: $grey-100;
    }

    &__constant {
        color: $grey-70;
    }

    &__label,
    &__value-label,
    &__private {
        @extend %heading-xs;
        margin: 0 0 v-space(1) 0;
    }

    &__value-label {
        line-height: v-space(2);
        & > span:last-child {
            @media screen and (max-width: 560px) {
                display: inline-block;
                width: 5rem;
            }
        }
    }

    &__number {
        @extend %number-value-sm;
        padding-top: 0.4rem;
    }

    &__value {
        @extend %number-value-md;
        margin: 0;
        line-height: v-space(3);
        padding-right: 1.6rem;

        @media screen and (max-width: 560px) {
            vertical-align: top;
        }
    }

    &__value-rank {
        @media screen and (max-width: 560px) {
            padding: v-space(1) 0 0 0;
        }
    }

    &__link {
        @extend %link;
        border: 0;
        background-color: transparent;
        font-family: $base-font-family;
        font-size: 1.2rem;
        margin: 0;
        line-height: v-space(2);
    }

    &__grade {
        margin: 0 0 v-space(1) 0;
        text-transform: uppercase;
        font-weight: $font-weight-bold;
        font-size: 1.2rem;
        grid-column: 1 / span 2;
        &--unknown {
            color: $grey-70;
        }
        &--low {
            color: $bittersweet;
        }
        &--average {
            color: $tangerine;
        }
        &--good {
            color: $seafoam-160;
        }
        &--great {
            color: $seafoam-140;
        }
        &--excellent {
            color: $seafoam-60;
        }
    }

    &__private {
        line-height: v-space(3);
        margin-top: 0.4rem;
        color: $grey-75;
    }

    &__tooltip {
        text-align: left;
        z-index: 999999;
    }

    &__error {
        padding: v-space(3) var(--container-padding-h) v-space(2)
            var(--container-padding-h);
        background-color: $grey-100;
        height: 100%;

        & > p {
            margin: v-space(2) 0 0 0;
            font-weight: $font-weight-normal;
            color: $grey-75;
            font-size: v-space(2);
            line-height: v-space(3);
            text-align: left;
        }
    }

    &__loader {
        display: inline-block;
        height: v-space(1);
        width: v-space(1);
        border-radius: 50%;
        background-color: currentColor;
        animation-name: loading;
        animation-duration: 0.75s;
        animation-iteration-count: infinite;
        animation-direction: alternate;
        vertical-align: -0.4rem;
        margin: 1.2rem 1.6rem 0.4rem 1.6rem;
    }

    em {
        font-style: normal;
        font-weight: $font-weight-bold;
        color: $grey-50;
    }

    &__formula {
        margin: 0;
        padding: v-space(3) var(--container-padding-h);
        display: grid;
        grid-auto-flow: column;
        grid-template-columns: 0.8rem 1fr 1.6rem 1fr 4rem 1fr;
        grid-template-rows: repeat(2, 1fr);
        text-align: center;
        border-top: 0.1rem solid $grey-92;

        dd {
            margin: 0;
            @media screen and (max-width: 560px) {
                display: flex;
                align-items: flex-end;
                justify-content: center;
                padding-bottom: 0.6rem;
            }
        }

        dt {
            @media screen and (max-width: 560px) {
                display: flex;
                align-items: flex-end;
                margin: 0;
            }
        }
    }

    &__sign {
        grid-row-start: span 2;
        display: flex;
        font-size: 2.4rem;
        align-items: flex-end;

        i {
            font-style: normal;
        }

        &:first-of-type {
            justify-content: center;
        }

        &:last-of-type {
            justify-content: space-between;
        }
    }

    &__icon {
        height: auto;
        margin-left: 0.8rem;
        width: v-space(2);
        vertical-align: -0.3rem;
    }
}

@keyframes loading {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}
