@import "../../../../assets/less/core/boot.less";


@color-colorpicker-border: rgba(var(--bs-body-color-rgb), 0.1);
@color-colorpicker-active-border: rgba(var(--bs-body-bg-rgb), 0.7);
@color-colorpicker-active: #5fb6f5;

.field-colorpicker {

    ul.picker-options {
        list-style-type: none;
        padding: 0;
        margin: 0;
        margin-top: -8px;

        li {
            float: left;
            text-indent: -9999px;
            padding: 3px;
            margin: 13px 13px 0 0;
            cursor: pointer;
            border-radius: @border-radius-base;

            span {
                display: block;
                width: 25px;
                height: 25px;
                border: 1px solid @color-colorpicker-border;
                border-radius: 100%;
            }

            &:hover,
            &.active {
                background-color: @color-colorpicker-border;
                span {
                    border: 1px solid @color-colorpicker-active-border;
                }
            }

            &.custom-color {
                position: relative;
                span {
                    border-style: dashed;
                }
                &:hover,
                &.active {
                    span {
                        border-style: solid;
                    }
                }

                &:before {
                    text-indent: 0;
                    .icon(@icon-caret-up);
                    display: block;
                    text-align: center;
                    color: #000;
                    background: #e0e0e0;
                    font-size: 9px;
                    height: 9px;
                    line-height: 9px;
                    width: 9px;
                    position: absolute;
                    bottom: 3px;
                    right: 3px;
                }
            }
        }

    }

    &.disabled {
        ul.picker-options {
            li {
                &:hover {
                    cursor: not-allowed;
                    background-color: transparent;

                    span {
                        border: 1px solid @color-colorpicker-border;
                    }
                }

                &.active {
                    background-color: transparent;
                }

                &.custom-color {
                    position: relative;

                    span {
                        border-style: dashed;

                        &.disabled.is-empty {
                            &:before, &:after {
                                position: absolute;
                                left: 15px;
                                content: ' ';
                                height: 24px;
                                width: 1px;
                                background-color: #cecece;
                            }
                            &:before {
                                transform: rotate(45deg);
                            }
                            &:after {
                                transform: rotate(-45deg);
                            }
                        }
                    }

                    &:hover {
                        span {
                            border-style: dashed;
                        }
                    }
                    &.active {
                        span {
                            border: 1px solid @color-colorpicker-border;
                        }
                    }
                }
            }
        }
    }

    .input-group > ul.picker-options {
        margin: 0;

        li {
            margin: 0;
            padding: 6px;
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }
    }

}

//
// Spectrum
//

.sp-hue, .sp-slider { cursor: row-resize }
.sp-color, .sp-dragger { cursor: crosshair }
.sp-alpha-inner, .sp-alpha-handle { cursor: col-resize }

.sp-hue { left: 90%; }
.sp-color { right: 15%; }

.sp-container {
    border: @border-color !important;
    background: @primary-bg;
    border-radius: 8px;
    z-index: @zindex-datepicker;
    box-shadow: @box-shadow-z2;
    font-family: @font-family-base;
}

.sp-picker-container {
    border: none;
}

.sp-alpha-handle {
    background-color: @border-color;
    border: 1px solid @emphasis-color;
    width: 4px;
}

.sp-color, .sp-hue {
    border: 1px solid @border-color;
}

.sp-slider {
    background-color: @border-color;
    border: 1px solid @emphasis-color;
    height: 3px;
    left: -4px;
    width: 22px;
}
.sp-dragger {
    background:transparent;
    box-shadow: 0 0 0 1px #111;
}

.sp-input {
    outline: none !important;
    -webkit-appearance: none;
    background-color: @input-bg;
    border: 1px solid @input-border;
    box-shadow: @input-box-shadow;
    border-radius: @input-border-radius;
    color: @input-color;

    &:focus {
        border: 1px solid @input-border-focus;
        transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    }
}

.sp-button-container {
    width: 100%;
    position: relative;
    text-align: right;
    padding-top: 4px;
}

.sp-cancel {
    bottom: 0;
    left: 0;
    position: absolute;
    text-decoration: none;

    font-family: serif;
    font-size: (@font-size-base * 1.5);
    font-weight: @close-font-weight;
    line-height: 1;
    color: @close-color !important;
    text-shadow: @close-text-shadow;
    opacity: .2;

    &:hover,
    &:focus {
        text-decoration: none;
        cursor: pointer;
        opacity: .5;
    }
}

.sp-palette-container {
    border: none;
    float: none;
    margin: 0;
    padding: 5px 10px 0;
}
.sp-palette .sp-thumb-el,
.sp-palette .sp-thumb-el:hover {
    border: 1px solid rgba(0, 0, 0, 0.9);
}

.sp-palette .sp-thumb-el:hover,
.sp-palette .sp-thumb-el.sp-thumb-active {
    border-color: rgba(0, 0, 0, 0.9);
}

.sp-clear-enabled .sp-clear {
    left: 88%;
    height: 24px;
    margin-right: -4px;
}
