/* ==========================================================================
   PSDreviews — Contrast Checker (WCAG) — 3-Column Layout
   ========================================================================== */

.cc-wrap {
    border-radius: 18px;
    background: #f8f8fb;
    box-shadow: 0 4px 32px rgba(13, 14, 20, 0.08), 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* ── Three-column main grid ──────────────────────────────────────────────── */

.cc-main-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr 0.95fr;
    gap: 1.25rem;
    padding: 1.5rem;
    align-items: stretch;
}

/* ── Panel card (shared) ─────────────────────────────────────────────────── */

.cc-panel {
    background: #fff;
    border: 1.5px solid #e0e4ed;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Panel heading ───────────────────────────────────────────────────────── */

.cc-panel-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1a2e;
}

.cc-info-icon {
    display: inline-flex;
    align-items: center;
    color: #aaa;
    cursor: help;
    flex-shrink: 0;
}

.cc-info-icon:hover { color: #006ab8; }

/* ═══════════════════════════════════════════════════════════════════════════
   LEFT PANEL — Colour Inputs
   ═══════════════════════════════════════════════════════════════════════════ */

.cc-panel--inputs {
    gap: 0.75rem;
}

.cc-colour-block {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cc-colour-block__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* ── Color row: swatch | hex input | edit button ─────────────────────────── */

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

/* Hidden native picker — triggered programmatically */
.cc-color-picker-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Visible colour swatch */
.cc-color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.10);
    cursor: pointer;
    flex-shrink: 0;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.cc-color-swatch:hover {
    border-color: #006ab8;
    box-shadow: 0 0 0 3px rgba(0,106,184,0.18);
}

/* Hex text input */
.cc-hex-input {
    flex: 1;
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 0.6rem 0.75rem;
    min-width: 0;
}

/* Pencil edit button */
.cc-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f5f6fa;
    border: 1.5px solid #e0e4ed;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cc-edit-btn:hover {
    background: #eff7ff;
    border-color: #006ab8;
    color: #006ab8;
}

/* ── Mini preview ────────────────────────────────────────────────────────── */

.cc-mini-preview-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
}

.cc-mini-preview {
    border: 1.5px solid #e0e4ed;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.55;
    transition: background-color 0.25s, color 0.25s;
    min-height: 52px;
}

/* ── Swap divider ────────────────────────────────────────────────────────── */

.cc-swap-divider {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.1rem 0;
}

.cc-swap-divider::before,
.cc-swap-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e4ed;
}

.cc-swap-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    background: #fff;
    border: 1.5px solid #d0d5e8;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.cc-swap-btn:hover {
    border-color: #006ab8;
    color: #006ab8;
    background: #f0f7ff;
}

.cc-swap-btn:active { transform: scale(0.96); }

/* ═══════════════════════════════════════════════════════════════════════════
   CENTRE PANEL — Ratio + Progress Bar
   ═══════════════════════════════════════════════════════════════════════════ */

.cc-panel--ratio {
    align-items: stretch;
}

/* Ratio number + verdict */
.cc-ratio-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1.25rem 1rem;
    border-radius: 14px;
    background: #f4f5ff;
    text-align: center;
    transition: background 0.25s;
}

