$slate: #294661;
$swatch-size: 30px;
$border-radius: 2px;
$border-width: 1px;
$border-style: solid;
$border-color: rgba($slate, 0.1);
$border-style: $border-width $border-style $border-color;
$element-spacing: 6px;

@mixin control-padding() {
  margin-left: $element-spacing * 2;
  margin-right: $element-spacing * 2;
}

@mixin border() {
  border-width: $border-width;
  border-style: $border-style;
  border-color: $border-color;
}

@mixin editable-input() {
  display: block;
  text-align: center;
  text-transform: uppercase;
  & > div:not(:last-child) {
    margin-right: $element-spacing;
  }
  input {
    @include border();
    display: block;
    font-size: 11px;
    height: $swatch-size;
    text-align: center;
    width: 100%;
  }
  span {
    display: block;
    font-size: 13px;
    margin-top: $element-spacing;
    text-align: center;
  }
}

@mixin color-swatch() {
  border-radius: $border-radius;
  display: block;
  height: $swatch-size;
  width: $swatch-size;
}

.color-palette {
  background: #ffffff;
  border-radius: $border-radius;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.3);
  position: absolute;
  width: 240px;
}

.dismissable-background {
  height: 100%;
  left: 0;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 130;
}

.saturation {
  border-radius: 2px 2px 0 0;
  margin-bottom: 12px;
  overflow: hidden;
  padding-bottom: 55%;
  position: relative;
  width: 100%;
}

.current-color-swatch {
  flex: 1;
  min-width: $swatch-size;
}

.hex-color-control {
  @include editable-input();
  display: flex;
  flex: 3;
  margin-right: $element-spacing;
}

.rgb-color-controls {
  @include editable-input();
  display: flex;
  flex: 3;
}
.text-disabled input {
  pointer-events: none;
  user-select: auto;
}

.controls {
  @include control-padding();
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: #294661;
  display: flex;
  justify-content: space-between;
  max-width: 100%;
  padding-bottom: $element-spacing * 2;
  padding-top: $element-spacing;
}

.HueSlider,
.hue {
  @include control-padding();
  height: 10px;
  margin-bottom: 8px;
  position: relative;
}

.saved-color-list {
  @include control-padding();
  border-top: $border-style;
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 8px;
  padding-top: 14px;
  .add-color-button {
    @include color-swatch();
    @include border();
    background: #ffffff;
    cursor: pointer;
    padding: 0;
    margin-left: 0;
    &:hover {
      border-color: rgba($slate, 0.4);
    }
    i {
      color: #546b81;
      margin-left: 0;
    }
  }
}

.color-swatch {
  @include color-swatch();
  margin-right: $element-spacing;
  max-width: $swatch-size;
  position: relative;
  & .remove-color {
    cursor: pointer;
    display: none;
    line-height: normal;
    padding: 0;
    position: relative;
    i {
      display: block;
      font-size: 8px;
      margin-left: 0;
    }
  }
  &:hover > .remove-color {
    @include border();
    background-color: white;
    border-radius: 50%;
    display: block;
    height: 13px;
    padding: 0;
    position: absolute;
    right: -7px;
    top: -7px;
    width: 13px;
    z-index: 2;
  }
}

.saved-color-swatch {
  cursor: pointer;
  margin-bottom: 6px;
}
