/**
 * 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 *;
@forward 'data-quality-validation-builder';
@forward 'data-quality-relation-validation-builder';
@forward 'data-quality-relation-validation-suggestion-panel';
@forward 'data-quality-validation-gui-editor';
@forward 'data-quality-custom-selector';
@forward 'data-quality-relation-comparison-editor';

.data-quality-constraints {
  display: flex;
  flex-direction: row;
  height: 100%;

  &__body {
    display: flex;
  }
}

.element-creation-basis {
  width: 50%;
  margin-top: 1rem;
}

.dq-validation-element-type {
  margin-bottom: 1rem;
}

.data-quality-explorer {
  &__new-element-modal__driver {
    height: 2.8rem;
    width: 100%;
    margin-bottom: 1rem;

    &__dropdown {
      width: 100%;
    }
  }
}

.icon--dataQuality {
  color: var(--color-blue-50);
}

.constraints-selection-tab {
  height: 100%;
  width: 100%;
}

.constraints-selection-node {
  display: flex;
  flex-direction: column;
  margin-left: 1rem;
}

.structure-validations-btn {
  color: var(--color-text-on-accent);
  height: 2.2rem;
  border-radius: 0.2rem;
  margin-right: 0.3rem;
  width: 15rem;
  font-size: 1.2rem;
}

.validation-date-selection-modal {
  padding: 0;
  width: 25vw;
  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-border-subtle);

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

.trial-runs-result-modifier-prompt {
  @include flexVCenter;

  overflow-x: auto;
  overflow-y: hidden;

  &__header {
    @include flexVCenter;

    height: 2.2rem;

    &__label {
      @include flexVCenter;

      height: 2.2rem;
      padding: 1rem;
      text-underline-position: under;
    }

    &__label__icon {
      font-size: 1.3rem;
      margin-right: 0.7rem;
    }

    &__label__title {
      white-space: nowrap;
      font-size: 1.3rem;
      font-weight: 500;
    }
  }

  &__divider {
    color: var(--color-text-secondary);
    margin-right: 1rem;
  }

  &__divider--light {
    margin-left: 1rem;
  }

  &__group {
    @include flexVCenter;

    &__label {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0.7rem;
      height: 2.2rem;
      background: var(--color-bg-elevated);
      color: var(--color-text-secondary);
      white-space: nowrap;
      line-height: 1.8rem;
      border-radius: 0.1rem;
      font-size: 1.1rem;
    }
  }
}

.data-quality-multi-custom-selector {
  @include flexVCenter;

  min-height: 2.8rem;
  border: 0.1rem solid var(--color-border-default);
  border-radius: 0.2rem;
  background: var(--color-bg-panel);

  &__tags {
    display: flex;
    flex-wrap: wrap;
    flex: 1;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    min-height: 2.6rem;
    align-items: center;
  }

  &__placeholder {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    user-select: none;
  }

  &__tag {
    @include flexVCenter;

    height: 2rem;
    padding: 0 0.3rem 0 0.6rem;
    background: var(--color-bg-elevated);
    border-radius: 0.2rem;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    gap: 0.3rem;

    &__label {
      white-space: nowrap;
    }

    &__remove {
      @include flexCenter;

      width: 1.6rem;
      height: 1.6rem;
      border: none;
      background: none;
      padding: 0;
      cursor: pointer;
      color: var(--color-text-muted);
      border-radius: 0.2rem;

      &:hover {
        background: var(--color-bg-tag);
        color: var(--color-text-primary);
      }

      svg {
        font-size: 1rem;
      }
    }
  }

  &__dropdown-trigger {
    @include flexCenter;

    width: 2.4rem;
    min-width: 2.4rem;
    height: 100%;
    align-self: stretch;
    cursor: pointer;
  }
}
