@import "../PlayerMixins.scss";

.wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
}

.bitmovinWrapper {
  flex: 1;
  position: relative;

  &.isReady {
    :global {
      .bmpui-label-placeholder {
        opacity: 0;
      }

      .bmpui-ui-playbacktimelabel {
        opacity: 1;
      }
    }
  }

  &:not(.isReady) {
    :global {
      .bmpui-label-placeholder {
        opacity: 1;
      }

      .bmpui-ui-playbacktimelabel {
        opacity: 0;
      }

      .bmpui-ui-seekbar {
        pointer-events: none;

        .bmpui-seekbar-bufferlevel,
        .bmpui-seekbar-seekposition,
        .bmpui-seekbar-playbackposition,
        .bmpui-seekbar-playbackposition-marker {
          opacity: 0;
        }
      }
    }
  }

  :global {
    .bmpui-ui-controlbar > .bmpui-container-wrapper {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .bmpui-controlbar-bottom {
      @include slider();
    }

    .bmpui-controlbar-top {
      & > .bmpui-container-wrapper {
        display: flex;
        justify-content: space-between;
      }

      .bmpui-label-placeholder,
      .bmpui-ui-playbacktimelabel {
        display: block;
        height: 20px;
        @include typography(text, 300, regular);
        user-select: none;
        transition: var(--transition-fast);
        transition-property: opacity, visibility;

        &.bmpui-hidden {
          opacity: 0;
          visibility: hidden;
        }
      }

      .bmpui-label-placeholder {
        position: absolute;
      }

      .bmpui-time-wrapper {
        position: relative;
      }

      .bmpui-current-time {
        color: var(--color-content-strong);

        .bmpui-label-placeholder {
          left: 0;
        }
      }

      .bmpui-total-time {
        color: var(--color-content-muted);

        .bmpui-label-placeholder {
          right: 0;
        }
      }

      .bmpui-ui-playbacktimelabel-live {
        display: flex;
        gap: 8px;

        &:not(.bmpui-ui-playbacktimelabel-live-edge) {
          cursor: pointer;

          &::before {
            background: var(--color-content-muted);
          }
        }

        &::before {
          content: "";
          display: block;
          -webkit-mask-image: url(../../../assets/signal.svg);
          mask-image: url(../../../assets/signal.svg);
          background: var(--color-content-accent);
          width: 20px;
          height: 20px;
        }
      }
    }
  }
}

.buttonsWrapper {
  display: flex;
  gap: 8px;
}
