.stream-switcher {

  .stream-switcher-stations-label {
    @include typeface(body, 3);

    color: rgb(var(--color-text-print));
    font-weight: bold;
    margin-bottom: 7px;
    margin-top: 8px;
    text-align: left;
    text-transform: uppercase;

    @include media(">=xxlarge") {
      margin-left: 24px;
    }
  }

  .stream-switcher-streams {
    cursor: pointer;
    width: 100%;
    height: 87px; // height of card plus height of the active caret
    display: flex;
    // horizontal scroll with hidden scrollbar
    overflow: scroll;
    -webkit-overflow-scrolling: touch;
    // todo: hiding the scrollbar matches the design; is there a better way to do it, or is it something we actually don't want to do?
    /* Hide scrollbar for Chrome, Safari and Opera */
    &::-webkit-scrollbar {
      display: none;
    }

    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */

    @include media(">medium") {
      height: 70px; // height of card plus height of the active caret
    }

    .stream-switcher-streams-stream {
      display: flex;
      flex-direction: column;
      color: RGB(var(--color-text));
      border: 1px solid RGB(var(--color-text));
      margin-right: var(--space-2);
      padding: 0 var(--space-3);
      height: 67px;
      min-width: 170px;
      position: relative;
      margin-bottom: -20px; // hack to get around overflow scroll issue
      transition: var(--animation-duration-slow) var(--animation-easing-incoming);
      background-color: transparent;

      @include media(">medium") {
        flex-direction: row;
        height: 50px;
        line-height: 50px;
      }

      &::after {
        content: '';
        position: absolute;
        width: 0;
        bottom: -16px;
        height: 15px;
        left: 30px;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-top: 15px solid RGB(var(--color-text));
        opacity: 0;
        -webkit-transition: opacity var(--animation-duration-slow) var(--animation-easing-incoming) 50ms;
        -moz-transition: opacity var(--animation-duration-slow) var(--animation-easing-incoming) 50ms;
        -ms-transition: opacity var(--animation-duration-slow) var(--animation-easing-incoming) 50ms;
        -o-transition: opacity var(--animation-duration-slow) var(--animation-easing-incoming) 50ms;
        transition: opacity var(--animation-duration-slow) var(--animation-easing-incoming) 50ms;
      }

      &:hover {
        background-color: RGBA(var(--color-text), .2);
      }

      &:last-of-type {
        margin-right: 0;
      }

      &.is-active {
        background-color: RGBA(var(--color-text), 1);
        color: RGB(var(--color-text-inverse));

        &::after {
          opacity: 1;
        }
      }

      .stream-switcher-streams-stream-title {
        @include typeface(body, 4);
        color: rgb(var(--color-background));
        font-weight: bold;
        margin: var(--space-2) var(--space-3) var(--space-2) 0;
        pointer-events: none;
        font-feature-settings: "lnum";
        align-items: center;
        display: flex;
        @include media(">medium") {
          margin: 0 var(--space-3) 0 0;
        }
      }

      .sound-animation {
        float: left;
        display: none;
        flex-direction: row;
        justify-content: space-between;
        width: 20px;
        height: 15px;
        margin-right: var(--space-2);
        background-color: RGB(var(--color-text-inverse));

        @include media(">medium") {
          width: 40px;
          height: 30px;
        }

        &.is-playing {
          display: flex;

          .sound-animation-bar {
            animation: sound-bars 500ms linear 0ms infinite alternate;
          }

          .sound-animation-bar:nth-child(1) {
            animation-delay: 0ms;
          }

          .sound-animation-bar:nth-child(2) {
            animation-delay: 100ms;
          }

          .sound-animation-bar:nth-child(3) {
            animation-delay: 200ms;
          }

          .sound-animation-bar:nth-child(4) {
            animation-delay: 300ms;
          }

          .sound-animation-bar:nth-child(5) {
            animation-delay: 400ms;
          }

          .sound-animation-bar:nth-child(6) {
            animation-delay: 500ms;
          }

          .sound-animation-bar:nth-child(7) {
            animation-delay: 600ms;
          }
        }

        .sound-animation-bar {
          height: 100%;
          width: 2.2px;
          max-width: 2.2px;
          min-width: 2.2px;
        }
      }

      .on-air-image {
        display: none;
        height: 40px;
        grid-column-start: 1;
        grid-column-end: 1;
        grid-row-start: 2;
        grid-row-end: span 1;
        margin: 4px 8px 8px 8px;
        max-height: 40px;
        max-width: 40px;
        pointer-events: none;
        width: 40px;
      }

      .stream-switcher-streams-stream-on-now {
        font-weight: 700;
        margin-right: var(--space-2);
        pointer-events: none;
        text-transform: uppercase;
        width: 60px;
      }

      .stream-switcher-streams-stream-show-title {
        @include typeface(body, 4);
        color: rgb(var(--color-background));
        font-weight: 600;
        pointer-events: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 3;
      }

      .up-next {
        @include typeface(body, 4);
        display: flex;
        align-items: center;
        flex-direction: row;
        pointer-events: none;

        .up-next-label {
          font-weight: 700;
          margin-right: var(--space-2);
          pointer-events: none;
          text-transform: uppercase;
          min-width: fit-content;

          &.up-next {
            display: none;
          }

          &.on-now {
            display: block;
          }
        }

        .up-next-show-title {
          pointer-events: none;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          -webkit-line-clamp: 3;
        }

        .up-next-time {
          flex: 1;
          margin-left: 8px;
          margin-right: 8px;
          opacity: 0.7;
          pointer-events: none;
          text-align: right;
        }
      }
    }
  }
}

.stream-switcher .stream-switcher-streams .stream-switcher-streams-stream.is-active {
  .up-next-label.up-next {
    display: block;
  }
}

.stream-switcher .stream-switcher-streams .stream-switcher-streams-stream.is-active {
  .up-next-label.on-now {
    display: none;
  }
}

@keyframes sound-bars {
  0% {
    opacity: 0.35;
    background: #f3f3f3;
    height: 1px;
  }

  100% {
    opacity: 1;
    background: #fff;
    height: 100%;
  }
}
