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

%search-stock-item-focused {
    background-color: $seafoam-20;
    border-color: $seafoam $seafoam $seafoam $seafoam;

    & + & {
        border-color: transparent $seafoam $seafoam $seafoam;
    }
}

// Stock Search Item
// ===
// 1. 🔍 Invisible border so only one border appears when items are stacked.
// 2. ◽️ Bring back the border on the last item.
.c-search-stock-item {
    display: grid;
    grid-gap: $h-gap-size;
    grid-template-columns: $h-block-size * 2 + h-space(0) auto minmax(
            auto,
            $h-block-size
        );
    align-items: center;
    padding: 0 h-space(0);
    height: $search-result-item-height;
    width: 100%;
    border-color: $grey-90 $grey-90 transparent $grey-90; // 1
    border-style: solid;
    border-width: 0.1rem;
    transition: all $animation-duration $timing-function;

    &:last-child :not(.c-search-stock-item--selected) :not(:hover) {
        border-color: $seafoam $seafoam $grey-90 $seafoam; // 2
    }

    %search-stock-item-focused + & {
        border-color: transparent $grey-90; // 1
    }

    @media screen and (max-width: $screen-small) {
        grid-template-columns: $h-block-size auto minmax(auto, $h-block-size);
    }
}

.c-search-stock-item.c-search-stock-item--clickable {
    cursor: pointer;

    &:hover {
        @extend %search-stock-item-focused;
    }
}

.c-search-stock-item.c-search-stock-item--selected {
    @extend %search-stock-item-focused;
}

.c-search-stock-item__ticker {
    color: $grey-40;
    font-family: $base-font-family;
    font-size: 1.6rem;
    font-weight: $font-weight-bold;
    text-transform: uppercase;
}

.c-search-stock-item__label {
    color: $grey-50;
    font-family: $base-font-family;
    font-size: 1.4rem;
    font-weight: $font-weight-normal;
    text-transform: none;

    .c-search-stock-item__ticker {
        color: $grey-50;
        font-size: 1em;
    }

    @media screen and (max-width: $screen-small) {
        display: none;
    }
}

.c-search-stock-item__exchange {
    color: $grey-70;
    font-family: $base-font-family;
    font-size: 1.4rem;
    font-weight: $font-weight-normal;
    text-align: right;
    text-transform: uppercase;
}
