/* ============================================================
   contrast-checker / style.css
   Prefix: cc-
   ============================================================ */

.cc-container {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Section Cards --- */
.cc-section {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border: 1px solid #eee;
    margin-bottom: 16px;
}

.cc-section-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

/* --- Color Panels Row --- */
.cc-panels-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.cc-color-panel {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    background: #fafafa;
    min-width: 0;
}

.cc-panel-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.cc-fg-panel .cc-panel-label {
    color: #005fa3;
}

.cc-bg-panel .cc-panel-label {
    color: #7b4f00;
}

/* Picker row */
.cc-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cc-picker-row input[type="color"] {
    width: 44px;
    height: 44px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: none;
    flex-shrink: 0;
}

.cc-color-swatch {
    flex: 1;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: background-color 0.15s;
}

/* HEX input */
.cc-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cc-input-row label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    width: 28px;
    flex-shrink: 0;
}

.cc-input-row input[type="text"] {
    flex: 1;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    padding: 5px 8px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    min-width: 0;
    transition: border-color 0.2s;
}

.cc-input-row input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* RGB inputs */
.cc-rgb-row {
    display: flex;
    gap: 6px;
}

.cc-rgb-row>div {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.cc-rgb-row label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    width: 14px;
    flex-shrink: 0;
}

.cc-rgb-row input[type="number"] {
    flex: 1;
    font-size: 12px;
    padding: 4px 4px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    min-width: 0;
    text-align: center;
    -moz-appearance: textfield;
    transition: border-color 0.2s;
}

.cc-rgb-row input[type="number"]::-webkit-inner-spin-button,
.cc-rgb-row input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.cc-rgb-row input[type="number"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* Swap button */
.cc-swap-btn {
    display: block;
    width: 100%;
    padding: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    background: #f0f0f0;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}

.cc-swap-btn:hover {
    background: #e4e4e4;
    border-color: #ccc;
}

/* --- Preview --- */
.cc-preview-box {
    padding: 24px 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: background-color 0.15s, color 0.15s;
    min-height: 90px;
}

.cc-preview-normal {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 6px;
    outline: none;
}

.cc-preview-large {
    font-size: 24px;
    line-height: 1.4;
    margin-bottom: 4px;
    outline: none;
}

.cc-preview-bold {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    outline: none;
}

.cc-preview-label {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 10px;
    font-style: italic;
}

/* --- Contrast Ratio Display --- */
.cc-ratio-display {
    text-align: center;
    margin-bottom: 18px;
}

.cc-ratio-big {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    color: #222;
}

.cc-ratio-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

/* Ratio bar */
.cc-ratio-bar {
    height: 10px;
    border-radius: 5px;
    background: #eee;
    position: relative;
    overflow: visible;
    margin: 14px 0;
}

.cc-ratio-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease, background-color 0.3s;
    max-width: 100%;
}

.cc-ratio-markers {
    position: relative;
    height: 20px;
    margin-top: 4px;
}

.cc-ratio-marker {
    position: absolute;
    font-size: 10px;
    color: #aaa;
    transform: translateX(-50%);
    white-space: nowrap;
}

.cc-ratio-marker::before {
    content: '|';
    display: block;
    text-align: center;
    color: #ccc;
}

/* Judgement grid */
.cc-judge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cc-judge-item {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1.5px solid #eee;
    background: #fafafa;
}

.cc-judge-level {
    font-size: 10px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
}

.cc-judge-name {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

.cc-judge-threshold {
    font-size: 11px;
    color: #aaa;
    font-family: monospace;
    margin-bottom: 4px;
}

.cc-judge-verdict {
    font-size: 14px;
    font-weight: 700;
}

.cc-judge-item.cc-pass {
    border-color: #acf2bd;
    background: #f0fff4;
}

.cc-judge-item.cc-fail {
    border-color: #fdb8c0;
    background: #fff5f5;
}

.cc-result-pass {
    color: #22863a;
}

.cc-result-fail {
    color: #cb2431;
}

/* --- Suggestions --- */
.cc-suggestion {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 14px 16px;
}

.cc-suggestion-title {
    font-size: 13px;
    font-weight: 700;
    color: #795548;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-suggestion-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #f0e0a0;
}

.cc-suggestion-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.cc-suggestion-info {
    flex: 1;
    min-width: 0;
}

.cc-suggestion-hex {
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.cc-suggestion-meta {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}

.cc-suggestion-apply {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.cc-suggestion-apply:hover {
    background: #0056d6;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .cc-panels-row {
        flex-direction: column;
    }

    .cc-ratio-big {
        font-size: 32px;
    }

    .cc-judge-grid {
        grid-template-columns: 1fr;
    }
}