/* Color Picker Tool Styles */

/* Tool Description Center Alignment */
.tool-description {
    text-align: center;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Main Tool Container */
.tool-container.main-tool-bordered {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background: var(--background-color);
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 2rem;
    margin: 0 auto;
    max-width: 1200px;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--background-color);
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* Color Picker Section */
.color-picker-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.color-picker-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.color-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.color-input-group input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--background-color);
    color: var(--text-primary);
}

.color-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#colorPicker {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: none;
}

#colorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

#colorPicker::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

/* Color Display Section */
.color-display-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.color-display-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 10px;
}

.color-swatch {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid var(--background-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: transform 0.3s ease;
}

.color-swatch:hover {
    transform: scale(1.05);
}

.color-info {
    flex: 1;
}

.color-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.color-values {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Image Picker Section */
.image-picker-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.image-picker-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-color);
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.05);
}

.image-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.05);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-secondary);
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.image-preview-container {
    margin-top: 1rem;
    text-align: center;
}

#imageCanvas {
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    cursor: crosshair;
}

.extracted-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.extracted-color {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--background-color);
    box-shadow: 0 2px 6px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.extracted-color:hover {
    transform: scale(1.1);
}

.extracted-color::after {
    content: attr(data-color);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--background-color);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.extracted-color:hover::after {
    opacity: 1;
}

/* Palette Section */
.palette-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.palette-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.palette-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.palette-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--background-color);
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.palette-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.palette-btn:active {
    transform: translateY(0);
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.palette-color {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 3px solid var(--background-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.palette-color:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.palette-color::after {
    content: attr(data-color);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: var(--background-color);
    padding: 0.5rem;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.palette-color:hover::after {
    transform: translateY(0);
}

/* Color Tools Section */
.color-tools-section {
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.color-tools-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.tool-btn {
    padding: 1rem;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.tool-btn:hover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.tool-btn:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .color-inputs {
        grid-template-columns: 1fr;
    }
    
    .color-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .palette-controls {
        flex-direction: column;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .color-palette {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.5rem;
        margin: 0 0.5rem;
    }
    
    .color-picker-section,
    .color-display-section,
    .image-picker-section,
    .palette-section,
    .color-tools-section {
        padding: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .color-palette {
        grid-template-columns: repeat(2, 1fr);
    }
} 