@-webkit-keyframes change-background-color {
  0% {
    background-color: rgba(255, 255, 255, .2);
  }

  25%, 50% {
    background-color: rgba(255, 255, 255, .3);
  }

  75%, 100% {
    background-color: rgba(255, 255, 255, .2);
  }
}

@keyframes change-background-color {
  0% {
    background-color: rgba(255, 255, 255, .2);
  }

  25%, 50% {
    background-color: rgba(255, 255, 255, .3);
  }

  75%, 100% {
    background-color: rgba(255, 255, 255, .2);
  }
}

@mixin animate-background {
  background-color: rgba(255, 255, 255, .2);
  -webkit-animation: 2s ease-in-out infinite change-background-color;
          animation: 2s ease-in-out infinite change-background-color;
}

button {
  border: 0;
  cursor: pointer;

  &:disabled {
    cursor: default;
  }
}

/* texts */
.text {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-next-text {
  @extend .text;
  color: #ccc;
  line-height: 18px;
}

.title-text {
  @extend .text;
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  white-space: nowrap;
}

.entry-image {
  position: relative;

  .thumbnail-wrapper * {
    border-radius: 8px 8px 0 0;
  }

  .duration {
    position: absolute;
    bottom: 4px;
    left: 4px;
  }
}

/* entry */
.entry {
  position: relative;

  img {
    border-radius: 8px 8px 0 0;
  }

  .entry-content {
    background-color: #222;
    border-radius: 0 0 8px 8px;
  }

  &:hover {
    .entry-content {
      background-color: #000;
    }
  }
}

/* specific entries */
.next-entry {
   flex-shrink: 0;

  .entry-content {
    padding: 8px 16px 16px;

    .title-text {
      padding: 4px 0;
    }

    .entry-text {
      line-height: 18px;
      height: 92px;
    }
  }

  .buttons {
    display: flex;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    width: calc(100% - 8px);
    justify-content: center;

    button {
      border-radius: 4px;
      padding: 4px;
      width: -webkit-max-content;
      width: -moz-max-content;
      width: max-content;

      &.play-now {
        display: inline-block;
        position: relative;
        margin-right: 8px;
        overflow: hidden;

        .animation {
          background: rgba($color: #000, $alpha: 0.2);
          width: 100%;
          height: 100%;
          position: absolute;
          top: 0;
          left: 0;
          transform: translateX(-100%);
        }

        &.animated {
          .animation {
            -webkit-animation-timing-function: linear;
            animation-timing-function: linear;
            -webkit-animation-name: slide-in;
            animation-name: slide-in;
          }
        }
      }

      &.cancel {
        background-color: rgba($color: #000, $alpha: 0.6);
        flex-shrink: 0;
      }

      .button-text {
        color: #fff;
        font-size: 13px;
        font-weight: bold;
        line-height: 15.6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }

  &.medium {
    margin-right: 16px;
  }

  &.large,
  &.extra-large {
    margin-right: 16px;

    .button {
      padding: 7.5px 8px;

      .button-text {
        font-size: 14px;
        line-height: 16.8px;
      }
    }
  }
}

.grid-entry {
  position: absolute;

  &.minimal {
    display: flex;
    border-radius: 8px;
    overflow: hidden;

    .entry-content {
      border-radius: 0;
    }

    .entry-text {
      margin: 8px;
      padding: 4px 0;
    }

    img {
      border-radius: 0;
    }
  }

  .entry-text {
    margin: 8px 16px;
  }
}

.list-entry {
  align-items: center;
  background-color: transparent;
  border-radius: 4px;
  padding: 8px;
  position: relative;
  
  .entry-content {
    background-color: transparent;
    width: 100%;
  }
  
  .thumbnail-wrapper * {
    border-radius: 4px;
  }
  
  &.horizontal {
    height: 100%;

    .entry-image {
      height: calc(100% - 35px);
    }

    .thumbnail-wrapper {
      height: 100%;
    }
    
    .entry-content {
      margin-top: 4px;
      height: 35px;
    }
  }
  
  &.vertical {
    display: flex;
    flex-direction: row;
    height: fit-content;
    margin-right: 8px;

    .thumbnail-wrapper {
      height: 56px;
      width: 99px;
    }

    .entry-content {
      margin-left: 8px;
    }
  }

  &.placeholder {
    &:hover {
      background-color: transparent;
    }

    &.horizontal {
      .entry-image * {
        visibility: hidden;
      }
    }

    &.vertical {
      .entry-content {
        margin-left: 16px;
      }

    }

    .entry-image {
      @include animate-background();

      border-radius: 4px;
    }

    .entry-content {
      .text-placeholder {
        @include animate-background();

        border-radius: 4px;
        height: 12px;

        &:first-child {
          margin-bottom: 10px;
          width: 100%;
        }
        &:nth-child(2) {
          width: 51.7%;
        }
      }
    }
  }

  &:hover {
    background-color: rgba(255, 255, 255, .12);

    .entry-content {
      background-color: transparent;
    }
  }
}

@-webkit-keyframes slide-in {
  100% {
    transform: translateX(0%);
  }
}

@keyframes slide-in {
  100% {
    transform: translateX(0%);
  }
}
