@import '../../style/variable';

.#{$namespace} {
  &-video-editor {
    width: 100%;
    height: 100%;

    &__content {
      height: calc(100% - 40px);
      display: flex;
      flex-direction: row;
      overflow-x: auto;

      &-left {
        flex-shrink: 0;
        width: 236px;
        height: 100%;
        border-right: 1px solid rgba(0,0,0,0.15);
      }

      &-right {
        padding-left: 10px;
        padding-right: 10px;
        flex: 1;
        height: 100%;
        overflow-x: auto;
      }
    }
  }

  &-video-editor-tool {
    padding-bottom: 20px;
    height: 40px;
    
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    &__left {
      display: flex;
      flex-direction: row;
      align-items: center;
    }

    &__right {
      display: flex;
      flex-direction: row;
      align-items: center;
      column-gap: 28px;

      &-slider {
        display: flex;
        flex-direction: row;
        align-items:  center;
        column-gap: 12px;

        &-s {
          width: 100px !important;
        }
      }
    }
  }

  &-video-editor-track-manager {
    &__header {
      width: 100%;
      height: 40px;

      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;

      column-gap: 32px;

      border-bottom: 1px solid rgba(0,0,0,0.15);
    }

    &__body {
      &-track {
        position: relative;
        padding-left: 24px;
        padding-right: 24px;

        height: 80px;

        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;

        font-weight: 500;
        font-size: 14px;

        cursor: pointer;

        &--active {
          color: #0067EE;

          &::after {
            content: '';
            display: block;
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            pointer-events: none;

            background: rgba(0,103,238,0.05);
            border: 1px solid #0067EE;
            z-index: 1;
          }
        }

        &-left {
          display: flex;
          flex-direction: row;
          align-items: center;
          column-gap: 16px;
        }

        &-right {
          display: flex;
          flex-direction: row;
          align-items: center;
          column-gap: 16px;
        }
      }
    }
  }

  &-video-editor-rule {
    width: 100%;
    height: 100%;

    &__track {
      position: relative;
      height: 100%;

      user-select: none;

      &-scale {
        position: relative;

        width: 100%;
        height: 40px;

        border-bottom: 1px solid #BFBFBF;

        &-text {
          position: absolute;
          top: 2px;
          font-weight: 400;
          font-size: 12px;
          color: rgba(0,0,0,0.65);

          user-select: none;

          &:not(&--first):not(&--last) {
            transform: translateX(-50%);
          }

          &--last {
            transform: translateX(-100%);
          }
        }

        &-line {
          position: absolute;
          bottom: 0;
          height: 7px;
          width: 1px ;
          background-color: #BFBFBF;

          &--align {
            height: 13px;
          }
        }
      }

      &-locator {
        position: absolute;

        bottom: 0px;
        height: 90%;
        width: 1px;
        background-color: rgba(250, 140, 22, 1);

        transition: left 0.3s linear;

        &-container {
          position: relative;
          width: 100%;
          height: 100%;

          &-btn {
            position: absolute;
            left: 0;
            top: 0;

            transform: translate3d(-50%, -100%, 0);

            &:hover {
              cursor: pointer;
            }
          }
        }
      }
    }
  }

  &-video-editor-video-track {
    margin-bottom: 4px;
    position: relative;

    width: 100%;
    height: 76px;

    user-select: none;

    &__img {
      position: absolute;
      height: 100%;
      object-fit: cover;
    }

    &__slices {
      position: absolute;
      left: 0;
      top: 0;

      width: 100%;
      height: 100%;

      &-box {
        position: absolute;
        height: 100%;

        background: rgba(0,0,0,0.45);
        border-radius: 2px;

        &--active {
          border-radius: 2px;
          border: 3px solid #0067EE;
          background: transparent;
        }

        &-action {
          position: relative;
          width: 100%;
          height: 100%;

          &-anchor {
            position: absolute;
            top: 50%;

            width: 12px;
            height: 12px;
            border-radius: 6px;
            background-color: #fff;

            z-index: 6;

            &:hover {
              cursor: move;
            }

            &--left {
              left: -5px;
              transform: translate3d(0, -50%, 0);
            }

            &--right {
              right: 5px;
              transform: translate3d(0, -50%, 0);
            }
          }
        }
      }

    }
  }

  &-video-editor-audio-track {
    margin-bottom: 4px;
    position: relative;

    width: 100%;
    height: 76px;

    user-select: none;

    &__text {
      padding-right: 20px;
      height: 100%;

      display: flex;
      flex-direction: row;
      align-items: center;
      flex-wrap: nowrap;

      font-weight: bold;
      font-size: 14px;
      color: rgba(0,0,0,0.65);

      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      background-color: rgba(186, 244, 228, 1);
    }

    &__frame {
      position: absolute;
      height: 100%;

      &-c {
        position: relative;
        width: 100%;
        height: 100%;

        background-color: rgba(186, 244, 228, 1);

        &:hover {
          cursor: pointer;
        }

        &-img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }

        &-text {
          position: absolute;
          left: 0;
          right: 0;
          top: 50%;

          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;

          font-weight: bold;
          font-size: 14px;
          color: rgba(0,0,0,0.65);

          transform: translateY(-50%);

          &--top {
            top: 0;
            transform: none;
          }
        }
      }
    }
  }
}