/* FedRAMP Marketplace Badges & Detail Cards */

/* ── Badge Base ─────────────────────────────────────────────────── */
.fedramp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s, transform 0.15s;
    cursor: pointer;
    line-height: 1.4;
    vertical-align: middle;
}
.fedramp-badge:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    text-decoration: none;
}
.fedramp-badge svg {
    flex-shrink: 0;
}

/* ── Size Variants ──────────────────────────────────────────────── */
.fedramp-badge-sm {
    padding: 1px 6px;
    font-size: 0.6rem;
    gap: 3px;
}
.fedramp-badge-sm svg { width: 10px; height: 10px; }

.fedramp-badge-md {
    padding: 3px 10px;
    font-size: 0.7rem;
    gap: 5px;
}
.fedramp-badge-md svg { width: 13px; height: 13px; }

.fedramp-badge-lg {
    padding: 4px 12px;
    font-size: 0.78rem;
    gap: 6px;
    border-radius: 6px;
}
.fedramp-badge-lg svg { width: 15px; height: 15px; }

/* ── Designation Colors ─────────────────────────────────────────── */
.fedramp-badge-authorized {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.fedramp-badge-authorized svg { stroke: #10b981; }

.fedramp-badge-inprocess {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.fedramp-badge-inprocess svg { stroke: #f59e0b; }

.fedramp-badge-ready {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.fedramp-badge-ready svg { stroke: #6366f1; }

/* ── Package Count Pill ─────────────────────────────────────────── */
.fedramp-pkg-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 0.55rem;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    margin-left: 2px;
}

/* ── Detail Card (Infrastructure Guide) ─────────────────────────── */
.fedramp-detail-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
}
.fedramp-detail-header {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}
.fedramp-detail-body {
    padding: 8px 12px;
}
.fedramp-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--border-color);
}
.fedramp-detail-row:last-child {
    border-bottom: none;
}
.fedramp-detail-key {
    color: var(--text-muted);
    font-weight: 500;
}
.fedramp-detail-val {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Badge inside tech dropdown summary ─────────────────────────── */
.cg-tech-summary .fedramp-badge {
    margin-left: 4px;
}

/* ── Badge inside vendor stack cards ────────────────────────────── */
.impl-policy-header .fedramp-badge {
    margin-left: auto;
}

/* ── Marketplace Stats Bar ──────────────────────────────────────── */
.fedramp-mkt-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.fedramp-mkt-stats svg {
    flex-shrink: 0;
}
.fedramp-mkt-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.fedramp-mkt-stat-val {
    font-weight: 700;
    color: var(--text-primary);
}
.fedramp-mkt-stat-label {
    color: var(--text-muted);
    font-size: 0.68rem;
}

/* ── Loading State ──────────────────────────────────────────────── */
.fedramp-badge-loading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}
.fedramp-badge-loading::after {
    content: '';
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: fedramp-spin 0.8s linear infinite;
}
@keyframes fedramp-spin {
    to { transform: rotate(360deg); }
}
