// -----------------------------------------------------------------------------
// This file contains all styles related to the ComprehensiveSearch component.
// -----------------------------------------------------------------------------
// @import "./variables.scss";

.#{$namespace}cphs-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  padding: $cphs-search-padding;
  min-height: $cphs-search-min-height;
  border: $cphs-border;
  border-radius:$cphs-search-border-radius;
  font-size: 12px;

  &:hover {
    border: $cphs-hover-border;
  }

  input {
    padding: 0;
    border-width: 0;
    outline: none;

    &:hover {
      border: none !important;
    }

    &:focus {
      border: none !important;
    }
  }
  // 覆盖select中input:focus导致的边框高亮
  .#{$namespace}select .#{$namespace}select-value-box .#{$namespace}select-value-input[readonly]:focus {
    border: none !important;
  }

  &-list {
    width: 124px !important;
    min-width: auto;
  }

  &-list-item {
    text-align: left;
  }

  &-field {
    margin-right: $cphs-search-field-margin;
    padding: $cphs-search-field-padding;
    height: $cphs-search-field-height;
  }

  &-field-selector {
    flex: 1;
    min-width: 120px;

    &:first-child {
      margin-left: 6px;
    }

    .#{$namespace}dropdown {
      .#{$namespace}dropdown-group-box .#{$namespace}dropdown-item-group-box .#{$namespace}dropdown-item-group .#{$namespace}dropdown-item:hover {
        color: #000;
        background-color: #f7f7f7;
      }
    }
  }

  &-control {
    display: flex;
    flex-wrap: nowrap;
    flex: 1;
    align-items: center;

    i {
      margin: $cphs-search-control-icon-margin;
      font-size: 16px;
      cursor: pointer;
      color: $cphs-search-control-icon-color;

      &:hover {
        color: $cphs-search-control-icon-hover-color;
      }
    }

    input {
      border-radius: 0;
    }
  }

  &-input {
    padding-right: 6px;
    flex: 1;
  }

  .#{$namespace}field-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    background: $cphs-search-field-background;
    line-height: 1;
    border-radius: $cphs-search-field-border-radius;
  }

  .#{$namespace}field-name {
    margin-left: $cphs-search-field-name-margin-left;
    color: $cphs-search-field-name-color;
    white-space: nowrap;
  }

  .#{$namespace}field-action {
    height: 100%;

    &-item {
      text-align: left;
      height: 30px;
      line-height: 30px;
    }

    &-trigger {
      text-align: left;
      height: 18px;
      line-height: 16px;

      .#{$namespace}input.#{$namespace}input-has-icon>i:last-child {
        display: none;
      }

      .#{$namespace}input.#{$namespace}input-has-icon>input {
        padding-right: 0;
      }

      &.#{$namespace}select .#{$namespace}select-value-box .#{$namespace}select-value-input[readonly] {
        padding-left: 12px;
        border-width: 0;
        height: 18px;
        background-color: transparent;

        &:focus {
          border: none !important;
        }
      }
    }

    &-wrapper {
      position: relative;
      width: 100%;
      height: 100%;
    }

    &-input {
      box-sizing: content-box;
      padding: 0;
      width: 100%;
      max-width: 100%;
      background: transparent;

      input {
        background: transparent;
        padding-right: 6px;
        height: 18px;
      }

      &--width {
        position: absolute;
        top: -100%;
        height: 0;
        overflow: hidden;
        visibility: hidden;
        white-space: nowrap;
      }
    }

    .#{$namespace}dropdown-item {
      line-height: 22px;
      text-align: left;
    }
  }

  .#{$namespace}field-clear {
    &-icon {
      padding: 6px 6px 6px 0;
      cursor: pointer;
      line-height: 0;
    }
  }
}