/* Last Updated: 12.07.2025 at 02:38 (CEST) */
.color-picker {
    display: flex;
    width: 100%;
    gap: 8px;
    background: var(--cp-bg, #F9F9F9);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 8px;
    align-items: stretch;
}
html.dark-mode .color-picker { --cp-bg: #1E1E1E; }
.picker-main {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
}
.preview-column {
    flex: 0 0 30%;
}
.selected-color {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--color-input-border);
}
.controls-column {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.picker-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sv-container {
    position: relative;
    flex: 1;
    padding-top: 80%;
}
#sv-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    cursor: crosshair;
    border: 1px solid var(--color-input-border);
}
.sv-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-7px, -7px);
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}
.hue-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    margin-top: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
    cursor: pointer;
}
.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-input-border);
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.hue-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-input-border);
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.value-box,
.selected-color,
.hue-slider {
    transition: transform 0.2s, opacity 0.2s;
}
.value-box:hover,
.value-box:focus,
.selected-color:hover,
.selected-color:focus,
.hue-slider:hover,
.hue-slider:focus {
    transform: scale(1.05);
    opacity: 0.9;
}
.value-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}
.value-box {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}
.value-box input {
    width: 100%;
    height: 32px;
    line-height: 32px;
    padding: 0 8px;
    font-family: monospace;
    font-size: 15px;
    border: 1px solid var(--color-input-border);
    border-radius: 4px;
    background: var(--color-input-bg);
    color: var(--color-input-text);
}
.lightness-bar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 20px;
    margin-left: 8px;
    height: 100%;
}
.lightness-bar.horizontal {
    flex-direction: row;
    width: 100%;
    height: 20px;
    margin: 8px 0 0;
}
.lightness-segment {
    position: relative;
    flex: 1;
    width: 20px;
    border-radius: 4px;
}
.lightness-bar.horizontal .lightness-segment {
    height: 20px;
}
.lightness-segment span {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    white-space: nowrap;
}
.lightness-bar.horizontal .lightness-segment span {
    left: 50%;
    top: 24px;
    transform: translateX(-50%);
}
.selected-segment {
    border: 2px solid #fff;
}

@media (max-width: 600px) {
    .color-picker {
        flex-direction: column;
    }
    .preview-column,
    .controls-column {
        flex: 0 0 auto;
        width: auto;
    }
    .lightness-bar {
        margin-left: 0;
    }
    .value-box {
        flex-basis: calc(50% - 4px);
    }
}
