@import "../../../style/variables.less";
@import "../../../Loader/style/Loader.less";


.@{prefix}-option-field_display-value {
  height: auto;
  padding: 4px 0;
  line-height: 18px;
  border-bottom: 1px solid @form-field-border;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  display: flex;

  .fm-more-o {
    color: @maycur-color;
    margin-left: 5px;
  }

  &.origin {
    padding: 6px 12px;
    border: 1px solid @form-field-border;

    &:hover {
      border-color: @active-form-border-bottom-color;
    }
  }

  &:hover {
    border-bottom-color: @active-form-border-bottom-color;

    .ant-select-arrow-font {
      color: @active-form-border-bottom-color;
    }

    .ant-select-clear {
      opacity: 1;
    }

    .ant-select-arrow-hide {
      display: none;
    }
  }

  &.readOnly {
    border-bottom: 1px dashed @form-field-border;
    cursor: not-allowed;
    &:hover {
      .ant-select-arrow-font {
        color: #00000040;
      }
      .ant-select-arrow-hide {
        display: block;
      }
    }
  }

  .placeholder {
    color: @form-input-placeholder;
  }

  .ant-select-arrow-font {
    position: static;
    transition: transform 0.3s;
    color: #00000040;
    font-size: 12px;

    // &.up {
    //     transform: rotate(180deg);
    // }

    // &.down {
    //     transform: rotate(-180deg);
    // }
  }

  .ant-select-clear {
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    background: @active-form-border-bottom-color;
    opacity: 0;
  }
  .ant-select-showStandingBook {
    position: absolute;
    right: 33px;
    top: -21px;
    font-weight: 400;
    font-size: 12px;
    color: #3296fa;
  }
}

.@{prefix}-option-field {
  @height: 27px;
  @color: @maycur-color-hover;
  position: relative;

  .crumbs {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    line-height: 24px;
    border-bottom: 1px solid @border-color;

    .crumb-item {
      .crumb-name {
        cursor: pointer;
        color: @maycur-color;
      }

      .split {
        margin: 0 4px;
        color: #888;
      }

      &:last-child {
        .crumb-name {
          color: #333;
        }
      }
    }
  }

  .dropdown {
    display: none;
    position: absolute;
    top: @height;
    width: 100%;
    min-width: 250px;
    max-height: 300px;
    min-height: 200px;
    // overflow: auto;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background-color: #fff;
    margin-top: 4px;
    border-radius: 4px;
    z-index: 99;

    .@{prefix}-option-field_display-value-clone {
      height: auto;
      padding: 4px 0;
      line-height: 18px;
      border-bottom: 1px solid @form-field-border;
      margin: 2px 7px;
    }

    &.in {
      display: flex;
      flex-direction: column;
    }

    .search {
      display: flex;
      flex-shrink: 0;
      border-bottom: 1px solid @border-color;
      padding: 5px 12px;
      background-color: #fff;

      input {
        background-color: #f7f7f7;
        padding: 5px !important;
        border: none;
      }
    }

    .ant-list {
      overflow: auto;

      .ant-list-item {
        padding: 8px 12px;
        border-bottom: none;
        cursor: pointer;

        &:hover {
          background-color: @maycur-color-hover;
        }

        .item-name {
          display: flex;
          flex-direction: column;
          .fm-paper {
            margin-right: 5px;
            color: @maycur-color;
          }
          .full-path {
            padding-left: 20px;
            word-break: break-all;
            font-size: 12px;
          }
        }
      }
    }

    .panel {
      display: flex;
      flex-grow: 1;
      flex-direction: column;
      overflow: auto;
    }

    .empty-text {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-grow: 1;
      color: #888;
    }

    .item {
      padding: 5px 12px;
      line-height: 22px;
      cursor: pointer;

      &:hover {
        background-color: @maycur-color-hover;
      }

      .fm {
        color: @maycur-color;
        margin-right: 5px;
      }

      &-code {
        padding-left: 19px;
        line-height: 1;
        font-size: @secondary-font-size;
        color: @secondary-text-color;
      }
    }
  }
}

.has-error {
  .@{prefix}-option-field {
    .display-value {
      border-bottom-color: @icon-fee-red;
    }
  }
}

// .@{prefix}-option-field_table-cell {
//     padding: 6px 5px;
//     border: 1px solid @border-color;
// }