.cc-ratio--aaa      { background: #dcfce7; }
.cc-ratio--aa       { background: #d1fae5; }
.cc-ratio--aa-large { background: #fef9c3; }
.cc-ratio--fail     { background: #fee2e2; }

.cc-ratio-num {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: "Fira Code", "Courier New", monospace;
    color: #1a1a2e;
    line-height: 1;
    letter-spacing: -0.03em;
}

.cc-ratio-verdict {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 0.22rem 0.75rem;
    border-radius: 999px;
    margin-top: 0.25rem;
    line-height: 1;
}

.cc-ratio-verdict--perfect { background: #dcfce7; color: #15803d; }
.cc-ratio-verdict--great   { background: #bbf7d0; color: #166534; }
.cc-ratio-verdict--good    { background: #fef9c3; color: #854d0e; }
.cc-ratio-verdict--fail    { background: #fee2e2; color: #b91c1c; }

/* Description text */
.cc-ratio-desc {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.55;
    margin: 0;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */

.cc-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: auto; /* push to bottom of panel */
}

.cc-progress-track {
    position: relative;
    height: 10px;
    background: #eef0fb;
    border-radius: 999px;
    overflow: visible;
}

.cc-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease, background 0.25s;
    background: #d1d5db;
    position: relative;
    z-index: 1;
}

.cc-progress-fill--aaa   { background: linear-gradient(90deg, #22c55e, #16a34a); }
.cc-progress-fill--aa    { background: linear-gradient(90deg, #4ade80, #22c55e); }
.cc-progress-fill--large { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.cc-progress-fill--fail  { background: linear-gradient(90deg, #f87171, #ef4444); }

.cc-progress-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 16px;
    background: rgba(0,0,0,0.14);
    border-radius: 1px;
    z-index: 2;
}

.cc-progress-marker__label {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
    color: #888;
    pointer-events: none;
}

.cc-progress-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    font-weight: 600;
    color: #aaa;
    margin-top: 1.2rem;
    padding: 0 1px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RIGHT PANEL — Compliance Results
   ═══════════════════════════════════════════════════════════════════════════ */

.cc-panel--results {
    gap: 0.75rem;
}

.cc-results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cc-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1.5px solid #f0f1fb;
    background: #fafafa;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s, background 0.2s;
    cursor: default;
}

.cc-result-row:last-child { margin-bottom: 0; }

.cc-result-row--pass {
    border-color: #86efac;
    background: #f0fdf4;
}

.cc-result-row--fail {
    border-color: #fca5a5;
    background: #fff5f5;
}

.cc-result-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cc-result-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a1a2e;
}

.cc-result-min {
    font-size: 0.68rem;
    font-weight: 600;
    font-family: "Fira Code", "Courier New", monospace;
    color: #aaa;
}

.cc-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BELOW GRID — Colour Detail + Auto-fix
   ═══════════════════════════════════════════════════════════════════════════ */

.cc-below-sections {
    background: #fff;
    border-top: 1.5px solid #e0e4ed;
    padding: 1.5rem;
}

.cc-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin: 0 0 0.9rem;
    padding: 0;
}

/* ── Colour detail cards ─────────────────────────────────────────────────── */

.cc-lum-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cc-lum-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: #f9f9ff;
    border: 1.5px solid #eef0fb;
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.cc-lum-swatch {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    flex-shrink: 0;
}

.cc-lum-detail { flex: 1; min-width: 0; }

.cc-lum-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #aaa;
    margin-bottom: 0.2rem;
}

.cc-lum-value {
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a2e;
}

.cc-lum-meta {
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.72rem;
    color: #999;
}

/* ── Auto-fix panel ──────────────────────────────────────────────────────── */

.cc-fix-panel {
    padding: 1.25rem 1.5rem;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    animation: cc-fadein 0.3s ease;
    margin-top: 0.5rem;
}

@keyframes cc-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

.cc-fix-desc {
    font-size: 0.88rem;
    color: #78350f;
    margin: 0 0 1rem;
}

.cc-fix-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.cc-fix-swatch {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.cc-fix-info { flex: 1; }

.cc-fix-hex {
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.2rem;
}

.cc-fix-ratio {
    font-size: 0.82rem;
    color: #15803d;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.cc-fix-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.cc-apply-btn {
    padding: 0.5rem 1rem;
    background: #0d0e14;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cc-apply-btn:hover { background: #c8001c; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet: collapse to 1 column with left panel row-of-two */
@media (max-width: 820px) {
    .cc-main-grid {
        grid-template-columns: 1fr;
        padding: 1.25rem;
        gap: 1rem;
    }

    /* On tablet, put FG and BG blocks side-by-side inside left panel */
    .cc-panel--inputs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        align-items: start;
    }

    /* Swap divider spans both columns */
    .cc-swap-divider {
        grid-column: 1 / -1;
        margin: 0;
    }

    .cc-colour-block:last-child {
        grid-column: auto;
    }
}

/* Large phone: single column everywhere */
@media (max-width: 600px) {
    .cc-main-grid { padding: 1rem; gap: 0.9rem; }

    .cc-panel--inputs {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .cc-ratio-num { font-size: 2.2rem; }

    .cc-lum-row { grid-template-columns: 1fr; }

    .cc-progress-scale { display: none; }

    .cc-below-sections { padding: 1.25rem; }
}

/* Small phone */
@media (max-width: 420px) {
    .cc-main-grid { padding: 0.85rem; }
    .cc-ratio-num { font-size: 1.9rem; }
    .cc-fix-row { flex-direction: column; }
    .cc-fix-swatch { width: 100%; height: 52px; border-radius: 10px; }
    .cc-fix-actions { flex-direction: column; }
    .cc-apply-btn, .cc-fix-actions .psdt-copy-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .cc-lum-card { flex-direction: column; }
    .cc-lum-swatch { width: 100%; height: 52px; }
}
