/* ============================================================
   ai-audit-report.css
   Embedded into every AI site audit report at generation time.
   Edit here; no recompile needed (app pool recycle picks up changes).
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    background: #f1f5f9;
    color: #1e293b;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }

/* ── Report header ── */
.report-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 32px 40px 28px;
}

.report-header h1 {
    font-size: 26px;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.report-header .report-site {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.report-header .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.report-header .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    color: #1d4ed8;
    font-weight: 500;
}

.report-header .badge-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.report-header .badge-crit {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.report-header .badge-good {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* ── Page wrapper ── */
.report-body {
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 24px;
}

/* ── Section headings ── */
.section-overline {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 6px;
}

h2 {
    font-size: 19px;
    color: #0f172a;
    border-left: 3px solid #2563eb;
    padding-left: 12px;
    margin: 40px 0 16px;
}

h3 { font-size: 16px; color: #1e293b; margin: 24px 0 8px; }
h4 { font-size: 14px; color: #334155; margin: 12px 0 5px; }

/* ── Summary card (health score) ── */
.summary-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
}

.gauge { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.gauge svg { transform: rotate(-90deg); }

.gauge-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.summary-card p { color: #64748b; font-size: 14px; margin-top: 5px; }

/* ── Stat cards grid ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top-width: 3px;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 18px 16px;
}

.stat-card .stat-num { font-size: 34px; font-weight: 800; line-height: 1; }

.stat-card .stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card.critical { border-top-color: #ef4444; }
.stat-card.critical .stat-num { color: #ef4444; }

.stat-card.warning { border-top-color: #f59e0b; }
.stat-card.warning .stat-num { color: #f59e0b; }

.stat-card.good { border-top-color: #22c55e; }
.stat-card.good .stat-num { color: #22c55e; }

.stat-card.info { border-top-color: #3b82f6; }
.stat-card.info .stat-num { color: #3b82f6; }

/* ── URL lists inside stat cards ── */
.stat-url-list {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #f1f5f9;
}

.stat-url-list summary {
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    outline: none;
    list-style: none;
}

.stat-url-list summary::-webkit-details-marker { display: none; }
.stat-url-list summary:hover { color: #2563eb; }

.stat-url-list ul {
    margin: 5px 0 0;
    padding-left: 0;
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.stat-url-list li {
    font-size: 11px;
    padding: 2px 0;
    border-bottom: 1px solid #f8fafc;
    line-height: 1.4;
}

.stat-url-list li:last-child { border-bottom: none; }
.stat-url-list a { color: #2563eb; word-break: break-all; display: block; }

/* ── Alert boxes ── */
.alert {
    border-radius: 8px;
    padding: 13px 16px;
    margin: 18px 0;
    font-size: 13.5px;
    line-height: 1.55;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
}

.alert-critical {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 3px solid #ef4444;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 3px solid #3b82f6;
}

/* ── Per-page summary table ── */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 28px;
    font-size: 13px;
}

.summary-table thead tr { background: #f8fafc; }

.summary-table th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.summary-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
}

.summary-table tr:last-child td { border-bottom: none; }
.summary-table tr:hover td { background: #f8fafc; }
.summary-table td:first-child { font-weight: 600; color: #0f172a; }

/* ── Severity badges ── */
.sev {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.sev-critical { background: #fef2f2; color: #b91c1c; }
.sev-warning  { background: #fffbeb; color: #92400e; }
.sev-good     { background: #f0fdf4; color: #166534; }

/* ── Per-page detail blocks ── */
.page-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.page-block .page-url { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.page-block ul { padding-left: 18px; margin: 5px 0; }
.page-block li { margin-bottom: 5px; font-size: 13.5px; color: #475569; }

/* ── Quick wins ── */
.quick-wins {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 20px 24px;
    margin: 28px 0;
}

.quick-wins h2 {
    border-left-color: #3b82f6;
    margin-top: 0;
    color: #1d4ed8;
}

.quick-wins ol { padding-left: 18px; margin-top: 10px; }
.quick-wins li { margin-bottom: 7px; font-size: 14px; color: #1e3a8a; }

/* ── Footer ── */
.report-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
}
