/* Top Pages Finder - tool-specific overrides 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) live in tools.css. Only
 * the bits that are genuinely specific to this tool sit here:
 *
 *   1. Per-column widths on the results table (URL, Estimated Traffic,
 *      Total Keywords, Domain).
 *   2. The is-bulk show/hide for the fourth "Domain" column.
 *   3. Invalid-inputs modal (same shape WTC and BLC use).
 */

/* ========================================================================
   Results table - per-column sizing
   Single-mode percentages sum to 100%; bulk hits 130% which the browser
   normalises proportionally. min-widths catch the small-viewport case
   (.results-table-wrap scrolls horizontally).
   ======================================================================== */
.results-table th[data-col="url"] {
    width: 60%;
    min-width: 280px;
}
.results-table th.th-num {
    width: 20%;
    min-width: 120px;
}
.results-table th[data-col="query"] {
    width: 30%;
    min-width: 140px;
}

/* ========================================================================
   Bulk-mode column visibility

   The "Domain" column is hidden by default and revealed only when the
   results panel is in bulk mode (driven by tool.js adding/removing
   `is-bulk` on `.results-region`).
   ======================================================================== */
.results-region.is-bulk .th-bulk,
.results-region.is-bulk td.td-bulk { display: table-cell; }
.th-bulk, td.td-bulk { display: none; }

/* ========================================================================
   Numeric cells - centered, tabular figures, slightly larger so the
   numbers read as the headline of each row.
   ======================================================================== */
.results-table td.td-num,
.results-table th.th-num {
    text-align: center;
    font-feature-settings: var(--tnum);
}

.results-table td.td-num {
    font-size: 15px;
    font-weight: 600;
}

/* Muted treatment for missing values (no_data rows). */
.results-table td.td-num.is-muted {
    color: var(--ink-400);
    font-weight: 400;
}

/* ========================================================================
   Invalid-inputs modal

   Shown when a bulk submission rejects one or more lines. Same shape
   WTC and BLC use. The class sets display:flex which beats the UA
   `[hidden]` rule, so the `.modal-backdrop[hidden]` override is
   mandatory (recurring CSS gotcha).
   ======================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modal-backdrop-in 0.12s ease-out;
}
.modal-backdrop[hidden] {
    display: none;
}
@keyframes modal-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-card {
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: 100%;
    padding: 24px 28px;
    animation: modal-card-in 0.18s ease-out;
}
@keyframes modal-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.modal-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}
.modal-body {
    margin: 0 0 12px;
    color: var(--ink-700);
    font-size: 14px;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.invalid-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 8px 12px;
    background: var(--ink-50);
    border: 1px solid var(--ink-100);
    border-radius: var(--r-sm);
    max-height: 220px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}
.invalid-list li {
    color: var(--ink-700);
    padding: 4px 0;
    border-bottom: 1px solid var(--ink-100);
    display: flex;
    gap: 10px;
    align-items: baseline;
    word-break: break-all;
}
.invalid-list li:last-child {
    border-bottom: 0;
}
.invalid-list .invalid-line {
    color: var(--ink);
    font-weight: 500;
    flex: 1 1 auto;
    min-width: 0;
}
.invalid-list .invalid-reason {
    color: var(--brand-red);
    font-size: 12px;
    flex: 0 0 auto;
    white-space: nowrap;
}

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