@import "../../../themes/core/variables";
@import "../../../themes/theme/variable";
@import "../../../themes/theme/mixins";

.qms-select-department {
  font-family: 'Open Sans', sans-serif;
  .cursor-pointer {
    cursor: pointer;
  }

  .ml-5 {
    margin-left: 10px;
  }

  .padding-5 {
    padding: 5px;
  }

  .header-dialog {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
  }

  .input__field {
    display: flex;
    align-items: center;
    position: relative;

    input.input-search {
      width: 100%;
      padding: 10px;
      outline: none;
      border: none;
      background: theme-apply($background-input-text);
    }

    .btn-search {
      cursor: pointer;
      vertical-align: middle;
      position: absolute;
      top: 50%;
      right: 10px;
      transform: translateY(-50%);
    }
  }

  .line__divider {
    border-bottom: 1px solid #ccc;
    height: 1px;
    margin-top: 10px;
    min-width: 300px;
    max-width: 100%;
  }

  .mat-expansion-panel-header {
    height: 30px;
    font-size: 12px;
    letter-spacing: 1px;
    font-family: 'Raleway';
    font-weight: 600;
    padding: 0;

    .mat-expansion-panel-header-title {
      align-items: center;
      margin-left: 12px;
    }
  }

  .mat-expansion-panel:not([class*="mat-elevation-z"]) {
    box-shadow: none;
  }

  .panel__item {
    max-height: 175px;
    margin-top: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 5px;
    width: 100%;
    display: block;
    .related__item__inline {
      max-width: 100%;
    }
    /* TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version. */
    ::ng-deep .mat-chip-list-wrapper{
      margin: 0 -4px !important;
    }

    .select__toggle-include {
      width: 100%;
      /* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
      &.toggle-include-child .mat-mdc-slide-toggle.qms-group-options .mat-slide-toggle-thumb {
        background-color: #5a5a5a !important;
      }
    }

    .related__item__content {
      height: 32px;
      line-height: 32px;
      background-color: theme-apply($related-item-background);
      max-width: 100%;
      margin-bottom: 5px;
      margin-left: 2.5px;
      margin-right: 2.5px;

      .mat-icon {
        color: theme-apply($related-mat-icon-color);
        font-size: 24px;
      }
    }
  }

  .header-title {
    font-weight: 600;
    color: black(0.87);
  }

  .result-content {
    padding-right: 0 !important;
    /* TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version. */
    .mat-chip-list {
      min-height: 40px;

      .mat-icon {
        color: black(.3) !important;
        cursor: pointer;

        &:hover {
          color: black(1) !important;
        }
      }
    }


    span.related__item__content_name {
      min-width: calc(100% - 13px);
      // max-width: 250px;
      display: flex;
      align-items: center;
      & > span:nth-child(1){
        display: inline-block;
        margin-right: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
      }

      .select__include-children__count {
        font-size: 0.75rem;
        color: black(0.5);
        font-weight: 600;
        line-height: 16px;
      }
    }
  }

  .text-name {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    cursor: pointer;
    width: 100%;
  }

  ::ng-deep .mat-mdc-checkbox.qms-group-options.flex-direction-row {
    /* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
    .mat-checkbox-layout {
      white-space: normal;
    }
    /* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
    .mat-checkbox-label {
      flex-direction: row;
      align-items: center;
      position: relative;
      padding-bottom: 2px;
    }
  }

  .confirm__button__groups {
    .btn-add>.qms-btn-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }

  ::ng-deep .custom-department-tree{
    .qms-view-search-result{
      height: 100% !important;
      .result{
        max-height: calc(100% - 80px) !important;
      }
    }
    .loading-container{
      height: calc(100% - 40px) !important;
    }
  }

  ::ng-deep.btn-close-dialog.qms-btn-icon:focus:not(:hover) {
      background-color: unset !important;
      color: unset !important;
  }
}
.qms-spinner-wrapper{
  display: inline-block;
  width: 22px;
  height: 22px;
  .qms-spinner {
    font-size: 20px;
    width: 1em;
    height: 1em;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    .mat-mdc-progress-spinner circle, .mat-mdc-progress-spinner circle{
      stroke: #1b75be !important;
    }
  }
}

@media screen and (max-width: 600px) {
  ::ng-deep .cdk-global-overlay-wrapper{
    justify-content: center !important;
    width: 100vw;
  }
  .header-title{
    font-size: 14px;
  }
  .related__item__content_name{
  font-size: 12px !important;
  }
}
