/**
 * AI Visibility Tracker — dashboard card styles.
 *
 * A compact analytics console for the technical wp-admin persona: a stat band
 * (score + per-engine breakdown + actions) over a two-column data area
 * (prompt table + competitor rail), then the editable prompt list. Uses the
 * shared --sitestaffr-* design tokens (sitestaffr-global.css) — no literals.
 *
 * The card header carries no controls, so it inherits the standard 60px
 * settings-card header (sitestaffr-settings.css) and matches every other card.
 *
 * @package    SiteStaffr
 * @subpackage SiteStaffr/admin/css
 * @since      1.36.0
 */

.sitestaffr-visibility-card [hidden] { display: none !important; }

/* ============================ Summary band ============================ */
.sitestaffr-visibility-summary {
    display: flex;
    align-items: center;
    gap: var(--sitestaffr-space-xl, 22px);
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--sitestaffr-bg-alt, #FAF8F4);
    border: 1px solid var(--sitestaffr-border, #E8E2D8);
    border-radius: var(--sitestaffr-radius-lg, 8px);
}

.sitestaffr-visibility-score {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sitestaffr-visibility-score-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sitestaffr-visibility-num {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.sitestaffr-visibility-num b {
    font-size: 34px;
    font-weight: 800;
    color: var(--sitestaffr-teal-dark, #00838F);
    letter-spacing: -0.02em;
}

.sitestaffr-visibility-num .den {
    font-size: 19px;
    font-weight: 600;
    color: var(--sitestaffr-text-muted, #646970);
    margin-left: 4px;
}

.sitestaffr-visibility-score-lab {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--sitestaffr-text-soft, #50575E);
    white-space: nowrap;
}

.sitestaffr-visibility-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    padding: 3px 9px;
    border-radius: 999px;
}
.sitestaffr-visibility-trend.is-flat { background: #edeef0; color: var(--sitestaffr-text-muted, #646970); }
.sitestaffr-visibility-trend.is-up   { background: #e3f6ee; color: #0a7c53; }
.sitestaffr-visibility-trend.is-down { background: #fbe9e9; color: var(--sitestaffr-red, #D63638); }

.sitestaffr-visibility-vr {
    width: 1px;
    align-self: stretch;
    background: var(--sitestaffr-border, #E8E2D8);
    margin: 2px 0;
}

.sitestaffr-visibility-engines {
    display: flex;
    gap: 18px;
    font-variant-numeric: tabular-nums;
}

.sitestaffr-visibility-eng {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sitestaffr-visibility-eng .k {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sitestaffr-text-muted, #646970);
}

.sitestaffr-visibility-eng .v {
    font-size: 15px;
    font-weight: 700;
    color: var(--sitestaffr-teal, #1FB6CC);
}

.sitestaffr-visibility-eng .v.na {
    font-size: 15px;
    font-weight: 600;
    color: #a7aaad;
    cursor: help;
}

.sitestaffr-visibility-summary-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sitestaffr-visibility-meta {
    font-size: 12px;
    color: var(--sitestaffr-text-muted, #646970);
    white-space: nowrap;
}

.sitestaffr-visibility-actions {
    display: flex;
    gap: 8px;
}

.sitestaffr-visibility-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: text-bottom;
    margin-right: 2px;
}

.sitestaffr-visibility-status {
    font-size: 12.5px;
    color: var(--sitestaffr-text-soft, #50575E);
}

/* ============================ Data area ============================ */
.sitestaffr-visibility-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(230px, 1fr);
    gap: 22px;
    margin-top: 20px;
}
.sitestaffr-visibility-grid.is-single { grid-template-columns: 1fr; }

.sitestaffr-visibility-block-h {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 9px;
}
.sitestaffr-visibility-block-h h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--sitestaffr-text, #1D2327);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sitestaffr-visibility-block-h .meta {
    font-size: 12px;
    font-weight: 500;
    color: var(--sitestaffr-text-muted, #646970);
}

/* By-prompt table */
.sitestaffr-visibility-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.sitestaffr-visibility-tbl thead th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sitestaffr-text-muted, #646970);
    padding: 0 0 6px;
    border-bottom: 1px solid var(--sitestaffr-border, #E8E2D8);
}
.sitestaffr-visibility-tbl tbody td {
    padding: 9px 0;
    border-bottom: 1px solid var(--sitestaffr-border-soft, #F0EBE0);
    vertical-align: top;
}
.sitestaffr-visibility-tbl tbody tr:last-child td { border-bottom: 0; }
.sitestaffr-visibility-tbl .c-q { padding-right: 16px; }

.sitestaffr-visibility-tbl .q-cell {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.sitestaffr-visibility-tbl .mk {
    display: inline-flex;
    width: 16px;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 12px;
}
.sitestaffr-visibility-tbl .tr-cited .mk { color: var(--sitestaffr-green, #10B981); }
.sitestaffr-visibility-tbl .tr-miss .mk  { color: var(--sitestaffr-red, #D63638); }
.sitestaffr-visibility-tbl .q-text { font-weight: 600; color: var(--sitestaffr-text, #1D2327); }
.sitestaffr-visibility-tbl .c-res { color: var(--sitestaffr-text-soft, #50575E); }
.sitestaffr-visibility-tbl .res-ok { color: #0a7c53; font-weight: 500; }
.sitestaffr-visibility-tbl .res-no { color: var(--sitestaffr-text-muted, #646970); }
.sitestaffr-visibility-tbl .res-no b { color: var(--sitestaffr-text-soft, #50575E); font-weight: 600; }

/* Competitor rail */
.sitestaffr-visibility-rail {
    background: var(--sitestaffr-bg-alt, #FAF8F4);
    border: 1px solid var(--sitestaffr-border, #E8E2D8);
    border-radius: var(--sitestaffr-radius-lg, 8px);
    padding: 14px 14px 8px;
}
.sitestaffr-visibility-rail .sitestaffr-visibility-block-h { margin-bottom: 10px; }
.sitestaffr-visibility-rank {
    list-style: none;
    margin: 0;
    padding: 0;
    font-variant-numeric: tabular-nums;
}
.sitestaffr-visibility-rank li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--sitestaffr-border-soft, #F0EBE0);
    font-size: 13px;
}
.sitestaffr-visibility-rank li:last-child { border-bottom: 0; }
.sitestaffr-visibility-rank .d {
    font-weight: 600;
    color: var(--sitestaffr-text, #1D2327);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sitestaffr-visibility-rank .c {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--sitestaffr-text-soft, #50575E);
    background: #fff;
    border: 1px solid var(--sitestaffr-border, #E8E2D8);
    border-radius: 20px;
    padding: 1px 9px;
    min-width: 26px;
    text-align: center;
    cursor: default;
}

/* ============================ Empty state ============================ */
.sitestaffr-visibility-empty {
    color: var(--sitestaffr-text-muted, #646970);
    padding: 8px 0 4px;
}
.sitestaffr-visibility-empty > p { margin: 0 0 12px; max-width: 620px; }
.sitestaffr-visibility-empty-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.sitestaffr-visibility-empty .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: text-bottom;
    margin-right: 2px;
}

/* ============================ Tracked prompts (configure) ============ */
.sitestaffr-visibility-prompts {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--sitestaffr-border-soft, #F0EBE0);
}
.sitestaffr-visibility-prompts .sitestaffr-visibility-block-h { margin-bottom: 2px; }
.sitestaffr-visibility-prompts-lead {
    font-size: 12.5px;
    color: var(--sitestaffr-text-muted, #646970);
    margin: 4px 0 12px;
    max-width: 640px;
}
.sitestaffr-visibility-prompts-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sitestaffr-visibility-prompt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sitestaffr-visibility-prompt-row .sitestaffr-visibility-prompt-input {
    flex: 1 1 320px;
    min-width: 200px;
}
.sitestaffr-visibility-prompt-row .sitestaffr-visibility-prompt-type {
    flex: 0 0 auto;
    min-width: 160px;
}
.sitestaffr-visibility-prompt-row .sitestaffr-visibility-prompt-delete { flex-shrink: 0; }
.sitestaffr-visibility-prompt-row .sitestaffr-visibility-prompt-delete .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}
.sitestaffr-visibility-prompts-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sitestaffr-visibility-prompts-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: text-bottom;
    margin-right: 2px;
}

/* Suggested prompts (gap-aware review panel) */
.sitestaffr-visibility-suggestions {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--sitestaffr-bg-alt, #FAF8F4);
    border: 1px solid var(--sitestaffr-border, #E8E2D8);
    border-radius: var(--sitestaffr-radius-lg, 8px);
}
.sitestaffr-visibility-suggestions .sitestaffr-visibility-block-h { margin-bottom: 10px; }
.sitestaffr-visibility-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sitestaffr-visibility-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--sitestaffr-border, #E8E2D8);
    border-radius: var(--sitestaffr-radius-md, 6px);
}
.sitestaffr-visibility-suggestion-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.sitestaffr-visibility-suggestion-text .q {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sitestaffr-text, #1D2327);
}
.sitestaffr-visibility-suggestion-type {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sitestaffr-text-muted, #646970);
    background: var(--sitestaffr-bg-alt, #FAF8F4);
    border: 1px solid var(--sitestaffr-border, #E8E2D8);
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}
.sitestaffr-visibility-suggestion-add { flex-shrink: 0; }
.sitestaffr-visibility-prompts-actions #sitestaffr-visibility-prompts-suggest .dashicons {
    color: var(--sitestaffr-teal-dark, #00838F);
}

/* ============================ Responsive ============================ */
@media (max-width: 900px) {
    .sitestaffr-visibility-grid { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
    .sitestaffr-visibility-summary { gap: 14px; }
    .sitestaffr-visibility-vr { display: none; }
    .sitestaffr-visibility-summary-right {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    .sitestaffr-visibility-prompt-row .sitestaffr-visibility-prompt-input,
    .sitestaffr-visibility-prompt-row .sitestaffr-visibility-prompt-type {
        flex: 1 1 100%;
        min-width: 0;
    }
}
