/* ========== Color Picker ========== */
.color-picker-popup {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    width: 240px;
    box-shadow: var(--shadow-lg);
    z-index: 10003;
    user-select: none;
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.color-picker-header span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.color-picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
}

.color-picker-close:hover {
    color: #fff;
}

/* ========== Saturation/Value Area ========== */
.color-saturation-area {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: var(--radius-sm);
    cursor: crosshair;
    overflow: hidden;
}

.color-saturation-area .sat-white {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.color-saturation-area .sat-black {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000, transparent);
}

.color-sat-cursor {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ========== Sliders ========== */
.color-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.color-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-slider-row label {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 12px;
    text-align: right;
}

.color-hue-slider,
.color-alpha-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 10px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.color-hue-slider {
    background: linear-gradient(to right,
        #f00 0%, #ff0 17%, #0f0 33%,
        #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}

.color-alpha-slider {
    background:
        linear-gradient(to right, transparent, var(--alpha-color, #000)),
        repeating-conic-gradient(#808080 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
}

.color-hue-slider::-webkit-slider-thumb,
.color-alpha-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ========== Color Inputs ========== */
.color-inputs {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.color-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.color-input-group label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.color-input-group input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 3px 4px;
    font-size: 11px;
    text-align: center;
    font-family: inherit;
}

.color-input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.color-hex-input {
    flex: 2;
}

/* ========== Mode Toggle ========== */
.color-mode-toggle {
    display: flex;
    gap: 2px;
    margin-top: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.color-mode-btn {
    flex: 1;
    padding: 3px 0;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.color-mode-btn.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========== Recent Colors ========== */
.color-recent {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.color-recent-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.color-recent-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.1s;
}

.color-swatch:hover {
    transform: scale(1.2);
    border-color: var(--text-muted);
}

/* ========== Eyedropper Button ========== */
.color-eyedropper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 6px;
    margin-top: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}

.color-eyedropper-btn:hover {
    background: var(--bg-hover);
    color: #fff;
}

/* ========== Color Trigger (in property panel) ========== */
.color-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
}

.color-trigger-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: repeating-conic-gradient(#808080 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
}

.color-trigger-swatch-inner {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.color-trigger-value {
    font-size: 11px;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ========== Preset Palettes ========== */
.color-presets {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.color-presets-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.color-preset-row {
    display: flex;
    gap: 3px;
    margin-bottom: 3px;
}
