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

// Breaks when the outer container is <= window with the side navigation open.
// Corresponds to $breakpoint in containers/pages/portfolio-activity/styles.scss
$breakpoint: 1373px;

td.c-column-timestamp {
    @extend %caption;
    margin: 0;
    position: relative;
    color: $grey-60;
    white-space: pre-wrap;
}

.c-column-timestamp {
    $background-active: $seafoam-20;
    $background-error: lighten($danger-color, 20%);
    $background-idle: $grey-100;
    $background-warn: lighten($fail-color, 25%);
    $border-active: 0.1rem solid $seafoam-40;
    $border-error: 0.1rem solid $danger-color;
    $border-idle: 0.1rem solid $grey-92;
    $border-warn: 0.1rem solid $fail-color;

    &__time {
        display: inline-block;
        vertical-align: middle;
        width: 80%;
        padding-left: 1.6rem;

        @media screen and (min-width: $breakpoint) {
            width: 100%;
            padding-left: 0;
        }
    }

    &__status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        border-radius: 50%;
        height: 2.1rem;
        width: 2.1rem;

        @media screen and (min-width: $breakpoint) {
            position: absolute;
            left: -1.1rem;
            top: 2rem;
        }

        &--PROCESSED {
            border: $border-idle;
            background-color: $grey-100;
            color: $success-color;
        }

        &--EXPIRED {
            border: $border-warn;
            background-color: $background-warn;
            color: $fail-color;
            font-weight: 700;
            text-align: center;
            padding-left: 0.1rem;
        }

        &--ABORTED,
        &--CANCELLED {
            border: $border-error;
            background-color: $background-error;
            color: $danger-color;
            i {
                width: 0.7rem;
            }
        }

        &--PENDING {
            border: $border-active;
            background-color: $seafoam-20;
            color: $border-active;
            animation-direction: alternate;
            animation-duration: 0.5s;
            animation-iteration-count: infinite;
            animation-name: active-animation;
            animation-timing-function: ease-in-out;
        }
    }

    &__icon {
        height: auto;
        width: 0.8rem;
    }
}

@keyframes active-animation {
    from {
        background-color: $seafoam-20;
    }
    to {
        background-color: $seafoam-40;
    }
}

$direction: left, center, right;
@each $direction in $direction {
    td.c-column-timestamp--#{$direction} {
        text-align: $direction !important;
    }
}
