.color-picker-popup {
    position: absolute;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 300px;
    font-family: system-ui, -apple-system, sans-serif;
}

.color-picker-popup.hidden {
    display: none;
}

/* Saturation/Value Area */
.color-picker-sv-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    touch-action: none;
    user-select: none;
    cursor: crosshair;
}

.color-picker-sv-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 0.375rem;
    border: 1px solid #e5e5e5;
    /* Gradient will be set dynamically or via inline style */
}

.color-picker-sv-handle {
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    border: 4px solid white;
    box-shadow: 0 0 0 1px #e5e5e5;
    cursor: grab;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Let clicks pass through to wrapper */
}

/* Hue Slider */
.color-picker-hue-wrapper {
    position: relative;
    height: 0.75rem;
    width: 100%;
    border-radius: 9999px;
    border: 1px solid #e5e5e5;
    touch-action: none;
    user-select: none;
    cursor: pointer;
    background: linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0));
}

.color-picker-hue-handle {
    position: absolute;
    top: 50%;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 9999px;
    border: 4px solid white;
    box-shadow: 0 0 0 1px #d1d1d1;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Inputs Area */
.color-picker-inputs-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-preview {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
    border: 1px solid #e5e5e5;
}

.color-picker-inputs-group {
    display: flex;
    flex: 1;
    gap: 0.5rem;
}

.color-picker-input-label {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 0.375rem;
    overflow: hidden;
    flex: 1;
}

.color-picker-input-label span {
    padding: 0 0.5rem;
    background-color: #f9fafb;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    height: 100%;
    border-right: 1px solid #e5e5e5;
}

.color-picker-input {
    width: 100%;
    min-width: 0;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    outline: none;
}

.color-picker-input:focus {
    background-color: #f0f9ff;
}
