/* Spam Score Checker - tool-specific styles on top of the shared
 * primitives in code/assets/css/tools.css.
 *
 * Shared infrastructure used by SSC:
 *   - Mode toggle, input form, primary/ghost buttons
 *   - Progress / errors / debug / results regions
 *   - Sortable table chrome (sticky header + thead), pagination, toasts
 *   - History region, upgrade banners, cell-xlink, empty-state
 *   - Modal chrome (.modal-backdrop, .modal-card, .invalid-list)
 *   - Daily-quota chip styles (also currently in shared via DAC/WAC's
 *     lift; SSC reuses them with no additions).
 *
 * Only SSC-specific styles here:
 *   1. Tool-page hero chrome tweak.
 *   2. Per-column widths on the 3-column results table.
 *   3. Spam Score badge tiers (good / medium / bad).
 *   4. Risk explanation cell styling.
 *   5. Daily lookup quota chip (single-window variant; same as DAC/WAC).
 */

/* ========================================================================
   Form layout - single input + submit, no country / type select.
   ======================================================================== */
.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;
    }
}

/* ========================================================================
   Daily lookup quota chip (free / anonymous only)
   ======================================================================== */
.quota-region {
    background: #fff;
    border: 1px solid var(--ink-100);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.quota-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--ink-500);
}
.quota-upgrade {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-red);
}
.quota-chips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.quota-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--ink-50);
    border: 1px solid var(--ink-100);
}
.quota-chip-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ink-500);
}
.quota-chip-text {
    font-feature-settings: var(--tnum);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}
.quota-chip-bar {
    display: block;
    height: 4px;
    background: var(--ink-200);
    border-radius: 999px;
    overflow: hidden;
}
.quota-chip-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-red-light) 100%);
    transition: width 0.4s ease;
}
.quota-chip.is-warning .quota-chip-fill { background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%); }
.quota-chip.is-danger  .quota-chip-fill { background: linear-gradient(90deg, var(--bad-fg) 0%, #ef4444 100%); }
.quota-chip.is-warning .quota-chip-text { color: #b45309; }
.quota-chip.is-danger  .quota-chip-text { color: var(--bad-fg); }

/* ========================================================================
   Results table - 3 columns
   ======================================================================== */
.results-table th[data-col="domain"] {
    width: 36%;
    min-width: 220px;
    text-align: left;
}
.results-table th[data-col="spam_score"] {
    width: 14%;
    min-width: 90px;
}
.results-table th[data-col="risk_label"] {
    width: 50%;
    min-width: 220px;
    text-align: left;
}

.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-spam_score {
    color: var(--ink);
    font-weight: 700;
    font-feature-settings: var(--tnum);
    text-align: right;
}
.results-table .td-risk_label {
    color: var(--ink-700);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.45;
}
.results-table .td-no-data {
    color: var(--ink-400);
    font-weight: 500;
}

/* Spam Score badge tiers: 0-30 good, 31-60 medium, 61+ bad.
   Same color language as DAC's pre-lift spam badge. */
.spam-badge {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-width: 48px;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    font-feature-settings: var(--tnum);
    font-size: 16px;
    font-weight: 700;
}
.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); }

/* Risk-label cell carries a small tier dot prefix so the row reads
   "<color dot> Low risk - few spam signals". Helps users scan the
   risk column without reading every label. */
.risk-cell {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}
.risk-cell-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    transform: translateY(-1px);
}
.risk-cell-dot--good   { background: rgb(22, 163, 74); }
.risk-cell-dot--medium { background: rgb(217, 119, 6); }
.risk-cell-dot--bad    { background: rgb(220, 38, 38); }

.primary-btn:disabled,
.ghost-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
