// placeholder
@import (optional, reference) '../../style/themes/index';

@color-prefix-cls: ~'@{mega-prefix}-color-panel';

.@{color-prefix-cls} {
  position: relative;
  width: 290px;
  display: inline-block;
  border: 1px solid @input-border-color;
  border-radius: 4px;
  &-container {
    position: relative;
    height: 156px;
    border-radius: 2px 2px 0 0;
    overflow: hidden;
    .@{color-prefix-cls}-gradient {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background: linear-gradient(to bottom, rgba(0, 0, 0, 0), black),
        linear-gradient(to right, white, rgba(255, 255, 255, 0));
    }
    .@{color-prefix-cls}-drag-handle {
      position: absolute;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      box-shadow:rgb(255, 255, 255) 0px 0px 0px 1.5px, rgb(0, 0, 0, .3) 0px 0px 1px 1px inset, rgb(0, 0, 0, .4) 0px 0px 1px 2px;
    }
  }
  .global-pick-color {
    width: 26px;
    font-size: 18px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: @text-color-secondary;
    &.active {
      color: @primary-color;
    }
  }
  &-area-slider {
    display: flex;
    padding: 16px 8px 14px 18px;
    .@{color-prefix-cls}-selected-color {
      position: relative;
      width: 40px;
      height: 40px;
      margin-right: 4px;
      border-radius: 50%;
      background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
      overflow: hidden;
      .@{color-prefix-cls}-selected-color-area {
        width: 100%;
        height: 100%;
      }
    }
    .@{color-prefix-cls}-slider {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .@{color-prefix-cls}-hue-slider,
    .@{color-prefix-cls}-alpha-slider {
      position: relative;
      margin-right: 9px;
      &__bar {
        margin-left: 9px;
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
        .bar {
          height: 14px;
          border-radius: 2px;
        }
      }
      &__thumb {
        position: absolute;
        width: 18px;
        height: 18px;
        background-color: white;
        border: 1px solid #ccc;
        border-radius: 50%;
        cursor: pointer;
      }
    }
  }
  &-area-input {
    position: relative;
    align-items: center;
    padding: 0 18px 10px;
    .edit-color-format {
      width: calc(100% - 16px);
      .color-item {
        padding-right: 2px;
        text-align: center;
        font-size: 16px;
        color: @text-color;
        // color: @input-border-color;
        // border: @border-width-base @border-style-base @input-border-color;
      }
      .rgb-color,
      .hsl-color {
        display: flex;
      }
      .color-item-text {
        font-size: 14px;
        color: @text-color-secondary;
      }
      .ant-input {
        height: 28px;
        text-align: center;
        padding: 0;
        font-size: 14px;
        margin-bottom: 4px;
      }
    }
    .change-color-format {
      position: absolute;
      right: 6px;
      top: 8px;
      cursor: pointer;
      transform: rotate(90deg);
      font-size: 24px;
      color: @text-color-secondary;
      user-select: none;
    }
  }
  .@{color-prefix-cls}-hue-slider {
    &__bar .bar {
      background: linear-gradient(
        to right,
        red 0%,
        #ff0 17%,
        lime 33%,
        cyan 50%,
        blue 67%,
        #f0f 83%,
        red 100%
      );
    }
  }
  .@{color-prefix-cls}-alpha-slider {
    margin-top: 10px;
  }

  .@{mega-prefix}-color-predefine {
    display: flex;
    font-size: 12px;
    padding-top: 14px;
    border-top: 1px solid @input-border-color;
    &__colors {
      display: flex;
      flex: 1;
      flex-wrap: wrap;
    }
    &__color-selector {
      margin: 0 0 14px 14px;
      width: 20px;
      height: 20px;
      border-radius: 4px;
      cursor: pointer;
      background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
      &.selected {
        box-shadow: 0 0 3px 2px @primary-color;
      }
      > div {
        display: flex;
        height: 100%;
        border-radius: 3px;
      }
    }
  }
}
