/* ============================================================
   D3 — Sitemap Analyzer
   Tool-specific styles. Shell, hero, buttons, FAQ, CTA, and
   design tokens from redirect-checker.css (loaded first) and
   /static/landing/styles.css.
   Angular clip-path corners only — NEVER border-radius.
   ============================================================ */

/* ---- Form -------------------------------------------------------------- */

.sm-form-wrap {
    margin: 40px 0 16px;
}

/* Label above the row; input + button share one row at identical height
   (one axis); the hint lives BELOW the row. See feedback memory
   "form-input-button-one-axis". */
.sm-form .field-label {
    display: block;
    margin-bottom: 6px;
}

.sm-field-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: stretch;
}

.sm-field-row .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .sm-field-row {
        grid-template-columns: 1fr;
    }
    .sm-field-row .btn-primary {
        width: 100%;
    }
}

.field-hint {
    margin: 5px 0 0;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.sm-input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 15px;
    background: rgba(13, 13, 20, 0.85);
    border: 1px solid rgba(0, 245, 212, 0.3);
    clip-path: var(--clip-badge);
    color: var(--text-primary);
    transition: border-color .2s, box-shadow .2s;
}

.sm-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

/* iOS Safari: 16px stops auto-zoom on input focus */
@media (max-width: 720px) {
    .sm-input { font-size: 16px; }
}

/* ---- Summary tiles ---------------------------------------------------- */

.sm-summary-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 32px 0 28px;
}

@media (max-width: 640px) {
    .sm-summary-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sm-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px 18px;
    background: rgba(13, 13, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.09);
    clip-path: var(--clip-card);
    text-align: center;
}

