.color-picker-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.picker-workspace {
    flex: 1;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    min-height: 500px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.picker-workspace.drag-over {
    background: #e0f2fe;
    border-color: var(--primary-blue);
}

.picker-workspace.has-image {
    background: transparent;
    border: none;
    align-items: center;
    overflow: auto;
}

.upload-section {
    padding: 40px;
    text-align: center;
    width: 100%;
}

.upload-placeholder {
    cursor: pointer;
    padding: 40px;
    border-radius: 12px;
    transition: transform 0.2s;
}

.upload-placeholder:hover {
    transform: translateY(-2px);
}

.canvas-wrapper {
    position: relative;
    max-width: 100%;
    margin: 20px;
    cursor: crosshair;
}

#sourceCanvas {
    max-width: 100%;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Magnifier */
.magnifier {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    pointer-events: none;
    /* Let mouse events pass through */
    display: none;
    z-index: 100;
    background-repeat: no-repeat;
    background-color: white;
    /* Crosshair in the middle */
}

.magnifier::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.picker-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.panel-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.panel-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Current Color Panel */
.color-preview-large {
    height: 80px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.color-row .label {
    width: 40px;
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

.value-group {
    flex: 1;
    display: flex;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
}

.value-group input {
    flex: 1;
    border: none;
    padding: 8px 10px;
    font-family: monospace;
    font-size: 0.95rem;
    color: #334155;
    outline: none;
}

.value-group .btn-copy {
    background: #f1f5f9;
    border: none;
    padding: 0 12px;
    cursor: pointer;
    color: #64748b;
    border-left: 1px solid #cbd5e1;
    transition: all 0.2s;
}

.value-group .btn-copy:hover {
    background: #e2e8f0;
    color: var(--primary-blue);
}

.hint-text {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Saved Colors */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-clear:hover {
    color: #ef4444;
}

.saved-colors-panel .panel-header {
    margin-bottom: 10px;
}

.saved-colors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.saved-color-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-color-item:hover {
    background: #f1f5f9;
    border-color: var(--primary-blue);
    transform: translateX(2px);
}

.mini-color-box {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.saved-color-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.saved-color-hex {
    font-weight: 700;
    color: #334155;
    font-family: monospace;
    font-size: 1rem;
}

.saved-color-rgb {
    font-size: 0.8rem;
    color: #64748b;
}

/* File Actions */
.file-actions-panel {
    text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
    .color-picker-layout {
        flex-direction: column;
    }

    .picker-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .panel-card {
        flex: 1;
        min-width: 250px;
    }
}