/* Color Contrast Checker - Page Styles */

.contrast-checker-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 15px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
}

.checker-container {
    background: var(--background-secondary);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
}

/* Preview + Controls + Result Layout */
.checker-container > * {
    margin-bottom: 20px;
}

.checker-container > *:last-child {
    margin-bottom: 0;
}

/* Preview Section */
.preview-section {
    background: var(--background);
    border-radius: var(--radius);
    padding: 20px;
}

.preview-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.preview-box {
    padding: 30px 25px;
    border-radius: var(--radius);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.preview-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

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

.preview-text.small {
    font-size: 0.9rem;
    color: inherit;
    opacity: 0.9;
}

.preview-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    margin-right: 10px;
}

.preview-link {
    text-decoration: underline;
    font-weight: 500;
}

.preview-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.info-badge {
    background: var(--background-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.info-badge strong {
    color: var(--text-primary);
    font-family: 'Monaco', 'Consolas', monospace;
    margin-left: 4px;
}

/* Color Controls - MIDDLE */
.color-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .color-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.color-selector {
    background: var(--background);
    border-radius: var(--radius);
    padding: 18px;
}

.color-selector h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

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

.color-picker-wrapper {
    flex-shrink: 0;
}

.native-color-picker {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    background: none;
}

.native-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: calc(var(--radius-sm) - 2px);
}

.native-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
}

.native-color-picker::-moz-color-swatch {
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
}

.color-input-group {
    display: flex;
    gap: 8px;
    flex: 1;
}

.color-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
    text-transform: uppercase;
    background: var(--background);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.color-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.color-type-btn {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    background: var(--background);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
    white-space: nowrap;
}

.color-type-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.color-type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Alpha Slider */
.alpha-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--background-secondary);
    border-radius: var(--radius-sm);
}

.alpha-slider label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 55px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, transparent, currentColor);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: none;
}

.alpha-value {
    min-width: 38px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Preset Colors */
.preset-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.preset-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.preset-color:hover {
    transform: scale(1.12);
    border-color: var(--primary-color);
}

/* Result Section - Compact */
.result-section.result-compact {
    background: var(--background);
    border-radius: var(--radius);
    padding: 20px;
}

.result-section.result-compact h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.contrast-ratio-display {
    text-align: center;
    margin-bottom: 15px;
}

.contrast-ratio {
    font-size: 3rem;
    font-weight: 700;
    margin: 8px 0;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.ratio-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 5px;
}

.wcag-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.wcag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--background-secondary);
    text-align: left;
}

.wcag-item.pass {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.wcag-item.fail {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.wcag-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.wcag-item.pass .wcag-icon {
    background: #22c55e;
    color: white;
}

.wcag-item.fail .wcag-icon {
    background: #ef4444;
    color: white;
}

.wcag-info {
    flex: 1;
}

.wcag-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.wcag-threshold {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.wcag-item.pass .wcag-threshold {
    color: #22c55e;
}

.wcag-item.fail .wcag-threshold {
    color: #ef4444;
}

/* Suggestions */
.suggestions {
    margin-top: 15px;
    padding: 15px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-sm);
    display: none;
    text-align: left;
}

.suggestions.show {
    display: block;
}

.suggestions h4 {
    margin-bottom: 8px;
    color: #f59e0b;
    font-size: 1rem;
}

.suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestion-list li {
    padding: 6px 0;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.9rem;
}

.suggestion-list li:before {
    content: "• ";
    color: #f59e0b;
}

/* Info Section */
.info-section {
    margin-top: 35px;
}

.info-section h3 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 25px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.info-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
}

.info-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    .contrast-checker-page {
        padding: 20px 15px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .checker-container {
        padding: 18px;
    }
    
    .contrast-ratio {
        font-size: 2.2rem;
    }
    
    .preview-box {
        padding: 20px 15px;
    }
    
    .color-input-row {
        flex-wrap: wrap;
    }
    
    .color-picker-wrapper {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .color-input-group {
        width: 100%;
    }
    
    .wcag-results {
        grid-template-columns: 1fr 1fr;
    }
}
