/* ==========================================================================
   Data Quality - how the completeness badge is calculated
   Theme-safe: uses CSS variables throughout, no hardcoded light/dark colours.
   ========================================================================== */

/* ---- Hero ---------------------------------------------------------------- */
.dq-hero {
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    color: #fff;
    border-radius: var(--radius-xl, 16px);
    background: linear-gradient(135deg,
        var(--color-primary) 0%,
        var(--color-primary-hover) 100%);
    margin-bottom: 2rem;
}

.dq-hero-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl, 16px);
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 2.1rem;
}

.dq-hero-title {
    font-weight: 800;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    margin: 0 0 0.5rem;
}

.dq-hero-sub {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.55;
    opacity: 0.95;
}

/* ---- Section shell ------------------------------------------------------- */
.dq-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 14px);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.dq-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}

.dq-section-title i {
    color: var(--color-primary);
}

.dq-lead {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ---- Tier scale ---------------------------------------------------------- */
.dq-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
}

.dq-tier {
    text-align: center;
    padding: 1.1rem 0.75rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-color);
    background: var(--bg-card-soft, rgba(128, 128, 128, 0.05));
}

.dq-tier-dot {
    width: 42px;
    height: 42px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
}

.dq-tier--detailed  .dq-tier-dot { background: var(--color-success, #28a745); }
.dq-tier--good      .dq-tier-dot { background: var(--color-primary, #0d6efd); }
.dq-tier--needswork .dq-tier-dot { background: var(--color-warning, #ffc107); color: #212529; }
.dq-tier--sparse    .dq-tier-dot { background: var(--color-secondary, #6c757d); }

.dq-tier-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.dq-tier-range {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ---- Worked example ------------------------------------------------------ */
.dq-example {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 1.25rem;
    border-radius: var(--radius-md, 12px);
    background: var(--bg-card-soft, rgba(128, 128, 128, 0.06));
    border: 1px dashed var(--border-color);
    font-size: 1.05rem;
    color: var(--text-primary);
}

.dq-example-num {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.dq-example-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    text-align: center;
}

/* ---- Counted / excluded groups ------------------------------------------- */
.dq-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.dq-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    padding: 1.1rem;
    background: var(--bg-card-soft, rgba(128, 128, 128, 0.04));
}

.dq-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
}

.dq-group-head i { color: var(--color-success, #28a745); }

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

.dq-field-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Tick uses a real <i> in the markup rather than a pseudo-element, so it does
   not depend on the exact Font Awesome family name being in use. */
.dq-field-list li i {
    font-size: 0.72rem;
    color: var(--color-success, #28a745);
    flex-shrink: 0;
}

/* ---- Excluded cards ------------------------------------------------------ */
.dq-excluded {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
}

.dq-exclude {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-color);
    background: var(--bg-card-soft, rgba(128, 128, 128, 0.04));
}

.dq-exclude-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.14);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.dq-exclude-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
}

.dq-exclude-why {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ---- Highlight callout --------------------------------------------------- */
.dq-callout {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md, 12px);
    border-left: 4px solid var(--color-primary);
    background: rgba(var(--color-primary-rgb, 13, 110, 253), 0.08);
    color: var(--text-primary);
    line-height: 1.55;
}

.dq-callout i {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.dq-callout--success {
    border-left-color: var(--color-success, #28a745);
    background: rgba(40, 167, 69, 0.09);
}

.dq-callout--success i { color: var(--color-success, #28a745); }

/* ---- Entity rows (operators / manufacturers) ----------------------------- */
.dq-entity {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--border-subtle, var(--border-color));
}

.dq-entity:last-child { border-bottom: none; }

.dq-entity-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--color-primary-rgb, 13, 110, 253), 0.12);
    color: var(--color-primary);
    font-size: 1.05rem;
}

.dq-entity-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.dq-entity-body {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.dq-chip {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    margin: 0.15rem 0.2rem 0.15rem 0;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(var(--color-primary-rgb, 13, 110, 253), 0.12);
    color: var(--color-primary);
}

.dq-chip--muted {
    background: rgba(128, 128, 128, 0.16);
    color: var(--text-muted);
}

/* ---- Dark theme nudges --------------------------------------------------- */
body.theme-dark .dq-tier,
body.theme-dark .dq-group,
body.theme-dark .dq-exclude,
body.theme-dark .dq-example {
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .dq-exclude-icon {
    background: rgba(255, 255, 255, 0.09);
}

body.theme-dark .dq-chip--muted {
    background: rgba(255, 255, 255, 0.12);
}

/* ---- Small screens ------------------------------------------------------- */
@media (max-width: 575.98px) {
    .dq-hero    { padding: 2.25rem 1rem 2rem; }
    .dq-section { padding: 1.25rem; }
}
