.video-react {
  display: block;
  vertical-align: top;
  box-sizing: border-box;
  color: $video-react-primary-foreground-color;
  background-color: transparent;
  position: relative;
  font-size: 10px;
  line-height: 1;
  font-family: $video-react-text-font-family;
  width: 100% !important;
  height: 100% !important;
  direction: ltr;

  @include user-select(none);

  &:-moz-full-screen {
    position: absolute;
  }

  &:-webkit-full-screen {
    width: 100% !important;
    height: 100% !important;
  }

  // All elements inherit border-box sizing
  *,
  *:before,
  *:after {
    box-sizing: inherit;
  }

  ul {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    list-style-position: outside;

    // Important to specify each
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    margin-bottom: 0;
  }

  &.video-react-fluid,
  &.video-react-16-9,
  &.video-react-4-3 {
    width: 100%;
    max-width: 100%;
    height: 0;
  }

  &.video-react-16-9 {
    @include apply-aspect-ratio(16, 9);
  }

  &.video-react-4-3 {
    @include apply-aspect-ratio(4, 3);
  }

  &.video-react-fill {
    width: 100%;
    height: 100%;
  }

  // Playback technology elements expand to the width/height of the containing div
  // <video> or <object>
  .video-react-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  &.video-react-fullscreen {
    width: 100% !important;
    height: 100% !important;
    // Undo any aspect ratio padding for fluid layouts
    padding-top: 0 !important;

    &.video-react-user-inactive {
      cursor: none;
    }

  }
}

body.video-react-full-window {
  padding: 0;
  margin: 0;
  height: 100%;
  // Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html
  overflow-y: auto;

  .video-react-fullscreen {
    position: fixed;
    overflow: hidden;
    z-index: 1000;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
  }
}

.video-react-ads div {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chapter-list {
  position: absolute;
  display: block;
  height: 0.5em;
  margin: 0;
  padding: 0;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 100;

  .chapter-item {
    position: absolute;
    width: 1.2em;
    height: 1.2em;
    margin-left: -0.6em;
    top: -0.3em;

    &:before {
      content: '';
      position: absolute;
      right: 0;
      top: 0;
      bottom: 0;
      width: 0.45em;
      height: 0.45em;
      background: #df254d;
      border-radius: 100%;
      left: 0;
      cursor: pointer;
      z-index: 0;
      margin: auto;
    }

    .video-react-mouse-display.chapter-item-tooltip {
      display: none !important;
      background: none !important;
      width: 100%;
      &:after {
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        height: 2em;
        white-space: pre;
        direction: rtl;
        z-index: 10;
        background: #000;
        font-size: 12px;
        right: 50%;
        transform: translateX(50%);
        max-width: 12em;
        top: -2.8em;
      }

      &:before {
        display: none;
      }
    }

    &:hover {
      .video-react-mouse-display.chapter-item-tooltip {
        display: block !important;
      }
    }
  }
}

.video-react-ads-playing {
  .chapter-list {
    display: none !important;
  }
}

.react-video-holder {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.video-react-ads > div > div {
  height: inherit;
  width: inherit;
}

.ad-actions {
  position: absolute;
  z-index: 10000;
  font-family: $video-react-text-font-family !important;
  padding: 12px 6px;
  color: rgba(255, 255, 255, 0.75) !important;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  border-radius: 20px;
  direction: rtl;
  text-decoration: none !important;
  margin: 0 1px;
  font-size: 12px;
  transition: all 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  height: 3em;
  line-height: 2;
  > svg {
    margin: 0 2px;
    width: 17px;
    opacity: 0.75;
    -webkit-filter: drop-shadow(0 1px 3px rgb(0, 0, 0));
    filter: drop-shadow(0 1px 3px rgb(0, 0, 0));
  }
  &.ad-title {
    cursor: default;
  }
  &.ad-skip {
    bottom: 3.8em;
    right: 1em;
    background: #383838;
    padding: 6px 18px !important;
    font-weight: 700 !important;
    &.ad-skip-on {
      cursor: default;
      background: rgba(0, 0, 0, 0.6);
      font-weight: 600;
    }
  }
}

.video-react .video-react-bezel {
  z-index: 100000;
}

.react-video-ad-content {
  position: absolute;
  width: 100%;
  height: 100%;
  right: 0;
  top: 0;
  .react-video-ad-description {
    display: flex;
    position: absolute;
    z-index: 1000;
    flex-direction: row-reverse;
    bottom: 4.5em;
    left: 0.5em;
    transition: all 0.3s ease;
    .ad-actions {
      position: relative;
    }
  }
}

.video-react {
  &.video-react-ads-playing {
    //.video-react-control-bar {
    //  height: 15em !important;
    //}
    .video-react-control-bar-progress-bar {
      &, & * {
        pointer-events: none;
      }
    }

    .video-react-play-progress {
      background: #FFEB3B;
      color: #FFEB3B;
    }

    &:not(.video-react-paused) {
      &.video-react-user-inactive {
        .react-video-ad-description, .ad-actions.ad-skip {
          bottom: 0.5rem;
          transition-delay: 0.5s;
        }

        //.video-react-control-bar {
        //  height: 4.2em !important;
        //}
      }
    }

    .video-react-settings-control, .video-react-audio-only-control, .video-react-live-label {
      display: none;
    }
  }
}

@media (max-width: 540px) {
  .ad-actions {
    font-size: 11px;
    padding: 0 10px !important;
    line-height: 2 !important;
  }

  .ad-actions.ad-skip {
    bottom: 4.6em !important;
  }

  .ad-actions > svg {
    width: 16px;
    height: 16px;
    margin: 0 1px;
  }
  .chapter-list {
    display: none !important;
  }
}

.video-react-native-player, .video-react-controls-disabled {
  .react-video-ad-description, .ad-actions.ad-skip {
    bottom: 0.3rem !important;
  }
}

.video-react-native-seek-bar-disabled {
  audio::-webkit-media-controls-timeline,
  video::-webkit-media-controls-timeline,
  audio::-webkit-media-controls-timeline-container,
  video::-webkit-media-controls-timeline-container,
  audio::-webkit-media-controls-time-remaining-display,
  video::-webkit-media-controls-time-remaining-display,
  audio::-webkit-media-controls-current-time-display,
  video::-webkit-media-controls-current-time-display {
    display: none !important;
  }
}

a.ad-actions.ad-read-more span {
  margin: 0 6px;
  font-size: 8px;
  display: inline-block;
}
