/* Color Picker Tool Styles */

.color-picker {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Main Layout */
.color-picker-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Picker Section */
.picker-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.picker-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Color Picker Main */
.picker-section {
    grid-column: 1 / -1;
}

.color-picker-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.color-canvas-container {
    position: relative;
    width: 300px;
    height: 300px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

#colorCanvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    display: block;
}

.color-cursor {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%);
}

/* Hue Slider */
.hue-slider-container {
    position: relative;
    width: 300px;
    height: 30px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

#hueCanvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
}

.hue-cursor {
    position: absolute;
    width: 4px;
    height: 34px;
    background: white;
    border: 1px solid #333;
    border-radius: 2px;
    top: -2px;
    pointer-events: none;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Alpha Slider */
.alpha-slider-container {
    position: relative;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), 
                linear-gradient(-45deg, #ccc 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #ccc 75%), 
                linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

#alphaCanvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
}

.alpha-cursor {
    position: absolute;
    width: 4px;
    height: 24px;
    background: white;
    border: 1px solid #333;
    border-radius: 2px;
    top: -2px;
    pointer-events: none;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Input Section */
.input-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.input-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.input-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rgb-inputs, .hsl-inputs, .hsv-inputs {
    display: flex;
    gap: 8px;
}

.rgb-inputs input, .hsl-inputs input, .hsv-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* Preview Section */
.preview-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.preview-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.color-swatch {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), 
                linear-gradient(-45deg, #ccc 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #ccc 75%), 
                linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

.color-info {
    margin-top: 15px;
}

.color-values {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.value-item .label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    min-width: 40px;
}

/* Palette Section */
.palette-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.palette-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.palette-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    min-height: 50px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}

/* Presets Section */
.presets-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.presets-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.preset-colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.preset-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}



/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.input-group input[type="text"], .input-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.input-row input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-row span {
    font-size: 12px;
    color: #6b7280;
    min-width: 20px;
    text-align: center;
}

/* Copy Buttons */
.copy-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.copy-btn:active {
    background: #d1d5db;
}

.copy-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}





.palette-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.palette-color:hover {
    transform: scale(1.1);
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.palette-color.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Palette Actions */
.palette-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    border: 1px solid;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.message.error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.message.info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* Responsive Design */
@media (max-width: 768px) {
    .color-picker-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .picker-section,
    .controls-section {
        padding: 20px;
    }
    
    .color-canvas-container {
        height: 250px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .input-row input {
        width: 100%;
    }
    
    .palette-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .color-picker {
        padding: 15px;
    }
    
    .picker-section,
    .controls-section {
        padding: 15px;
    }
    
    .color-canvas-container {
        height: 200px;
    }
    
    .palette-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .palette-color {
        width: 35px;
        height: 35px;
    }
}
