/* Competitors Finder - tool-specific overrides on top of shared
 * primitives in code/assets/css/tools.css.
 *
 * Form: a one-row input + submit (the .input-row already gives us this).
 * Results: a numeric Found-On chip that opens the sources modal,
 * metric badges (DA tiers), and the standard sticky chrome.
 */

/* ========================================================================
   Form labels
   ======================================================================== */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin: 14px 0 6px 0;
}
.field-label:first-child {
    margin-top: 0;
}

/* Free-tier hint under the form */
.form-hint {
    margin: 14px 0 0;
    padding: 10px 14px;
    border: 1px solid var(--ink-100);
    border-radius: var(--r-sm);
    background: var(--ink-50);
    color: var(--ink-700);
    font-size: 13px;
}
.form-hint a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.form-hint a:hover {
    text-decoration: underline;
}

/* Submit + input on one row (input-row primitive is shared but we
 * ensure the submit button doesn't break to a second line on narrow
 * viewports). */
.input-form .input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}
.input-form .input-row .text-input {
    flex: 1 1 360px;
    min-width: 260px;
}
.input-form .input-row .primary-btn {
    flex: 0 0 auto;
    min-width: 180px;
}

/* ========================================================================
   Results table
   ======================================================================== */
.results-table th.th-num,
.results-table td.td-num {
    text-align: center;
    font-feature-settings: var(--tnum);
    min-width: 80px;
}
.results-table td.td-num {
    font-size: 15px;
    font-weight: 600;
}
.results-table td.td-num.is-muted {
    color: var(--ink-400);
    font-weight: 400;
}

.results-table th[data-col="rank"]            { min-width: 50px;  width: 60px; }
.results-table th[data-col="competitor"]      { min-width: 240px; width: 40%; }
.results-table th[data-col="da"]              { min-width: 90px; }
.results-table th[data-col="pr"]              { min-width: 70px; }
.results-table th[data-col="spam"]            { min-width: 90px; }
.results-table th[data-col="traffic"]         { min-width: 110px; }
.results-table th[data-col="keywords"]        { min-width: 110px; }

.results-table td.td-rank {
    color: var(--ink-500);
    font-weight: 500;
}

.results-table .cell-link {
    color: var(--brand);
    word-break: break-all;
}

/* DA / PR / Spam badges */
.metric-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    min-width: 36px;
    text-align: center;
    font-feature-settings: var(--tnum);
}
.metric-badge.is-high     { background: #dcfce7; color: #166534; }
.metric-badge.is-medium   { background: #fef9c3; color: #854d0e; }
.metric-badge.is-low      { background: #fee2e2; color: #991b1b; }
.metric-badge.is-muted    { background: transparent; color: var(--ink-300); font-weight: 400; }

/* Spam-score badge uses the inverse polarity (low = good, high = bad). */
.metric-badge.is-spam-good   { background: #dcfce7; color: #166534; }
.metric-badge.is-spam-medium { background: #fef9c3; color: #854d0e; }
.metric-badge.is-spam-bad    { background: #fee2e2; color: #991b1b; }

/* Results subhead: small summary strip below the header. */
.results-subhead {
    padding: 10px 16px;
    font-size: 12.5px;
    color: var(--ink-600);
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-100);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: baseline;
}
.results-subhead strong {
    color: var(--ink);
    font-weight: 600;
}
.results-subhead .subhead-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid var(--ink-100);
    border-radius: 999px;
    font-size: 12px;
    color: var(--ink-700);
}
.results-subhead .subhead-pill .subhead-num {
    font-weight: 700;
    color: var(--ink);
    font-feature-settings: var(--tnum);
}

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

/* Mode-toggle pill slide for the "webpage" mode. The shared CSS in
   tools.css only carries a rule for data-mode="bulk"; this tool's
   second mode is "webpage", so we re-state the translateX rule
   here. See the project-wide [[mode-toggle-pill-data-mode]] memory. */
.mode-toggle[data-mode="webpage"]::before {
    transform: translateX(100%);
}
