/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@use 'mixins' as *;

.data-quality-uml-element-editor {
  &__validation {
    width: 75%;
  }

  &__lambda {
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: row;

    &__value {
      display: flex;
      flex-direction: column;
      width: 100%;
    }

    &__label {
      display: flex;
      align-items: center;
      padding-right: 0.5rem;
      padding-left: 0.5rem;
      margin-right: 0.5rem;
      width: 7%;
      color: var(--color-light-grey-100);
      background: var(--color-dark-grey-200);
      font-weight: 500;
    }
  }
}

.relation-config-validations {
  margin-left: 1rem;
  margin-right: 1rem;
}

.relation-validation-config-editor {
  height: 100%;
  width: 100%;

  .panel {
    height: 100%;
    width: 100%;

    &__header {
      padding-left: 0.5rem;
      color: var(--color-light-grey-300);
      font-weight: bold;
      background: var(--color-dark-grey-50);
      border-bottom: 0.1rem solid var(--color-dark-grey-200);
    }

    &__header__title__label {
      background: var(--color-dark-grey-250);
    }

    &__header__action {
      color: var(--color-light-grey-400);
    }

    &__header__action[disabled] svg {
      color: var(--color-dark-grey-300) !important;
    }

    &__content {
      height: calc(100% - 5.6rem);
      background: var(--color-dark-grey-50);
    }

    &__content > div:first-child {
      margin-top: 0;
    }

    &__content__lists {
      height: 100%;
      width: 100%;
      padding: 1rem;
      overflow: auto;
    }
  }

  &__content {
    position: relative;
  }

  &__tabs__header {
    padding-left: 0;
    padding-right: 2.7rem;
  }

  &__tabs {
    height: 2.8rem;
    z-index: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  &__tab {
    @include flexCenter;

    display: inline-flex;
    height: 100%;
    color: var(--color-light-grey-400);
    padding: 0 1rem;
    border-right: 0.1rem solid var(--color-dark-grey-80);
    white-space: nowrap;
    cursor: pointer;
  }

  &__tab--active {
    position: relative;
  }

  &__tab--active::after {
    content: '';
    height: 0.2rem;
    width: 100%;
    position: absolute;
    bottom: 0;
    background: var(--color-yellow-200);
  }

  &__tab__hint {
    @include flexCenter;

    border-radius: 0.2rem;
    margin-left: 1rem;
    color: var(--color-light-grey-300);

    svg {
      font-size: 1.2rem;
    }
  }

  &__activator__selector__option {
    display: block;
    height: 7rem;
    padding-bottom: 0.4rem;
    max-width: 45rem;

    &__name {
      @include flexVCenter;

      height: 2.8rem;
      padding: 0 0.5rem;
    }

    &__description {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      line-clamp: 2;
      overflow: hidden;
      text-align: left;
      height: calc(100% - 2.8rem);
      padding: 0 0.5rem;
      line-height: 1.8rem;
      font-size: 1.2rem;
    }
  }

  &__definition {
    height: 100%;
    width: 100%;
    padding: 1rem;
    overflow: auto;

    &__item {
      padding-top: 1rem;

      &__header {
        padding-left: 1rem;
        padding-right: 1rem;

        @include flexVCenter;
        @include flexHSpaceBetween;

        &__action {
          display: flex;
          height: 2.8rem;
        }
      }

      &__header-group {
        display: flex;
        flex-direction: row;
        color: var(--color-light-grey-300);

        @include flexVCenter;
      }

      &__header-right {
        padding-left: 1rem;
        padding-right: 2rem;
        display: flex;
        justify-content: end;

        @include flexVCenter;
      }

      &__header__add-btn {
        @include flexCenter;

        height: 2.8rem;
        width: 2.8rem;
      }

      &__header__title {
        height: 2.8rem;

        @include flexVCenter;

        background: var(--color-dark-grey-200);
        color: var(--color-light-grey-100);
        padding: 0 1rem;
        border-radius: 0.2rem;
        margin: 0;
        font-weight: 500;
      }

      &__content {
        width: 100%;
        padding: 1rem;
        padding-top: 0.5rem;
      }

      &__content--empty {
        @include flexCenter;

        margin-top: 0.5rem;
        height: 4rem;
        width: 100%;
        color: var(--color-dark-grey-300);
        font-weight: 500;
        user-select: none;
        border: 0.2rem dashed var(--color-dark-grey-200);
      }
    }

    &__lambda-editor {
      height: 28rem !important;
    }

    &__result-viewer {
      height: 35rem !important;
      border: 0.1rem solid var(--color-dark-grey-280);
    }
  }

  &__return__type-editor {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
  }

  &__activator-builder {
    height: 100%;
    width: 100%;
  }
}

.relation-validation-dialog-modal {
  padding: 0;
  width: 50vw;
  overflow: hidden;

  &__root-container {
    margin-top: 0 !important;
  }

  &__container {
    align-items: center !important;
  }

  &__content {
    max-width: 100vw !important;
  }

  &__content--scrollable {
    max-width: 100vw !important;
  }

  .modal__body {
    height: calc(100% - 8.6rem);
    padding: 1rem;
  }

  .modal__body.modal__body--footless {
    height: calc(100% - 3.6rem);
  }

  &__absolute-date {
    padding-bottom: 1rem;
    border-top: 0.1rem solid var(--color-dark-grey-50);

    &__input {
      height: 2.8rem;
      border: 0.1rem solid var(--color-dark-grey-300);
      color-scheme: dark;
      font-size: 1.2rem;
    }
  }
}

.relation-validation-editor {
  padding: 1rem;
  border-radius: 0.2rem;
  display: flex;
  flex-direction: column;

  &__label {
    padding-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: right;
    width: 25%;
    background: var(--color-dark-grey-200);
    margin-right: 0.5rem;
  }

  &__select {
    width: 100%;
  }

  &__container {
    margin: 0.5rem 0;
  }

  &__dnd__placeholder {
    height: 8.1rem;
    padding: 1rem;
  }

  &__content {
    display: flex;
    margin-bottom: 0.5rem;

    &__lock {
      height: 2.8rem;

      @include flexVCenter;

      flex: 0 0 2.5rem;
      color: var(--color-light-grey-300);
    }

    &__select {
      @include flexVCenter;

      flex: auto;
      height: 2.8rem;
      background: var(--color-dark-grey-50);
      color: var(--color-light-grey-100);
      border-radius: 0.2rem;
    }

    &__name {
      @include flexVCenter;

      flex: auto;
      height: 2.8rem;
      background: var(--color-dark-grey-50);
      color: var(--color-light-grey-100);
      border: 0.1rem solid var(--color-dark-grey-300);
      padding: 0 0.5rem;
      border-radius: 0.2rem;
    }

    &__name::placeholder {
      color: var(--color-dark-grey-500);
    }

    &__name--with-lock {
      @include flexVCenter;

      flex: auto;
      height: 2.8rem;
      background: var(--color-dark-grey-300);
      color: var(--color-light-grey-100);
      padding: 0 1rem;
      border-radius: 0.2rem;
      cursor: default;
    }

    &__name--with-lock__icon {
      margin-right: 0.5rem;
      width: 1.5rem;

      svg {
        font-size: 1.2rem;
      }
    }

    &__name--with-lock__name {
      @include ellipsisTextOverflow;

      max-width: calc(100% - 1.5rem);
    }
  }
}

.relation-validation {
  padding: 1rem;
  border-radius: 0.2rem;

  &__container {
    margin: 0.5rem 0;
  }

  &__dnd__placeholder {
    height: 8.1rem;
    padding: 1rem;
  }

  &__lambda {
    border: 0.1rem solid var(--color-dark-grey-300);
  }

  &__content {
    display: flex;
    margin-bottom: 0.5rem;

    &__lock {
      height: 2.8rem;

      @include flexVCenter;

      flex: 0 0 2.5rem;
      color: var(--color-light-grey-300);
    }

    &__name {
      @include flexVCenter;

      flex: auto;
      height: 2.8rem;
      background: var(--color-dark-grey-100);
      color: var(--color-light-grey-200);
      padding: 0 1rem;
      border-radius: 0.2rem;
      font-weight: 500;
    }

    &__name::placeholder {
      color: var(--color-dark-grey-500);
    }

    &__name--with-lock {
      @include flexVCenter;

      flex: auto;
      height: 2.8rem;
      background: var(--color-dark-grey-300);
      color: var(--color-light-grey-100);
      padding: 0 1rem;
      border-radius: 0.2rem;
      cursor: default;
    }

    &__name--with-lock__icon {
      margin-right: 0.5rem;
      width: 1.5rem;

      svg {
        font-size: 1.2rem;
      }
    }

    &__name--with-lock__name {
      @include ellipsisTextOverflow;

      max-width: calc(100% - 1.5rem);
    }
  }
}
