@import '../../styles/common';
$start-button-size: 60px;
$progress-bar-height: 6px;

.Thumbnail {
  position: relative;
  // Accommodating 16:9 responsive block for video
  padding-bottom: 9 / 16 * 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;

  &.WithPlayer {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: auto;
  }
}

.PlayButton {
  --pc-play-button-focused-state-overlay: rgba(223, 227, 232, 0.3);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  opacity: 0.8;
  transition: opacity var(--p-duration-200) var(--p-ease-in);
  cursor: pointer;

  &:hover,
  &:focus {
    opacity: 1;
  }

  &:focus {
    outline: none;
    box-shadow: inset 2px 0 0 var(--p-focused);
    background-image: linear-gradient(
      var(--pc-play-button-focused-state-overlay),
      var(--pc-play-button-focused-state-overlay)
    );
  }
}

.PlayIcon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: $start-button-size;
  height: $start-button-size;
  margin-top: -$start-button-size * 0.5;
  margin-left: -$start-button-size * 0.5;
}

.Timestamp {
  position: absolute;
  bottom: 0;
  padding: 0 var(--p-space-1);
  margin-bottom: var(--p-space-2);
  margin-left: var(--p-space-2);
  border-radius: var(--p-border-radius-1);
  color: var(--p-text);
  background-color: var(--p-surface);
  opacity: 0.8;
  text-align: center;
}

.withProgress {
  margin-bottom: var(--p-space-3);
}

.Progress {
  position: absolute;
  bottom: 0;
  width: 100%;
  background-color: var(--p-surface);
  height: $progress-bar-height;
  overflow: hidden;
}

.Indicator {
  height: inherit;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background-color: var(--p-border-highlight);
  transition: transform var(--p-duration-500) var(--p-ease);
}

.ProgressBar,
.Label {
  @include visually-hidden;
}
