/* Component-specific styles */

/* Export Modal Components */
.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.export-format h4,
.export-preview h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.format-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.format-options label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.format-options input[type="radio"] {
    accent-color: var(--primary-color);
}

.export-preview pre {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Upload Modal Components */
.upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3xl);
    text-align: center;
    transition: border-color var(--transition-fast);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: var(--bg-tertiary);
}

.upload-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.upload-area p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.image-preview {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.extracted-colors {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.extracted-color {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: transform var(--transition-fast);
    position: relative;
}

.extracted-color:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.extracted-color.selected {
    border-color: var(--primary-color);
    border-width: 3px;
}

.extracted-color::after {
    content: attr(data-color);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--font-size-xs);
    font-family: var(--font-family-mono);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Saved Palette Card */
.saved-palette-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.saved-palette-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.saved-palette-preview {
    display: flex;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.saved-palette-color {
    flex: 1;
    min-width: 0;
}

.saved-palette-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-palette-name {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.saved-palette-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.saved-palette-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.saved-palette-actions .btn {
    padding: var(--spacing-xs);
    min-width: 32px;
    min-height: 32px;
    font-size: var(--font-size-sm);
}

/* Accessibility Components */
.accessibility-content {
    display: grid;
    gap: var(--spacing-xl);
}

.contrast-check {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.contrast-check h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.contrast-pairs {
    display: grid;
    gap: var(--spacing-md);
}

.contrast-pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--bg-tertiary);
}

.contrast-colors {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.contrast-color-sample {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
}

.contrast-text {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.contrast-ratio {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.contrast-value {
    font-family: var(--font-family-mono);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.contrast-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
}

.contrast-badge.pass {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contrast-badge.fail {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.contrast-badge.aa {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.contrast-badge.aaa {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* Color Blindness Simulation */
.colorblind-simulation {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.colorblind-simulation h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.simulation-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.simulation-tab {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.simulation-tab:hover {
    color: var(--text-primary);
}

.simulation-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.simulation-palette {
    display: flex;
    gap: var(--spacing-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.simulation-color {
    flex: 1;
    height: 80px;
    position: relative;
}

.simulation-color::after {
    content: attr(data-original);
    position: absolute;
    bottom: var(--spacing-xs);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--font-size-xs);
    font-family: var(--font-family-mono);
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Color Picker Enhancements */
.color-picker-advanced {
    position: relative;
}

.color-picker-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: var(--z-dropdown);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    display: none;
}

.color-picker-popup.active {
    display: block;
}

.color-wheel-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto var(--spacing-lg);
}

.color-wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    cursor: crosshair;
}

.color-wheel-pointer {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--white);
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.color-sliders {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.color-slider-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.color-slider-label {
    min-width: 24px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

.color-slider {
    flex: 1;
    height: 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.color-slider-value {
    min-width: 32px;
    text-align: right;
    font-size: var(--font-size-sm);
    font-family: var(--font-family-mono);
    color: var(--text-primary);
}

/* Algorithm Examples */
.algorithm-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.algorithm-example {
    text-align: center;
}

.algorithm-example h4 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.algorithm-preview {
    display: flex;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
}

.algorithm-preview-color {
    flex: 1;
}

.algorithm-description {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: var(--line-height-relaxed);
}

/* Palette History */
.palette-history {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.palette-history h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.history-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.history-item:hover {
    background-color: var(--bg-tertiary);
}

.history-palette {
    display: flex;
    width: 120px;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.history-color {
    flex: 1;
}

.history-info {
    flex: 1;
}

.history-algorithm {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.history-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Responsive Design Helpers */
@media (max-width: 768px) {
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .algorithm-examples {
        grid-template-columns: 1fr;
    }
    
    .contrast-pair {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .contrast-ratio {
        align-self: flex-end;
    }
    
    .simulation-tabs {
        flex-wrap: wrap;
    }
    
    .color-wheel-container {
        width: 160px;
        height: 160px;
    }
}