/* Color Picker Styles - Consistent across all browsers and OS */

.color-picker-container {
    position: relative;
    display: inline-block;
}

.color-picker-preview {
    width: 60px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-picker-preview:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.color-picker-preview:active {
    transform: translateY(0);
}

.color-picker-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 16px;
    min-width: 280px;
}

.color-picker-area {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.color-picker-main {
    position: relative;
    width: 200px;
    height: 200px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
}

.color-picker-canvas {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.color-picker-cursor {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
    top: 0;
    left: 0;
}

.color-picker-hue {
    position: relative;
    width: 20px;
    height: 200px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
}

.color-picker-hue-cursor {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 4px;
    border: 2px solid white;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translateY(-50%);
    top: 0;
}

.color-picker-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-picker-hex {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    text-transform: uppercase;
    transition: border-color 0.2s;
}

.color-picker-hex:focus {
    outline: none;
    border-color: #667eea;
}

.color-picker-rgb {
    display: flex;
    gap: 8px;
}

.color-picker-rgb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-picker-rgb-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-align: center;
}

.color-picker-rgb-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.color-picker-rgb-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.color-picker-rgb-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.color-picker-rgb-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.color-picker-rgb-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Color-specific slider backgrounds */
.color-picker-rgb-item[data-channel="r"] .color-picker-rgb-slider {
    background: linear-gradient(to right, #000000, #ff0000);
}

.color-picker-rgb-item[data-channel="g"] .color-picker-rgb-slider {
    background: linear-gradient(to right, #000000, #00ff00);
}

.color-picker-rgb-item[data-channel="b"] .color-picker-rgb-slider {
    background: linear-gradient(to right, #000000, #0000ff);
}

.color-picker-rgb-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.color-picker-rgb-input::-webkit-outer-spin-button,
.color-picker-rgb-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.color-picker-rgb-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .color-picker-panel {
        left: auto;
        right: 0;
    }
    
    .color-picker-main {
        width: 180px;
        height: 180px;
    }
    
    .color-picker-hue {
        height: 180px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .color-picker-panel {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .color-picker-preview {
        border-color: #4a5568;
    }
    
    .color-picker-main,
    .color-picker-hue {
        border-color: #4a5568;
    }
    
    .color-picker-hex,
    .color-picker-rgb-input {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .color-picker-rgb-item label {
        color: #a0aec0;
    }
    
    .color-picker-rgb-slider {
        background: #4a5568 !important;
    }
    
    .color-picker-rgb-slider::-webkit-slider-thumb,
    .color-picker-rgb-slider::-moz-range-thumb {
        background: #667eea;
        border-color: #2d3748;
    }
}

