@import "../../../sass/webpack_deps";

video {
  height: 100%;
  margin: 0 auto;
  width: 100%;
}

.video-js {
  height: 100%;
  margin: 0 auto;
  width: 100%;

  .vjs-overlay-top-left {
    left: 0;
    top: 0;
  }

  .vjs-overlay-top-right {
    right: 0;
    top: 0;
  }

  .vjs-overlay-bottom {
    left: 0;
    margin-left: 0;
    max-width: 100%;
    width: 100%;
  }

  // scss-lint:disable ImportantRule
  .vjs-control-bar {
    transition: transform 200ms ease !important;
  }
  // scss-lint:enable ImportantRule

  .vjs-big-play-button {
    @media (max-width: $max-480) {
      transform: scale(.7);
    }
  }
}

.vjs-error {
  .vjs-error-display {
    display: none;
  }
}

.video__ad-overlay {
  background-color: rgba($color-black, .8);
  color: $color-gray;
  font-family: "Arial", sans-serif;
  font-size: 11px;
  font-weight: normal;
  line-height: (21 / 11);
  margin-top: .8rem;
  padding: .6rem 2.1rem;
  vertical-align: middle;
}

.video__lowerthird-overlay {
  height: 0;
  padding-bottom: 56.25%; // 16:9
  position: relative;

  iframe {
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
  }
}

.video__popout {
  height: 100%;
  width: 100%;
}

.video__popout-mobile {
  .video__popout-inner-poppedout {
    .video__popout-overlay {
      opacity: 1;
      top: 0;
    }
  }
}

.video__popout-inner {
  height: 100%;
  opacity: 0;
  overflow: hidden;
  position: relative;
  transition: opacity 200ms ease;
  width: 100%;


  &-visible {
    opacity: 1;
  }

  .video__muted-overlay {
    align-items: center;
    color: $color-white;
    display: none;
    font-size: 80px;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    transition: opacity 200ms ease;
    width: 100%;

    .vjs-icon-volume-high {
      background-color: rgba($color-black, .45);
      border-radius: 50%;
      cursor: pointer;
      height: 120px;
      text-align: center;
      text-shadow: 0 1px 6px rgba($color-black, .5);
      transition: text-shadow 200ms ease, background-color 200ms ease;
      width: 120px;
    }

    .video__muted-overlay:hover {
      background-color: rgba($color-black, .55);
      text-shadow: 0 1px 9px rgba($color-black, .7);
    }

    &:hover {
      opacity: 1;
    }
  }

  .video__popout-overlay {
    background-color: rgba($color-black, .45);
    color: $color-white;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    opacity: 0;
    padding: .7em;
    position: absolute;
    right: 0;
    top: -30px;
    transition: top 200ms ease, opacity 200ms ease;
    z-index: 1;
  }

  &-poppedout {
    bottom: 20px;
    box-shadow: 0 1px 8px 0 rgba($color-black, .4);
    height: initial;
    max-width: 406px;
    position: fixed;
    right: 20px;
    width: 60%;
    z-index: 1;

    .video-js {
      padding-top: 56.25%; // 16:9
    }

    .video__popout-overlay {
      opacity: 1;
    }
  }

  &-hover {
    .video__popout-overlay {
      top: 0;
    }

    // scss-lint:disable ImportantRule
    .vjs-control-bar {
      transform: translateY(0) !important;
    }
    // scss-lint:enable ImportantRule
  }
}

.video__adplaying {
  .video__popout-overlay {
    display: none;
  }
}

.video__cover--container {
  overflow: hidden;
  position: relative;

  // scss-lint:disable ImportantRule
  .video-js,
  video {
    height: auto !important;
    left: 50% !important;
    min-height: 100%;
    min-width: 100%;
    overflow: hidden;
    position: absolute;
    top: 50% !important;
    transform: translateX(-50%) translateY(-50%);
    width: auto !important;
    z-index: -1000;
  }
  // scss-lint:enable ImportantRule
}
