/* Color Picker / Palette Extractor Styles */

/* Main Workspace */
.color-picker-workspace {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    padding: 20px;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 16px;
    position: relative;
}

/* Image Section */
.image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-wrapper {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    border-radius: 8px;
    overflow: hidden;
    background: repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

#image-canvas {
    display: block;
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
}

.picker-hint {
    margin-top: 12px;
    color: #888;
    font-size: 14px;
}

.picker-hint i {
    margin-right: 5px;
    color: var(--primary-color);
}

/* Color Cursor */
.color-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 10;
}

/* Zoom Lens */
.zoom-lens {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid #fff;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 20;
}

#zoom-canvas {
    display: block;
    image-rendering: pixelated;
}

.zoom-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

/* Color Panel */
.color-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Picked Color Section */
.picked-color-section,
.palette-section {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 15px;
}

.picked-color-section h5,
.palette-section h5 {
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
}

.picked-color-section h5 i,
.palette-section h5 i {
    margin-right: 8px;
}

/* Color Display */
.picked-color-display {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.color-swatch-large {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: #000;
    border: 2px solid #444;
    flex-shrink: 0;
}

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

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

.color-value-row label {
    width: 42px;
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

.color-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 5px 8px;
    color: #fff;
    font-family: monospace;
    font-size: 12px;
}

.copy-btn {
    background: transparent;
    border: 1px solid #444;
    border-radius: 6px;
    color: #888;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.copy-btn.copied {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

#add-to-palette-btn {
    width: 100%;
}

/* Palette Controls */
.palette-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #888;
}

.palette-controls label {
    white-space: nowrap;
}

.palette-controls input[type="range"] {
    flex: 1;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    appearance: none;
}

.palette-controls input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

/* Color Palette Grid */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
}

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

.palette-color:hover {
    transform: scale(1.1);
    border-color: #fff;
    z-index: 5;
}

.palette-color.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.palette-color .remove-color {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ff4444;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.palette-color:hover .remove-color {
    display: flex;
}

.empty-palette-hint {
    color: #666;
    font-size: 12px;
    font-style: italic;
    margin: 0;
    padding: 10px;
    text-align: center;
    width: 100%;
}

/* Palette Actions */
.palette-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.palette-actions .btn {
    flex: 1;
    font-size: 12px;
}

/* Upload Area */ 

/* Format Cards */
.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.format-card {
    background: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #3a3a3a;
}

.format-card h4 {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 8px;
}

.format-card p {
    color: #888;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.format-card code {
    background: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #4CAF50;
}

/* Close Button */
#editor-container {
    position: relative;
}

#editor-container .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

#editor-container .btn-close:hover {
    background: rgba(255, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 992px) {
    .color-picker-workspace {
        grid-template-columns: 1fr;
    }
    
    .color-panel {
        order: -1;
    }
    
    .picked-color-display {
        flex-direction: column;
        align-items: center;
    }
    
    .color-swatch-large {
        width: 100px;
        height: 100px;
    }
    
    .color-values {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .color-picker-workspace {
        padding: 15px;
    }
    
    .palette-color {
        width: 35px;
        height: 35px;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .upload-icon {
        font-size: 48px;
    }
    
    .formats-grid {
        grid-template-columns: 1fr;
    }
}
