@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Reset & Wrapper ── */
.ccomp-wrap {
    font-family: 'DM Sans', sans-serif;
    max-width: 900px;
    margin: 0 auto 48px;
    color: #1a1f2e;
    box-sizing: border-box;
}
.ccomp-wrap *, .ccomp-wrap *::before, .ccomp-wrap *::after {
    box-sizing: inherit;
}

/* ── Search Row ── */
.ccomp-search-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
}
.ccomp-search-box {
    position: relative;
}
.ccomp-search-label {
    display: block;
    margin-bottom: 8px;
}
.ccomp-school-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
}
.ccomp-pill--a {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1.5px solid #93c5fd;
}
.ccomp-pill--b {
    background: #fce7f3;
    color: #be185d;
    border: 1.5px solid #f9a8d4;
}
.ccomp-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 10px 8px 14px;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ccomp-search-box--a .ccomp-search-inner:focus-within {
    border-color: #2563eb;
    box-shadow: 0 4px 20px rgba(37,99,235,0.14);
}
.ccomp-search-box--b .ccomp-search-inner:focus-within {
    border-color: #db2777;
    box-shadow: 0 4px 20px rgba(219,39,119,0.13);
}
.ccomp-search-icon {
    color: #94a3b8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.ccomp-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    color: #1a1f2e;
    background: transparent;
    min-width: 0;
    padding: 4px 0;
}
.ccomp-input::placeholder { color: #94a3b8; }

.ccomp-clear-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.ccomp-clear-btn:hover { background: #e2e8f0; color: #1a1f2e; }

/* Chosen badge */
.ccomp-chosen-badge {
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ccomp-search-box--a .ccomp-chosen-badge {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.ccomp-search-box--b .ccomp-chosen-badge {
    background: #fdf2f8;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}
.ccomp-chosen-badge .ccomp-chosen-check { color: #22c55e; font-size: 15px; }

/* VS Badge */
.ccomp-vs-badge {
    align-self: center;
    margin-top: 28px;
    width: 46px;
    height: 46px;
    background: #0f172a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* ── Dropdown ── */
.ccomp-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 999;
}
.ccomp-dropdown-item {
    padding: 11px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    font-size: 14px;
    gap: 10px;
}
.ccomp-dropdown-item:last-child { border-bottom: none; }
.ccomp-dropdown-item:hover { background: #f8faff; }
.ccomp-dropdown-item strong { color: #1e3a8a; }
.ccomp-dropdown-item span { font-size: 12px; color: #64748b; flex-shrink: 0; }

/* ── Action Row ── */
.ccomp-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ccomp-compare-btn {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border: none;
    border-radius: 11px;
    padding: 13px 30px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s, opacity 0.2s;
}
.ccomp-compare-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15,23,42,0.35);
}
.ccomp-compare-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.ccomp-action-hint {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

@keyframes ccomp-spin { to { transform: rotate(360deg); } }
.ccomp-spin { animation: ccomp-spin 0.75s linear infinite; display: inline-flex; }

/* ── Error ── */
.ccomp-error {
    margin-bottom: 16px;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 14px 18px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
}

/* ── Results Table ── */
@keyframes ccomp-fadeup {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ccomp-results {
    animation: ccomp-fadeup 0.45s ease both;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 32px rgba(0,0,0,0.08);
}

/* Table header */
.ccomp-table-header {
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    background: #0f172a;
    padding: 20px 20px 20px 24px;
    gap: 12px;
    align-items: center;
}
.ccomp-th-metric { /* spacer */ }
.ccomp-th-school { text-align: center; }
.ccomp-th-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 50px;
    margin-bottom: 8px;
}
.ccomp-th--a .ccomp-pill--a { background: #1d4ed8; color: #fff; border-color: #3b82f6; }
.ccomp-th--b .ccomp-pill--b { background: #be185d; color: #fff; border-color: #ec4899; }
.ccomp-th-name {
    font-family: 'DM Serif Display', serif;
    font-size: 17px;
    color: #f8fafc;
    line-height: 1.25;
}
.ccomp-th-loc { font-size: 12px; color: #64748b; margin-top: 3px; }

/* Data rows */
.ccomp-row {
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    background: #fff;
    transition: background 0.15s;
}
.ccomp-row:last-of-type { border-bottom: none; }
.ccomp-row:hover { background: #f8faff; }
.ccomp-row--sub { background: #fafbfc; }
.ccomp-row--sub:hover { background: #f0f7ff; }
.ccomp-row--highlight { background: #f0fdf4; }
.ccomp-row--highlight:hover { background: #dcfce7; }

.ccomp-row-label {
    padding: 16px 12px 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-right: 1px solid #f1f5f9;
}
.ccomp-row-icon { font-size: 15px; margin-bottom: 2px; }
.ccomp-row-tip {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.35;
}
.ccomp-row-val {
    padding: 16px 20px;
    text-align: center;
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    color: #0f172a;
    position: relative;
    border-right: 1px solid #f1f5f9;
}
.ccomp-row-val:last-child { border-right: none; }
.ccomp-row-val .ccomp-val-sub {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    font-weight: 400;
}

/* Winner highlight */
.ccomp-win--a {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 8px;
    position: relative;
}
.ccomp-win--b {
    background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 8px;
    position: relative;
}
.ccomp-win-tag {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 50px;
    margin-top: 5px;
}
.ccomp-win--a .ccomp-win-tag { background: #1d4ed8; color: #fff; }
.ccomp-win--b .ccomp-win-tag { background: #be185d; color: #fff; }

/* ROI badge display */
.ccomp-roi-chip {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 50px;
}
.ccomp-roi--great { background: #dcfce7; color: #15803d; border: 1.5px solid #86efac; }
.ccomp-roi--good  { background: #dbeafe; color: #1d4ed8; border: 1.5px solid #93c5fd; }
.ccomp-roi--fair  { background: #fef9c3; color: #a16207; border: 1.5px solid #fde047; }
.ccomp-roi--poor  { background: #fee2e2; color: #b91c1c; border: 1.5px solid #fca5a5; }

/* Verdict Banner */
.ccomp-verdict {
    margin: 0;
    padding: 20px 28px;
    background: #0f172a;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.55;
    border-top: 2px solid #1e293b;
}
.ccomp-verdict strong { color: #fbbf24; }
.ccomp-verdict em { font-style: normal; color: #94a3b8; font-size: 13px; font-weight: 400; }

/* Attribution */
.ccomp-attribution {
    font-size: 11.5px;
    color: #94a3b8;
    text-align: center;
    padding: 14px 20px;
    margin: 0;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}
.ccomp-attribution a { color: #60a5fb; text-decoration: none; }
.ccomp-attribution a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 680px) {
    .ccomp-search-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .ccomp-vs-badge {
        margin: 0 auto;
        margin-top: 0;
        width: 38px; height: 38px;
        font-size: 11px;
    }
    .ccomp-table-header,
    .ccomp-row {
        grid-template-columns: 120px 1fr 1fr;
    }
    .ccomp-row-label { padding: 12px 8px 12px 12px; font-size: 11px; }
    .ccomp-row-tip { display: none; }
    .ccomp-row-val { font-size: 17px; padding: 12px 8px; }
    .ccomp-th-name { font-size: 14px; }
    .ccomp-verdict { font-size: 14px; padding: 16px 18px; }
}
