ux-color-picker {
  display: block;
}

.ux-color-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  font-size: @font-size;

  .ux-color-picker-swatch {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .ux-color-picker-swatch-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .ux-color-picker-color {
    border: 5px solid transparent;
    padding: 3px;

    > button {
      width: 32px;
      height: 32px;
      box-shadow: 0 0 6px 2px #ddd;
      display: flex;
      justify-content: center;
      align-items: center;

      > ux-icon {
        display: none;
      }

      &.ux-focus-indicator-active {
        outline: none !important; // required until we move all focus styling to box-shadows
        box-shadow: 0 0 0 3px fade(@primary, 50%);
      }
    }

    &.ux-small > button {
      width: 26px;
      height: 26px;
    }

    &.ux-large > button {
      width: 40px;
      height: 40px;
    }

    &.ux-circle {
      border-radius: 50%;

      > button {
        border-radius: 50%;
      }
    }

    &.ux-selected {
      > button > ux-icon {
        display: block;
        font-weight: 700;
      }
    }
  }

  .ux-color-picker-input-panel {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 4px;
    border-top: 1px solid @grey5;

    .ux-color-picker-input-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      margin: 12px 8px 4px;

      label {
        margin: 0;
        text-align: center;
        font-weight: bold;
      }

      .ux-color-picker-input-toggle {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        padding-left: 9px;
        padding-right: 5px;
        font-size: inherit;
      }
    }

    .ux-color-picker-input {
      display: flex;
      flex-direction: column;
      flex: 1;
      position: relative;
      min-width: 10rem;
      margin: 4px 8px 8px;

      input {
        width: 100%;
        height: 32px;
        padding: 2px;
        font-size: 16px;
        text-align: center;
      }
    }
  }

  .ux-color-picker-preview {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 6px 2px #ddd;

    &.ux-circle {
      border-radius: 50%;
    }
  }
}

// Additional class for showing a color preview within a button.
.ux-color-picker-button-preview {
  display: inline-block;
  width: 32px;
  margin-right: 8px;
  border: 1px solid #cbcbcb;
}

.ux-color-picker-dropdown {
  padding: 4px;
}
