/* Backlink Counter - tool-specific styles on top of the shared tool
 * primitives in code/assets/css/tools.css.
 *
 * Cross-tool primitives (mode toggle, input form, primary/ghost button,
 * progress region, errors region, results region, table base, sortable
 * headers, pagination, toasts, history region, sticky chrome, debug
 * panel, upgrade banner, modal chrome, quota banner, cell-xlink) live in
 * tools.css. Only the bits genuinely specific to this tool sit here:
 *
 *   1. Form layout (single input + submit; no country / type select).
 *   2. Single-mode big-number cards (Total Backlinks + Referring Domains
 *      lead; DA + Spam are smaller secondary cards).
 *   3. Per-column widths on the 7-column results table (counts-first).
 *   4. DA badge tiers (0-30 muted / 31-60 medium / 61+ strong) and
 *      Spam-score badge tiers (0-30 good / 31-60 warn / 61+ bad), shown
 *      as secondary metrics.
 *
 * There is NO DA-trend sparkline / zoom-modal CSS here: this tool leads
 * with backlink counts and does not surface the DA trend chart.
 */

/* ========================================================================
   Form layout - single input + submit, no country / type select since
   the Backlink Counter only takes domains.
   ======================================================================== */
.input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}
.input-row .text-input {
    flex: 1 1 320px;
    min-width: 240px;
}
.input-row .primary-btn {
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .input-row {
        gap: 8px;
    }
    .input-row .text-input {
        flex-basis: 100%;
    }
    .input-row .primary-btn {
        flex-basis: 100%;
        justify-content: center;
    }
}

/* ========================================================================
   Single-mode big-number cards. Rendered above the results table for a
   single-domain lookup (fresh check, share-link, or history reload).
   The two count cards (Total Backlinks, Referring Domains) are visually
   dominant; the followed counts + DA + Spam follow as smaller secondary
   cards.
   ======================================================================== */
.bignum-region {
    background: #fff;
    border: 1px solid var(--ink-100);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px 20px;
    margin-bottom: 16px;
}
.bignum-region[hidden] { display: none; }

.bignum-domain {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.2px;
    word-break: break-all;
}
.bignum-resolved {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-500);
    margin-top: 2px;
}
.bignum-resolved[hidden] { display: none; }

/* Two big count cards across the top. */
.bignum-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.bignum-card {
    border: 1px solid var(--ink-100);
    border-radius: var(--r-sm);
    background: var(--ink-50);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bignum-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ink-500);
}
.bignum-card-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--ink);
    font-feature-settings: var(--tnum);
}
.bignum-card-value.is-no-data {
    color: var(--ink-400);
    font-weight: 600;
}

/* The two headline count cards carry the brand accent. */
.bignum-card--hero {
    background: linear-gradient(180deg, rgba(150, 47, 46, 0.05), rgba(150, 47, 46, 0.02));
    border-color: rgba(150, 47, 46, 0.18);
}
.bignum-card--hero .bignum-card-value {
    color: var(--brand-red);
    font-size: 34px;
}
.bignum-card--hero .bignum-card-value.is-no-data {
    color: var(--ink-400);
}

/* Secondary cards (followed counts + DA + Spam) sit in a tighter sub-grid
   below the hero pair. */
.bignum-secondary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}
@media (min-width: 720px) {
    .bignum-secondary {
        grid-template-columns: repeat(4, 1fr);
    }
}
.bignum-secondary .bignum-card-value {
    font-size: 22px;
    font-weight: 700;
}

@media (max-width: 460px) {
    .bignum-grid,
    .bignum-secondary {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================
   Results table - per-column sizing.

   Seven columns, counts-first: Domain, Total Backlinks, Referring
   Domains, Followed Backlinks, Followed Referring Domains, DA, Spam.
   The backlink / referring-domain counts can run into the billions on
   top domains, so they get the most horizontal room.
   ======================================================================== */
.results-table th[data-col="domain"] {
    width: 24%;
    min-width: 200px;
    text-align: left;
}
.results-table th[data-col="backlinks_total"],
.results-table th[data-col="backlinks_followed"] {
    width: 15%;
    min-width: 120px;
}
.results-table th[data-col="linking_domains_total"],
.results-table th[data-col="linking_domains_followed"] {
    width: 14%;
    min-width: 110px;
}
.results-table th[data-col="domain_authority"] {
    width: 9%;
    min-width: 64px;
}
.results-table th[data-col="spam_score"] {
    width: 9%;
    min-width: 80px;
}

.results-table tbody td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.results-table .td-domain {
    color: var(--ink);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -0.1px;
    word-break: break-all;
}
.results-table .td-domain .resolved-line {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--ink-500);
    margin-top: 2px;
}

.results-table .td-backlinks_total,
.results-table .td-backlinks_followed,
.results-table .td-linking_domains_total,
.results-table .td-linking_domains_followed,
.results-table .td-domain_authority,
.results-table .td-spam_score {
    color: var(--ink);
    font-weight: 600;
    font-feature-settings: var(--tnum);
    text-align: right;
}
/* The two headline count columns are the visual lead. */
.results-table .td-backlinks_total {
    font-size: 16px;
    font-weight: 700;
}
.results-table .td-linking_domains_total {
    font-weight: 700;
}
.results-table .td-no-data {
    color: var(--ink-400);
    font-weight: 500;
}

/* DA tier badge: 0-30 muted, 31-60 medium, 61+ strong. Secondary metric. */
.da-badge {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-width: 40px;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    font-feature-settings: var(--tnum);
    font-size: 14px;
    font-weight: 700;
}
.da-badge--low    { background: var(--ink-100); color: var(--ink-700); }
.da-badge--medium { background: rgba(56, 130, 220, 0.14); color: rgb(36, 92, 168); }
.da-badge--high   { background: rgba(22, 163, 74, 0.16);  color: rgb(15, 109, 49); }

/* Spam tier badge: 0-30 good, 31-60 medium, 61+ bad. */
.spam-badge {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-width: 38px;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    font-feature-settings: var(--tnum);
    font-size: 14px;
    font-weight: 600;
}
.spam-badge--good   { background: rgba(22, 163, 74, 0.14); color: rgb(15, 109, 49); }
.spam-badge--medium { background: rgba(217, 119, 6, 0.16); color: rgb(146, 64, 14); }
.spam-badge--bad    { background: rgba(220, 38, 38, 0.16); color: rgb(159, 18, 18); }

/* Modal chrome (.modal-backdrop, .modal-card, .modal-title, .modal-body,
   .modal-actions, .invalid-list) lives in shared
   code/assets/css/tools.css. The invalid-inputs modal uses those
   primitives directly. */

.primary-btn:disabled,
.primary-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
