/**
 * Color Science - Contrast Checker
 */

.color-checker {
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    max-width: 580px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface-primary, #ffffff);
    border-radius: 16px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.color-inputs {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.color-input-group {
    flex: 1;
    min-width: 140px;
}

.color-input-group label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary, #888);
    margin-bottom: 0.4rem;
}

.color-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border, #ddd);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}

.color-hex {
    width: 90px;
    height: 40px;
    border: 2px solid var(--border, #ddd);
    border-radius: 8px;
    padding: 0 0.5rem;
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    font-size: 0.9rem;
    color: var(--text-primary, #1d1d1f);
}

.color-swap {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    background: var(--surface-secondary, #f5f5f7);
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary, #666);
    transition: all 0.15s ease;
}

.color-swap:hover {
    background: var(--surface-primary, #fff);
    border-color: var(--accent, #2563eb);
}

.color-preview {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
}

.preview-large {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.preview-normal {
    font-size: 1rem;
    line-height: 1.6;
}

.ratio-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ratio-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    color: var(--text-primary, #1d1d1f);
}

.ratio-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ratio-badge.pass-aaa { background: #dcfce7; color: #166534; }
.ratio-badge.pass-aa { background: #dbeafe; color: #1e40af; }
.ratio-badge.pass-large { background: #fef9c3; color: #854d0e; }
.ratio-badge.fail { background: #fee2e2; color: #991b1b; }

.wcag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.wcag-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.wcag-pass {
    background: #f0fdf4;
    color: #166534;
}

.wcag-fail {
    background: #fef2f2;
    color: #991b1b;
}

.wcag-icon {
    font-weight: 700;
}

@media (max-width: 600px) {
    .color-checker {
        padding: 1.25rem;
        margin: 1rem auto;
    }
    .color-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    .color-swap {
        align-self: center;
    }
    .wcag-grid {
        grid-template-columns: 1fr;
    }
}