.sm-tile-num {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.sm-tile-label {
    margin-top: 6px;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sm-tile-ok   .sm-tile-num { color: #5af0cb; }
.sm-tile-warn .sm-tile-num { color: #ffd365; }
.sm-tile-error .sm-tile-num { color: #ff8888; }

.sm-tile-ok    { border-color: rgba(0, 245, 212, 0.18); }
.sm-tile-warn  { border-color: rgba(255, 184, 0, 0.18); }
.sm-tile-error { border-color: rgba(255, 87, 87, 0.18); }

/* ---- Status bar ------------------------------------------------------- */

.sm-status-bar {
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid;
    clip-path: var(--clip-card);
    display: none;
}

.sm-status-bar.is-visible { display: block; }

.sm-status-bar-head {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
}

.sm-status-bar-meta {
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    overflow-wrap: break-word;
}

.sm-status-bar.status-ok    { background: rgba(0, 245, 212, 0.07); border-color: rgba(0, 245, 212, 0.4); }
.sm-status-bar.status-ok .sm-status-bar-head    { color: #5af0cb; }
.sm-status-bar.status-warn  { background: rgba(255, 184, 0, 0.07); border-color: rgba(255, 184, 0, 0.4); }
.sm-status-bar.status-warn .sm-status-bar-head  { color: #ffd365; }
.sm-status-bar.status-error { background: rgba(255, 87, 87, 0.08); border-color: rgba(255, 87, 87, 0.45); }
.sm-status-bar.status-error .sm-status-bar-head { color: #ff8888; }

/* ---- Top-level errors ------------------------------------------------- */

.sm-toplevel-errors {
    margin-bottom: 24px;
}

.sm-block-title {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text-primary);
    margin: 24px 0 10px;
}

.sm-error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sm-error-list li {
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
    border-left: 3px solid #ff5757;
    background: rgba(255, 87, 87, 0.07);
    clip-path: var(--clip-badge);
    color: #ff9b9b;
}

/* ---- Sitemapindex block ----------------------------------------------- */

.sm-index-block {
    margin-bottom: 28px;
}

.sm-index-notice {
    padding: 14px 18px;
    background: rgba(0, 245, 212, 0.06);
    border: 1px solid rgba(0, 245, 212, 0.3);
    border-left-width: 3px;
    clip-path: var(--clip-badge);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #b8c0c8);
    margin-bottom: 16px;
}

.sm-index-note {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.sm-child-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sm-child-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 14px;
    background: rgba(13, 13, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: var(--clip-badge);
}

.sm-child-url {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--neon-cyan);
    text-decoration: none;
    word-break: break-all;
    flex: 1 1 0;
}

.sm-child-url:hover { text-decoration: underline; }

.sm-child-lastmod {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- Tabs ------------------------------------------------------------- */

.sm-tabs {
    margin-top: 28px;
}

.sm-tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sm-tab-btn {
    padding: 9px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.sm-tab-btn:hover { color: var(--text-primary); }
.sm-tab-btn.is-active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
}

.sm-tab-count {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 7px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    clip-path: var(--clip-badge);
}

.sm-tab-btn.is-active .sm-tab-count {
    background: rgba(0, 245, 212, 0.15);
    color: #5af0cb;
}

.sm-tab-panel { display: none; }
.sm-tab-panel.is-active { display: block; }

/* ---- URL table -------------------------------------------------------- */

.sm-coverage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.sm-cov-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.sm-truncation-note {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Mobile-only hint that the URL table scrolls horizontally to reveal
   the Changefreq and Priority columns clipped by the overflow wrapper. */
.sm-scroll-hint { display: none; }

@media (max-width: 640px) {
    .sm-scroll-hint {
        display: block;
        font-size: 12px;
        color: var(--text-muted);
        margin-bottom: 8px;
    }
}

.sm-url-table-wrap {
    overflow-x: auto;
}

.sm-url-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sm-url-table thead th {
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: rgba(13, 13, 20, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    white-space: nowrap;
}

.sm-url-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sm-url-table tbody tr:hover {
    background: rgba(0, 245, 212, 0.03);
}

.sm-url-table td {
    padding: 8px 12px;
    vertical-align: top;
    line-height: 1.4;
}

/* Column widths */
.col-status { width: 72px; min-width: 72px; }
.col-url    { min-width: 200px; word-break: break-all; }
.col-lastmod { width: 110px; white-space: nowrap; }
.col-cf      { width: 100px; white-space: nowrap; }
.col-pri     { width: 70px; }

.sm-url-table td.col-url {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary, #b8c0c8);
    word-break: break-all;
}

.sm-url-table td.col-lastmod,
.sm-url-table td.col-cf,
.sm-url-table td.col-pri {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* Status badge in table */
.sm-row-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 8px;
    clip-path: var(--clip-badge);
}

.sm-row-badge-ok    { background: rgba(0, 245, 212, 0.13); color: #5af0cb; }
.sm-row-badge-warn  { background: rgba(255, 184, 0, 0.14);  color: #ffd365; }
.sm-row-badge-error { background: rgba(255, 87, 87, 0.14);  color: #ff9b9b; }

/* Issues tooltip / detail */
.sm-issue-detail {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-style: italic;
    word-break: break-word;
}

/* ---- Pagination ------------------------------------------------------- */

.sm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
}

.sm-page-info {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-muted);
    min-width: 100px;
    text-align: center;
}

/* ---- Issues tab ------------------------------------------------------- */

.sm-issues-empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px 0;
}

.sm-issues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sm-issue-card {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left-width: 3px;
    clip-path: var(--clip-badge);
    background: rgba(13, 13, 20, 0.6);
}

.sm-issue-card-warn  { border-left-color: #ffb800; background: rgba(255, 184, 0, 0.05); }
.sm-issue-card-error { border-left-color: #ff5757; background: rgba(255, 87, 87, 0.05); }

.sm-issue-card-loc {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-cyan);
    margin-bottom: 6px;
    word-break: break-all;
}

.sm-issue-card-issues {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sm-issue-card-issues li {
    font-size: 12.5px;
    color: var(--text-secondary, #b8c0c8);
    line-height: 1.4;
    padding-left: 12px;
    position: relative;
}

.sm-issue-card-issues li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* ---- Metadata row ----------------------------------------------------- */

.sm-metadata-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.sm-meta-item strong { color: var(--text-primary); }
.sm-mono { font-family: var(--font-mono); font-size: 11.5px; word-break: break-all; }

/* ---- Coverage metadata ------------------------------------------------ */

.output-h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

/* ---- Actions ---------------------------------------------------------- */

.sm-actions {
    margin-top: 20px;
}

@media (max-width: 480px) {
    .sm-actions .btn-secondary { width: 100%; text-align: center; }
    .product-cta a.btn-primary,
    .product-cta a.btn-secondary {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0 0 10px;
    }
}

/* ---- Post-results nudge ----------------------------------------------- */

.results-nudge {
    margin: 28px 0 0;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #b8c0c8);
    background: rgba(0, 245, 212, 0.05);
    border-left: 3px solid var(--neon-cyan);
    clip-path: var(--clip-badge);
}

.results-nudge a {
    color: var(--neon-cyan);
    font-weight: 600;
    text-decoration: none;
}

.results-nudge a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Child-expansion opt-in toggle + per-child URL counts.
--------------------------------------------------------------------------- */
.sm-expand-toggle {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary);
    cursor: pointer;
}
.sm-expand-toggle input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--neon-cyan);
    flex-shrink: 0;
}

.sm-child-count {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--neon-cyan);
}
.sm-child-error {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}
