/* Listing Checker - tool-specific overrides on top of shared
 * primitives in code/assets/css/tools.css.
 *
 * - Form labels above the target input + optional competitor textarea
 * - View toggle in the sticky results header (Citations Found / Citation Gaps)
 *   with disabled state when there are no competitors
 * - Per-column widths for the two table shapes (found / gaps)
 * - Category + region pills
 * - Source-URL count chip
 * - Methodology disclosure note
 */

/* ========================================================================
   Form labels / hints
   ======================================================================== */
.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;
}
.field-hint {
    margin-left: 6px;
    color: var(--ink-500);
    font-weight: 400;
    font-size: 12px;
}
.bulk-count.is-over {
    color: var(--brand-red);
    font-weight: 600;
}

.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;
}

/* ========================================================================
   View toggle (Citations Found / Citation Gaps)
   ======================================================================== */
.view-toggle {
    display: inline-flex;
    background: var(--ink-50);
    border: 1px solid var(--ink-100);
    border-radius: var(--r-sm);
    padding: 2px;
    margin: 0 8px;
}
.view-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-600);
    cursor: pointer;
    border-radius: calc(var(--r-sm) - 2px);
    transition: background 0.12s ease, color 0.12s ease;
}
.view-btn:hover:not(:disabled) {
    color: var(--ink);
}
.view-btn.is-active {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.view-btn:disabled {
    color: var(--ink-300);
    cursor: not-allowed;
}

/* ========================================================================
   Results subhead - target + N competitors + citations + gaps summary
   ======================================================================== */
.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);
}

/* ========================================================================
   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="directory"]        { min-width: 180px; width: 22%; }
.results-table th[data-col="name"]             { min-width: 160px; }
.results-table th[data-col="category"]         { min-width: 120px; }
.results-table th[data-col="region"]           { min-width: 80px; }
.results-table th[data-col="source_urls"]      { min-width: 100px; }
.results-table th[data-col="found_on"]         { min-width: 180px; }
.results-table th[data-col="competitor_urls"]  { min-width: 90px; }

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

/* Directory + Name cells. */
.cell-directory-name {
    display: block;
    color: var(--ink);
    font-weight: 500;
    font-size: 14px;
}
.cell-directory-name.is-muted {
    color: var(--ink-400);
    font-style: italic;
}

/* Category pill */
.category-badge {
    display: inline-block;
    padding: 2px 9px;
    background: var(--ink-50);
    color: var(--ink-700);
    border: 1px solid var(--ink-100);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}
.category-badge.is-reviews       { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.category-badge.is-maps          { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.category-badge.is-social        { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.category-badge.is-marketplace   { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.category-badge.is-aggregator    { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.category-badge.is-chamber       { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.category-badge.is-regional      { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.category-badge.is-industry      { background: #f0f9ff; color: #075985; border-color: #bae6fd; }

/* Region pill - tiny uppercase code (US, GB, etc.). */
.region-badge {
    display: inline-block;
    padding: 2px 7px;
    background: var(--ink-50);
    color: var(--ink-500);
    border: 1px solid var(--ink-100);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-feature-settings: var(--tnum);
}
.region-badge.is-global {
    background: #fff;
    color: var(--ink-400);
}

/* Source-URLs chip (clickable to open the modal). */
.source-urls-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand-200, var(--ink-100));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    font-feature-settings: var(--tnum);
}
.source-urls-chip:hover,
.source-urls-chip:focus {
    background: var(--brand-50, #f4f9ff);
    outline: none;
}

/* DA / Spam Score badges - share the BLC thresholds via classes. */
.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 uses the inverted palette (higher is worse). */
.spam-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);
}
.spam-badge.is-good   { background: #dcfce7; color: #166534; }
.spam-badge.is-medium { background: #fef9c3; color: #854d0e; }
.spam-badge.is-bad    { background: #fee2e2; color: #991b1b; }
.spam-badge.is-muted  { background: transparent; color: var(--ink-300); font-weight: 400; }

/* Found-On column (Citation Gaps view). */
.results-table td.td-found-on {
    text-align: left;
    padding: 6px 18px 6px 8px;
    line-height: 1.5;
    min-width: 180px;
    vertical-align: middle;
}

.found-on-pill {
    display: inline-block;
    padding: 2px 9px;
    margin: 2px 3px 2px 0;
    background: var(--brand-50, #f4f9ff);
    color: var(--brand-700, var(--brand));
    border: 1px solid var(--ink-100);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: default;
    font-feature-settings: var(--tnum);
}
.found-on-pill.found-on-overflow {
    background: var(--ink-50);
    color: var(--ink-700);
    cursor: help;
    font-weight: 600;
}
.found-on-pill.found-on-overflow:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.found-on-empty {
    color: var(--ink-400);
}

/* Floating tooltip used by the Found-On chip. */
.found-on-tooltip {
    position: fixed;
    z-index: 99999;
    background: var(--ink);
    color: #fff;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    white-space: pre-line;
    max-width: 280px;
}

/* ========================================================================
   Methodology disclosure note
   ======================================================================== */
.methodology-note {
    margin-top: 24px;
    border: 1px solid var(--ink-100);
    border-radius: var(--r-md);
    background: #fff;
}
.methodology-note > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.methodology-note > summary::-webkit-details-marker {
    display: none;
}
.methodology-note > summary:hover {
    color: var(--ink);
}
.methodology-arrow {
    display: inline-block;
    transition: transform 0.12s ease;
    font-size: 10px;
    color: var(--ink-400);
}
.methodology-note[open] .methodology-arrow {
    transform: rotate(180deg);
}
.methodology-body {
    padding: 0 16px 16px;
    color: var(--ink-700);
    font-size: 13px;
    line-height: 1.55;
}
.methodology-body p {
    margin: 8px 0;
}
.methodology-body strong {
    color: var(--ink);
}

/* ========================================================================
   Source-URLs modal body
   ======================================================================== */
.urls-modal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.urls-modal-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--ink-100);
}
.urls-modal-list li:last-child {
    border-bottom: 0;
}
.urls-modal-url {
    color: var(--brand);
    word-break: break-all;
    text-decoration: none;
    font-size: 13px;
}
.urls-modal-url:hover {
    text-decoration: underline;
}
.urls-modal-anchor {
    display: block;
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 12px;
    font-style: italic;
}

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