/*
 * NFA Academy — Phase 11 Styles
 * Advanced AI: PWSA Anchor Engine · Content QA · Stage Calibration · Heritage Integrator
 */

/* ── Shared admin panel vars ────────────────────────────────────────────── */
.nfa-anchors-admin,
.nfa-qa-admin,
.wrap.nfa-admin-wrap {
    --nfa-navy:  #1e2855;
    --nfa-gold:  #E8C84A;
    --nfa-green: #1A5C2E;
    --nfa-rust:  #8B3A1A;
    --nfa-cream: #FAF8F2;
    --nfa-muted: #666;
    --ff-display: 'Playfair Display', Georgia, serif;
    --ff-mono:    'Space Mono', monospace;
}

/* ── QA score badge ─────────────────────────────────────────────────────── */
.nfa-qa-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-family: var(--ff-mono);
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
}
.nfa-qa-score.pass  { background: #2e7d32; }
.nfa-qa-score.warn  { background: #E65100; }
.nfa-qa-score.fail  { background: #c62828; }

/* ── Flag severity chips ────────────────────────────────────────────────── */
.nfa-flag-chip {
    display: inline-block;
    font-family: var(--ff-mono);
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 10px;
}
.nfa-flag-chip.block { background: #FFEBEE; color: #c62828; }
.nfa-flag-chip.warn  { background: #FFF8E1; color: #E65100; }

/* ── QA flag cards ──────────────────────────────────────────────────────── */
.nfa-flag-card {
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: .85rem;
    border-left: 4px solid;
}
.nfa-flag-card.block { background: #FFEBEE; border-color: #c62828; }
.nfa-flag-card.warn  { background: #FFF8E1; border-color: #E65100; }
.nfa-flag-card-type  { font-family: var(--ff-mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: 4px; }
.nfa-flag-card-msg   { color: #1a1a1a; }
.nfa-flag-card-ctx   { color: #555; font-size: .78rem; margin-top: 3px; }

/* ── Anchor card grid ───────────────────────────────────────────────────── */
.nfa-anchor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.nfa-anchor-card {
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 18px;
    position: relative;
}
.nfa-anchor-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.nfa-anchor-letter {
    position: absolute;
    top: 14px;
    right: 16px;
    font-family: var(--ff-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: #e0e0e0;
}
.nfa-anchor-card-header { font-family: var(--ff-mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--nfa-muted); margin-bottom: 6px; }
.nfa-anchor-card-name   { font-size: .95rem; font-weight: 600; color: var(--nfa-navy); margin-bottom: 8px; }
.nfa-anchor-card-meta   { font-family: var(--ff-mono); font-size: .65rem; color: var(--nfa-muted); }
.nfa-anchor-card-meta span + span::before { content: ' · '; }

/* Heritage tier colors on anchor card */
.nfa-tier-gold       { color: #C8A951; font-weight: 700; }
.nfa-tier-silver     { color: #757575; font-weight: 700; }
.nfa-tier-bronze     { color: #8B4513; font-weight: 700; }
.nfa-tier-unverified { color: #9e9e9e; }

/* ── Anchor modal / QA modal ─────────────────────────────────────────────── */
.nfa-ai-modal-wrap {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.nfa-ai-modal-wrap.open { display: flex; }
.nfa-ai-modal-inner {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    max-width: 820px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.nfa-ai-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.nfa-ai-modal-close:hover { color: #c62828; }

/* ── Anchor viewer sections ─────────────────────────────────────────────── */
.nfa-anchor-section   { margin-bottom: 20px; }
.nfa-anchor-section h4 { font-family: var(--ff-display); font-size: .95rem; color: var(--nfa-navy); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #f0f0f0; }
.nfa-anchor-thesis    { background: var(--nfa-cream); border-left: 4px solid var(--nfa-navy); padding: 12px 16px; border-radius: 4px; font-size: .9rem; line-height: 1.6; }
.nfa-anchor-questions { list-style: decimal; padding-left: 20px; }
.nfa-anchor-questions li { margin-bottom: 6px; font-size: .88rem; }
.nfa-anchor-evidence  { background: #E8F5E9; border-radius: 4px; padding: 12px 16px; }
.nfa-anchor-evidence li { margin-bottom: 4px; font-size: .85rem; }
.nfa-anchor-heritage  { background: #FFF3E0; border-left: 4px solid var(--nfa-rust); padding: 12px 16px; border-radius: 4px; font-size: .88rem; }

/* ── Stage scaffold grid ────────────────────────────────────────────────── */
.nfa-stage-scaffold-grid { display: flex; flex-direction: column; gap: 6px; }
.nfa-stage-scaffold-row {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 8px;
    border-radius: 4px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}
.nfa-stage-badge {
    font-family: var(--ff-mono);
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-align: center;
}
.nfa-stage-badge.ts1 { background: #E3F2FD; color: #1565C0; }
.nfa-stage-badge.ts2 { background: #E8F5E9; color: #2E7D32; }
.nfa-stage-badge.ts3 { background: #EDE7F6; color: #4527A0; }
.nfa-stage-badge.ts4 { background: #FFF3E0; color: #E65100; }
.nfa-stage-badge.ts5 { background: #FCE4EC; color: #880E4F; }
.nfa-stage-scaffold-text { font-size: .85rem; line-height: 1.5; }

/* ── Calibration table ──────────────────────────────────────────────────── */
.nfa-calibration-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    margin-bottom: 16px;
}
.nfa-calibration-table th {
    background: var(--nfa-navy);
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    font-family: var(--ff-mono);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.nfa-calibration-table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; }
.nfa-calibration-table tr:nth-child(even) td { background: #fafafa; }
.nfa-fk-hard { color: #c62828; font-weight: 700; }
.nfa-fk-ok   { color: #2e7d32; }
.nfa-delta-warn { color: #E65100; }

/* ── Heritage evidence panel ────────────────────────────────────────────── */
.nfa-heritage-panel {
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.nfa-heritage-kpis {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.nfa-heritage-kpi { text-align: center; }
.nfa-heritage-kpi-val { font-family: var(--ff-mono); font-size: 1.4rem; font-weight: 700; }
.nfa-heritage-kpi-label { font-family: var(--ff-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .07em; color: var(--nfa-muted); }

/* ── Pattern editor ─────────────────────────────────────────────────────── */
.nfa-pattern-tag {
    display: inline-block;
    background: #FFEBEE;
    color: #c62828;
    font-family: var(--ff-mono);
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin: 2px;
}

/* ── QA status bar (shown in production pipeline) ───────────────────────── */
.nfa-qa-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: .8rem;
    font-family: var(--ff-mono);
    margin-top: 6px;
}
.nfa-qa-status-bar.cleared  { background: #E8F5E9; color: #2e7d32; border: 1px solid #A5D6A7; }
.nfa-qa-status-bar.flagged  { background: #FFEBEE; color: #c62828; border: 1px solid #EF9A9A; }
.nfa-qa-status-bar.overridden { background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80; }
.nfa-qa-status-bar.pending  { background: #F5F5F5; color: #666; border: 1px solid #ddd; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 782px) {
    .nfa-anchor-cards { grid-template-columns: 1fr; }
    .nfa-heritage-kpis { flex-wrap: wrap; gap: 12px; }
    .nfa-ai-modal-inner { padding: 20px; }
}
