.bixi-color-picker {
  display: inline-block;

  &-color {
    &-control {
      display: flex;
      align-items: center;
      margin: 8px 0;
    }

    &-slider {
      -webkit-box-flex: 1;
      flex: 1 1 0%;
      padding: 4px 0;
    }

    &-preview {
      position: relative;
      width: 17px;
      height: 17px;
      margin-left: 4px;
      border-radius: 3px;
    }
  }

  &-trigger {
    display: inline-block;
    display: flex;
    align-items: center;
    width: 58px;
    height: 24px;
    padding: 2px;
    line-height: 24px;
    border: 1px solid #e8e8e8;
    border-radius: 2px;

    &-middle {
      height: 28px;
      line-height: 28px;
    }

    &-large {
      height: 32px;
      line-height: 32px;
    }

    &-small {
      height: 24px;
      line-height: 24px;
    }

    &-disabled {
      background-color: #f5f5f5;
      cursor: not-allowed;

      .bixi-color-picker-trigger-inner {
        opacity: 0.35;
      }
    }

    &-inner {
      width: 100%;
      height: 100%;
      border-radius: 2px;
    }
  }

  &-single {
    &-block {
      width: auto;
      height: 100%;
      padding: 2px 4px;
      border-radius: 2px;
    }
  }

  &-panel {
    width: 250px;
    box-shadow: 0 3px 10px 0 rgba(45, 47, 51, 0.15);

    &-content {
      padding: 8px 8px 0;
    }
  }

  &-preset {
    &-colors {
      padding: 4px 2px;
      border-top: 1px solid #e8e8e8;
    }

    &-color {
      display: inline-block;
      width: 12.5%;
      margin: 3px auto;
      text-align: center;

      &-wrap {
        display: inline-block;
        box-sizing: border-box;
        width: 20px;
        height: 20px;
        line-height: 24px;
        border-style: solid;
        border-width: 1px;
        border-radius: 50%;
        cursor: pointer;
      }

      &-inner {
        display: inline-block;
        width: 16px;
        height: 16px;
        margin-top: 1px;
        text-align: center;
        border-radius: 50%;
      }
    }
  }

  &-fields {
    display: flex;
    gap: 4px;
    justify-content: space-between;
  }

  &-field {
    &-hex {
      flex-shrink: 0;
      width: 75px;
    }

    &-rgba {
      display: flex;

      &-color {
        margin-left: 4px;
      }
    }

    &-input {
      font-size: 12px;
      text-align: center;

      .ant-input-sm {
        padding: 1.6px 3px;
        font-size: 12px;
      }
    }

    &-title {
      height: 20px;
      font-size: 12px;
      line-height: 20px;
      text-align: center;
    }
  }

  &-saturation {
    position: relative;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 140px;
    margin-bottom: 8px;
    background: rgb(0, 47, 255);

    &-white {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      background: linear-gradient(90deg, #fff, hsla(0deg, 0%, 100%, 0));
    }

    &-black {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      background: linear-gradient(0deg, #000, transparent);
    }

    &-pointer {
      position: absolute;
      cursor: default;
    }

    &-circle {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      box-shadow: 0 0 0 2px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
      transform: translate(-4px, -6px);
    }
  }

  &-overlay {
    .ant-popover-content {
      .ant-popover-inner-content {
        padding: 0;
      }
    }
  }

  &-alpha {
    position: relative;
    display: block;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, rgba(15, 115, 230, 0) 0%, rgb(15, 115, 230) 100%);
    border-radius: 4px;
    inset: 0;

    &-control {
      display: flex;
      margin-top: 4px;
    }

    &-sliders {
      flex: 1;
    }

    &-inner {
      position: relative;
      height: 100%;
      margin: 0 4px;
    }

    &-pointer {
      position: absolute;
      top: 1px;
    }

    &-circle {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      box-shadow: 0 0 0 2px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
    }

    &-block {
      position: absolute;
      background: rgb(25 77 51);
      border-radius: 2px;
      box-shadow: rgb(0, 0, 0, 0.15) 0 0 0 1px inset, rgb(0, 0, 0, 0.25) 0 0 4px inset;
      inset: 0;
    }
  }

  &-hue {
    position: relative;
    display: block;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, red 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red);
    border-radius: 4px;

    &-control {
      display: flex;
    }

    &-sliders {
      flex: 1;
    }

    &-inner {
      position: relative;
      height: 100%;
      margin: 0 4px;
    }

    &-pointer {
      position: absolute;
      top: 1px;
    }

    &-circle {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      box-shadow: 0 0 0 2px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
    }
  }
}

.bixi-color-block {
  display: inline-block;
  color: #000;

  &-dark {
    color: #fff;
  }
}
