/* ============================================================
   Trust Index Components
   CSS-only circular gauge + inline badge + subscore bars
   ============================================================ */

/* ── Circular Gauge ──────────────────────────────────────── */

.trust-gauge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trust-gauge svg {
    transform: rotate(-90deg);
}

.trust-gauge-track {
    fill: none;
    stroke-width: 5;
}

.trust-gauge-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.trust-gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

.trust-gauge-score {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.trust-gauge-label {
    font-size: 0.55em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-top: 2px;
}

/* Sizes */
.trust-gauge--lg { width: 120px; height: 120px; }
.trust-gauge--lg .trust-gauge-score { font-size: 1.75rem; }
.trust-gauge--lg .trust-gauge-label { font-size: 0.65rem; }

.trust-gauge--md { width: 80px; height: 80px; }
.trust-gauge--md .trust-gauge-score { font-size: 1.15rem; }
.trust-gauge--md .trust-gauge-label { font-size: 0.55rem; }

.trust-gauge--sm { width: 48px; height: 48px; }
.trust-gauge--sm .trust-gauge-score { font-size: 0.8rem; }
.trust-gauge--sm .trust-gauge-label { display: none; }
.trust-gauge--sm .trust-gauge-track,
.trust-gauge--sm .trust-gauge-fill { stroke-width: 4; }

/* Color tiers */
.trust-gauge--new .trust-gauge-fill { stroke: #9e9e9e; }
.trust-gauge--emerging .trust-gauge-fill { stroke: #f59e0b; }
.trust-gauge--established .trust-gauge-fill { stroke: #3b82f6; }
.trust-gauge--trusted .trust-gauge-fill { stroke: #2ea44f; }
.trust-gauge--proven .trust-gauge-fill { stroke: var(--crypto-accent-500, #7879f6); }

[data-bs-theme="dark"] .trust-gauge-track { stroke: rgba(255, 255, 255, 0.08); }
[data-bs-theme="light"] .trust-gauge-track { stroke: rgba(100, 100, 160, 0.10); }

/* ── Inline Badge ────────────────────────────────────────── */

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    line-height: 1.3;
    white-space: nowrap;
}

.trust-badge-score {
    font-weight: 700;
    font-size: 0.8rem;
}

.trust-badge--new { background: rgba(158, 158, 158, 0.12); color: #9e9e9e; }
.trust-badge--emerging { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.trust-badge--established { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.trust-badge--trusted { background: rgba(46, 164, 79, 0.12); color: #2ea44f; }
.trust-badge--proven { background: rgba(120, 121, 246, 0.12); color: var(--crypto-accent-500, #7879f6); }

/* ── Subscore Bars ───────────────────────────────────────── */

.trust-subscores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trust-subscore {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-subscore-label {
    flex: 0 0 90px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.trust-subscore-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

[data-bs-theme="dark"] .trust-subscore-bar { background: rgba(255, 255, 255, 0.06); }
[data-bs-theme="light"] .trust-subscore-bar { background: rgba(100, 100, 160, 0.08); }

.trust-subscore-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.trust-subscore-value {
    flex: 0 0 32px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: right;
    opacity: 0.7;
}

/* Subscore bar colors follow tier of each subscore */
.trust-subscore-fill { background: var(--crypto-accent-500, #7879f6); }

/* ── Trust Index Card (Dashboard) ────────────────────────── */

.trust-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.trust-card-gauge {
    flex-shrink: 0;
}

.trust-card-details {
    flex: 1;
    min-width: 0;
}

.trust-card-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.trust-card-tier {
    font-size: 1rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 0.5rem;
}

/* Dashboard stats row inside Trust Index card */
.dash-trust-stats-row {
    padding-left: 1.5rem;
    border-left: 1px solid rgba(128, 128, 128, 0.12);
}

/* Dashboard stat items */
.dash-trust-stat {
    padding: 0.25rem 0;
    border-radius: 4px;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.dash-trust-stat:hover {
    opacity: 0.7;
}

/* ── Responsive: Tablet ──────────────────────────────────── */
@media (max-width: 991px) {
    .trust-card {
        flex-wrap: wrap;
    }

    .dash-trust-stats-row {
        border-left: none !important;
        border-top: 1px solid rgba(128, 128, 128, 0.12);
        padding-left: 0 !important;
        padding-top: 1rem;
        margin-top: 1rem;
        width: 100%;
    }
}

/* ── Responsive: Mobile ──────────────────────────────────── */
@media (max-width: 767px) {
    .trust-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .trust-card-details {
        text-align: center;
    }

    .dash-trust-stats-row {
        overflow-x: auto;
        justify-content: flex-start !important;
        gap: 1.5rem !important;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
}
