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

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

/* ── Intro Banner ── */
.rbe-intro-banner {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 26px;
    color: #fff;
}
.rbe-intro-icon { font-size: 36px; flex-shrink: 0; line-height: 1; }
.rbe-intro-title {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    margin-bottom: 6px;
    color: #f8fafc;
}
.rbe-intro-sub { font-size: 14px; color: #94a3b8; line-height: 1.65; }

/* ── Search ── */
.rbe-search-section { margin-bottom: 22px; }
.rbe-search-wrap { position: relative; max-width: 680px; }
.rbe-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px 6px 6px 18px;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rbe-search-inner:focus-within {
    border-color: #2563eb;
    box-shadow: 0 4px 28px rgba(37,99,235,0.16);
}
.rbe-search-icon { color: #94a3b8; flex-shrink: 0; display: flex; align-items: center; }
.rbe-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'DM Sans', sans-serif;
    color: #1a1f2e;
    background: transparent;
    padding: 10px 0;
    min-width: 0;
}
.rbe-input::placeholder { color: #94a3b8; }
.rbe-search-btn {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}
.rbe-search-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,0.35); }

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

.rbe-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    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;
}
.rbe-dropdown-item {
    padding: 12px 18px;
    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;
}
.rbe-dropdown-item:last-child { border-bottom: none; }
.rbe-dropdown-item:hover { background: #eff6ff; }
.rbe-dropdown-item strong { color: #1e3a8a; }
.rbe-dropdown-item span { font-size: 12px; color: #64748b; flex-shrink: 0; }

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

/* ── Results ── */
@keyframes rbe-fadeup {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rbe-results { animation: rbe-fadeup 0.4s ease both; }

/* ── Style Picker ── */
.rbe-style-picker {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.rbe-style-label { font-size: 13px; font-weight: 700; color: #374151; }
.rbe-style-tabs  { display: flex; gap: 8px; flex-wrap: wrap; }
.rbe-style-tab {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.rbe-style-tab:hover, .rbe-style-tab--active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Preview ── */
.rbe-preview-section {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.rbe-preview-label {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}
.rbe-badge-preview { width: 100%; display: flex; justify-content: center; }

/* ────────────────────────────────────────────
   BADGE STYLES (also used by badge-renderer.js)
──────────────────────────────────────────── */

/* Shared badge base */
.rbe-badge {
    font-family: 'DM Sans', -apple-system, sans-serif;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    text-decoration: none !important;
    display: block;
    cursor: default;
    user-select: none;
}
.rbe-badge a, .rbe-badge a:visited { text-decoration: none; color: inherit; }

/* Logo mark */
.rbe-badge-logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.rbe-badge-logo--sm { width: 26px; height: 26px; font-size: 9px; border-radius: 6px; }

/* ── HORIZONTAL ── */
.rbe-badge--horizontal {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    max-width: 620px;
    width: 100%;
}
.rbe-badge-logo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 16px;
    background: #f8faff;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.rbe-badge-logo-text { font-size: 8px; font-weight: 700; color: #64748b; text-align: center; line-height: 1.3; }
.rbe-badge-divider { width: 1px; background: #e2e8f0; align-self: stretch; }
.rbe-badge-main-col { flex: 1; padding: 12px 16px; min-width: 0; }
.rbe-badge-school-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 15px;
    color: #0f172a;
    font-weight: 400;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rbe-badge-tier-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rbe-badge-tier-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 50px;
    white-space: nowrap;
}
.rbe-badge-years { font-size: 11px; color: #94a3b8; }
.rbe-badge-stat-col { padding: 12px 16px; text-align: center; border-left: 1px solid #f1f5f9; flex-shrink: 0; }
.rbe-badge-stat-val {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 2px;
}
.rbe-badge-stat-lbl { font-size: 9px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.rbe-badge-footer-col {
    padding: 12px 14px;
    text-align: center;
    border-left: 1px solid #f1f5f9;
    background: #f8faff;
    flex-shrink: 0;
}
.rbe-badge-verified { font-size: 10px; font-weight: 700; color: #15803d; margin-bottom: 2px; }
.rbe-badge-source { font-size: 9px; color: #94a3b8; }

/* ── CARD ── */
.rbe-badge--card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    max-width: 320px;
    width: 100%;
}
.rbe-card-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 18px 20px 16px;
    color: #fff;
}
.rbe-card-logo-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rbe-card-powered { font-size: 11px; font-weight: 700; color: #60a5fa; letter-spacing: 0.02em; }
.rbe-card-school {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 18px;
    color: #f8fafc;
    margin-bottom: 4px;
    font-weight: 400;
    line-height: 1.2;
}
.rbe-card-loc { font-size: 12px; color: #64748b; }
.rbe-card-score-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #f1f5f9;
}
.rbe-card-score-block { padding: 14px 16px; }
.rbe-card-score-block:first-child { border-right: 1px solid #f1f5f9; }
.rbe-card-score-label { font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.rbe-card-tier-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
}
.rbe-card-score-val {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    color: #0f172a;
}
.rbe-card-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid #f1f5f9;
}
.rbe-card-stat { padding: 12px 8px; text-align: center; border-right: 1px solid #f1f5f9; }
.rbe-card-stat:last-child { border-right: none; }
.rbe-card-stat-val {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 15px;
    color: #0f172a;
    margin-bottom: 3px;
}
.rbe-card-stat-lbl { font-size: 9px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.rbe-card-footer {
    padding: 10px 16px;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    background: #fafbfc;
}

/* ── MINIMAL ── */
.rbe-badge--minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    border-radius: 12px;
    padding: 12px 18px;
    max-width: 400px;
    width: 100%;
}
.rbe-min-icon { font-size: 24px; flex-shrink: 0; }
.rbe-min-content { flex: 1; min-width: 0; }
.rbe-min-tier {
    font-size: 12px;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.rbe-min-school { font-size: 14px; font-weight: 600; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbe-min-source { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.rbe-min-source-logo {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-radius: 6px;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rbe-min-source-text { font-size: 8px; color: #475569; text-align: center; font-weight: 600; line-height: 1.2; }

/* Tier chip colours (shared by all badge styles) */
.rbe-tier--high     { background: #dcfce7; color: #15803d; }
.rbe-tier--good     { background: #dbeafe; color: #1d4ed8; }
.rbe-tier--moderate { background: #fef9c3; color: #a16207; }
.rbe-tier--low      { background: #fee2e2; color: #b91c1c; }
.rbe-tier--unknown  { background: #f1f5f9; color: #64748b; }

/* ── Embed Section ── */
.rbe-embed-section {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}
.rbe-embed-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
}
.rbe-embed-tab {
    padding: 13px 22px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s, border-color 0.2s;
}
.rbe-embed-tab:hover { color: #1d4ed8; }
.rbe-embed-tab--active { color: #1d4ed8; border-bottom-color: #1d4ed8; }
.rbe-embed-tab-rec {
    background: #dcfce7;
    color: #15803d;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 50px;
}
.rbe-embed-panel { padding: 20px 22px; }
.rbe-embed-description { font-size: 13px; color: #64748b; margin-bottom: 14px; line-height: 1.6; }
.rbe-code-block { position: relative; }
.rbe-code {
    background: #0f172a;
    color: #7dd3fc;
    border-radius: 10px;
    padding: 18px 20px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    overflow-x: auto;
    margin: 0;
    white-space: pre;
}
.rbe-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
}
.rbe-copy-btn:hover { background: #334155; color: #e2e8f0; }

/* ── Value Props ── */
.rbe-value-props {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 8px;
}
.rbe-vp-item {
    background: #f8faff;
    border: 1.5px solid #e0e9ff;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rbe-vp-icon { font-size: 22px; }
.rbe-vp-text { font-size: 13px; color: #374151; line-height: 1.55; }
.rbe-vp-text strong { color: #1d4ed8; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .rbe-intro-banner { flex-direction: column; padding: 20px; }
    .rbe-badge--horizontal { flex-direction: column; align-items: flex-start; }
    .rbe-badge-logo-col { flex-direction: row; border-right: none; border-bottom: 1px solid #e2e8f0; width: 100%; }
    .rbe-badge-stat-col, .rbe-badge-footer-col { border-left: none; border-top: 1px solid #f1f5f9; }
    .rbe-value-props { grid-template-columns: 1fr; }
    .rbe-card-stats-row { grid-template-columns: 1fr 1fr; }
}
