/* ==========================================================================
   WebsiteHeart - report.css
   The three tool pages: URL form, report cards, score rings, tables, pills.
   ========================================================================== */

/* ============ CHECKER HERO / URL INPUT ============ */
.checker-hero{
  padding: 72px 0 44px;
  text-align:center;
}
.checker-hero .eyebrow{ justify-content:center; }
.checker-hero h1{
  font-size: clamp(32px, 4vw, 46px);
  margin: 18px auto 14px;
  max-width: 720px;
  color: var(--pine);
  line-height:1.1;
}
.checker-hero p.lead{
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 34px;
}

.url-form{
  max-width: 680px;
  margin: 0 auto;
  display:flex;
  gap:10px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 20px 40px -28px rgba(22,35,31,0.3);
}
.url-form input[type="url"]{
  flex:1;
  border:none;
  outline:none;
  background:transparent;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 14px;
  min-width: 0;
}
.url-form input[type="url"]::placeholder{ color: #9AA6A0; }
.url-form .btn{ padding: 13px 24px; flex-shrink:0; }

.checker-note{
  margin-top: 16px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--ink-soft);
}

/* ============ ERROR BANNER (shown when a check could not run) ============ */
.error-banner{
  max-width: 680px;
  margin: 24px auto 0;
  display:flex;
  align-items:flex-start;
  gap: 14px;
  text-align:left;
  padding: 16px 20px;
  background: rgba(194,75,63,0.08);
  border: 1px solid rgba(194,75,63,0.28);
  border-radius: 12px;
}
.error-banner svg{ width:20px; height:20px; flex-shrink:0; color: var(--alert); margin-top:2px; }
.error-banner strong{ display:block; color: var(--alert); font-size:14.5px; margin-bottom:3px; }
.error-banner p{ font-size: 14px; color: var(--ink-soft); }

/* ============ REPORT META BAR ============ */
.report-meta{
  max-width: 680px;
  margin: 34px auto 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap: 10px;
  padding: 14px 20px;
  background: var(--pine-2);
  border-radius: 10px;
  color: rgba(241,244,241,0.85);
}
.report-meta-url{
  font-family: var(--font-mono);
  font-size: 13.5px;
  display:flex; align-items:center; gap:8px;
  word-break: break-all;
  text-align:left;
}
.report-meta-url .live-dot{
  width:7px;height:7px;border-radius:50%;
  background: var(--moss);
  flex-shrink:0;
}
.report-meta-time{
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(241,244,241,0.55);
  flex-shrink:0;
}

/* ============ REPORT SECTIONS ============ */
.report{ padding: 56px 0 90px; }
/* The SEO and performance reports stack many blocks; monitoring has just one. */
.report .report-stack{ display:flex; flex-direction:column; gap: 44px; }

.report-section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom: 20px;
  flex-wrap:wrap;
  gap: 8px;
}
.report-section-head h2{ font-size: 22px; color: var(--pine); }
.report-section-head .eyebrow{ margin-bottom:6px; display:block; }
.report-section-head-text{ max-width: 640px; }

.card{
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

/* A short note under a block, used to be honest about what a number means. */
.report-note{
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  line-height: 1.6;
}

/* --- status pill --- */
.status-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight:500;
}
.status-pill.good{ background: rgba(63,166,114,0.12); color: var(--moss); }
.status-pill.warn{ background: rgba(227,169,63,0.15); color: var(--amber-deep); }
.status-pill.bad{ background: rgba(194,75,63,0.12); color: var(--alert); }
.status-pill .dot{ width:6px; height:6px; border-radius:50%; background: currentColor; }

/* --- score summary (SEO + performance) --- */
.summary-grid{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
}
.score-card{
  padding: 30px 26px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap: 14px;
}
.score-ring{ position:relative; width:150px; height:150px; }
.score-ring svg{ transform: rotate(-90deg); }
.score-ring-track{ fill:none; stroke: var(--line); stroke-width: 10; }
.score-ring-value{
  fill:none;
  stroke: var(--moss);
  stroke-width: 10;
  stroke-linecap: round;
  /* Animated by scan.js, which sweeps the ring from empty to the real score. */
  transition: stroke-dashoffset .9s cubic-bezier(.2,.7,.3,1);
}
.score-ring-value.warn{ stroke: var(--amber); }
.score-ring-value.bad{ stroke: var(--alert); }
.score-ring-label{
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.score-ring-label .num{ font-family: var(--font-mono); font-size: 34px; font-weight:600; color: var(--pine); line-height:1; }
.score-ring-label .of100{ font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin-top:4px; }
.score-card-label{ font-size: 14.5px; font-weight:600; color: var(--pine); }
.score-card-sub{ font-size: 13px; color: var(--ink-soft); }

/* --- status card (SEO overview, right of the ring) --- */
.status-card{
  padding: 30px 26px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 14px;
}
.status-code-row{ display:flex; align-items:center; gap: 18px; }
.status-code-num{
  font-family: var(--font-mono);
  font-weight:600;
  color: var(--moss);
  line-height:1;
}
.status-card .status-code-num{ font-size: 44px; }
.status-code-num.warn{ color: var(--amber-deep); }
.status-code-num.bad{ color: var(--alert); }
.status-code-text{ font-size: 14.5px; color: var(--ink-soft); }
.status-code-text strong{ display:block; color: var(--pine); font-size: 15.5px; margin-bottom:2px; }

/* --- data cards (meta information) --- */
.meta-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.data-card{ padding: 20px 22px; }
.data-card .field-label{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform:uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap;
}
.data-card .field-value{
  font-size: 15px;
  color: var(--pine);
  line-height:1.45;
  word-break: break-word;
}
.data-card .field-value.mono{ font-family: var(--font-mono); font-size: 14px; }
/* Nothing found on the page - say so instead of showing an empty box. */
.data-card .field-value.empty{ color: var(--alert); font-style: italic; }
.field-sub{ margin-top:8px; font-size: 12.5px; color: var(--ink-soft); }
.meta-grid .data-card.span-2{ grid-column: 1 / -1; }

/* --- heading analysis --- */
.heading-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.heading-card{ padding: 24px 22px; }
.heading-tag{
  display:inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight:600;
  color: var(--pine);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.heading-count{
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight:600;
  color: var(--pine);
  line-height:1;
  margin-bottom: 10px;
}
.heading-sample{
  font-size: 13.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  line-height:1.5;
}
.heading-sample em{ font-style:normal; color: var(--ink); }

/* --- stat cards (images, links, network) --- */
.stat-row-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat-row-grid.two{ grid-template-columns: repeat(2, 1fr); }
.stat-card{
  padding: 22px;
  display:flex;
  flex-direction:column;
  gap: 6px;
  justify-content:center;
}
.stat-card .val{
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight:600;
  color: var(--pine);
}
.stat-card .val.good{ color: var(--moss); }
.stat-card .val.warn{ color: var(--amber-deep); }
.stat-card .val.bad{ color: var(--alert); }
.stat-card .lbl{ font-size: 13.5px; color: var(--ink-soft); }

.ratio-bar{
  margin-top: 6px;
  height: 8px;
  border-radius: 6px;
  background: rgba(194,75,63,0.15);
  overflow:hidden;
}
.ratio-bar-fill{ height:100%; background: var(--moss); border-radius:6px; }

/* --- technical SEO checklist --- */
.checklist{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.checklist-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 18px 22px;
  gap: 12px;
}
.checklist-item-left{ display:flex; align-items:center; gap: 14px; }
.check-icon{
  width: 34px; height:34px;
  border-radius: 9px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.check-icon.good{ background: rgba(63,166,114,0.14); }
.check-icon.bad{ background: rgba(194,75,63,0.12); }
.check-icon svg{ width:18px; height:18px; }
.checklist-item-title{ font-size: 15px; font-weight:600; color: var(--pine); }
.checklist-item-sub{ font-size: 12.5px; color: var(--ink-soft); margin-top:2px; font-family: var(--font-mono); word-break: break-all; }

/* --- score breakdown (how the number was reached) --- */
.breakdown{ padding: 8px 0; }
.breakdown-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 11px 22px;
  font-size: 14px;
}
.breakdown-row + .breakdown-row{ border-top: 1px solid var(--line); }
.breakdown-label{ color: var(--ink-soft); }
.breakdown-label .detail{
  display:block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #8A968F;
  margin-top: 2px;
}
.breakdown-points{
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--pine);
  flex-shrink:0;
}
.breakdown-points.zero{ color: var(--alert); }
.breakdown-points.partial{ color: var(--amber-deep); }

/* ============ PERFORMANCE PAGE ============ */
.summary-stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.network-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* Slightly smaller figures in these two grids, matching the reference. */
.summary-stats .stat-card .val,
.network-grid .stat-card .val{ font-size: 28px; }

/* --- Core Web Vitals --- */
.vitals-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.vital-card{ padding: 24px 22px; }
.vital-tag{
  display:inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight:600;
  color: var(--pine);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.vital-value{
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight:600;
  color: var(--pine);
  line-height:1;
  margin-bottom: 10px;
}
.vital-name{
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.vital-rating{ padding-top: 4px; }

/* Vitals arrive after the page does (PageSpeed is slow), so the cards start as
   a shimmering skeleton that vitals.js replaces. */
.vital-card.loading .vital-value,
.vital-card.loading .vital-name{
  background: linear-gradient(90deg, var(--line) 25%, #EDF1ED 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 5px;
  color: transparent;
}
.vital-card.loading .vital-value{ width: 70%; height: 30px; }
.vital-card.loading .vital-name{ width: 100%; height: 13px; }
@keyframes shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* Shown when PageSpeed Insights is unavailable - never fake the numbers. */
.vitals-unavailable{
  padding: 26px 24px;
  display:flex;
  gap: 14px;
  align-items:flex-start;
}
.vitals-unavailable svg{ width:20px; height:20px; flex-shrink:0; color: var(--amber-deep); margin-top:2px; }
.vitals-unavailable strong{ display:block; font-size:15px; color: var(--pine); margin-bottom:4px; }
.vitals-unavailable p{ font-size: 14px; color: var(--ink-soft); }

/* --- resource tables --- */
.resource-table{ overflow:hidden; }
.resource-row{
  display:grid;
  grid-template-columns: 1fr 110px 100px 110px;
  gap: 14px;
  align-items:center;
  padding: 15px 22px;
}
.resource-row.head{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform:uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.resource-row + .resource-row{ border-top: 1px solid var(--line); }
.resource-row.head + .resource-row{ border-top:none; }
.resource-name{
  font-size: 14px;
  color: var(--pine);
  font-weight:500;
  word-break: break-word;
}
.resource-name .path{
  display:block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  font-weight:400;
  margin-top: 2px;
  word-break: break-all;
}
.resource-type{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.resource-size, .resource-time{
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink);
  text-align:right;
}

/* Nothing to list - a good outcome for the render-blocking table. */
.table-empty{
  padding: 26px 22px;
  display:flex;
  align-items:center;
  gap: 12px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.table-empty svg{ width:18px; height:18px; color: var(--moss); flex-shrink:0; }

/* ============ MONITORING PAGE ============ */
.monitor-summary{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.monitor-status-card{
  padding: 44px 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap: 18px;
}
.status-ring{
  width: 108px; height:108px;
  border-radius: 50%;
  background: rgba(63,166,114,0.12);
  display:flex; align-items:center; justify-content:center;
  position:relative;
}
.status-ring::before{
  content:"";
  position:absolute; inset:0;
  border-radius:50%;
  border: 2px solid rgba(63,166,114,0.35);
  animation: ripple 2.6s ease-out infinite;
}
/* Down / warning variants of the ripple ring. */
.status-ring.warn{ background: rgba(227,169,63,0.14); }
.status-ring.warn::before{ border-color: rgba(227,169,63,0.4); }
.status-ring.bad{ background: rgba(194,75,63,0.12); }
.status-ring.bad::before{ border-color: rgba(194,75,63,0.38); }
@keyframes ripple{
  0%{ transform: scale(0.9); opacity: .8; }
  100%{ transform: scale(1.35); opacity: 0; }
}
.status-ring svg{ width:44px; height:44px; position:relative; z-index:1; }
.monitor-status-label{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight:600;
  color: var(--pine);
}
.monitor-status-sub{
  font-size: 14.5px;
  color: var(--ink-soft);
  max-width: 320px;
}
.monitor-status-url{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
  width: 100%;
  word-break: break-all;
}

.status-code-card{
  padding: 44px 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap: 14px;
}
.status-code-card .status-code-num{ font-size: 64px; }
.status-code-title{
  font-size: 17px;
  font-weight:600;
  color: var(--pine);
}
.status-code-desc{
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 320px;
}
.status-code-meta{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:center;
  margin-top: 4px;
}

/* Redirect chain, listed when a site only answers after one or more hops. */
.redirect-chain{
  margin-top: 22px;
  padding: 18px 22px;
}
.redirect-chain h3{
  font-family: var(--font-body);
  font-size: 14px;
  font-weight:600;
  color: var(--pine);
  margin-bottom: 12px;
}
.redirect-chain li{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 6px 0;
  word-break: break-all;
}
.redirect-chain li + li{ border-top: 1px dashed var(--line); }
.redirect-chain .code{ color: var(--amber-deep); font-weight:600; margin-right:8px; }

/* ============ LOADING OVERLAY ============ */
/* Shown by scan.js while the browser waits for the report to come back. A scan
   takes a few seconds, and a blank tab with a spinner feels broken. */
.scan-overlay{
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(241,244,241,0.92);
  backdrop-filter: blur(3px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 20px;
  padding: 32px;
  text-align:center;
}
.scan-overlay[hidden]{ display:none; }
.scan-overlay .heart{
  width: 52px; height:52px;
  color: var(--moss);
  animation: heartbeat 1.4s ease-in-out infinite;
}
.scan-overlay h2{ font-size: 24px; color: var(--pine); }
.scan-overlay p{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 380px;
}
.scan-overlay .bar{
  width: min(320px, 80vw);
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow:hidden;
}
.scan-overlay .bar span{
  display:block;
  height:100%;
  width: 40%;
  border-radius: 4px;
  background: var(--moss);
  animation: sweep 1.6s ease-in-out infinite;
}
@keyframes sweep{
  0%{ transform: translateX(-100%); }
  100%{ transform: translateX(350%); }
}

/* ============ RATE LIMIT / ERROR PAGES ============ */
.notice-page{
  padding: 90px 0 110px;
  text-align:center;
}
.notice-card{
  max-width: 620px;
  margin: 0 auto;
  padding: 52px 44px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 18px;
}
.notice-icon{
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(227,169,63,0.14);
  display:flex; align-items:center; justify-content:center;
}
.notice-icon svg{ width: 38px; height: 38px; color: var(--amber-deep); }
.notice-icon.bad{ background: rgba(194,75,63,0.1); }
.notice-icon.bad svg{ color: var(--alert); }
.notice-card h1{ font-size: clamp(26px,3.4vw,34px); color: var(--pine); }
.notice-card p{ font-size: 15.5px; color: var(--ink-soft); max-width: 440px; }
.notice-card .meta{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 4px;
  width: 100%;
}
.notice-actions{ display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin-top:6px; }

/* Countdown to when the visitor may try again (filled in by main.js). */
.retry-countdown{
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--pine);
}

/* ============ STATS PAGE (admin) ============ */
.stats-table{ overflow-x: auto; }
.stats-table table{ width:100%; border-collapse: collapse; min-width: 640px; }
.stats-table th, .stats-table td{
  text-align:left;
  padding: 12px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.stats-table th{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color: var(--ink-soft);
}
.stats-table td{ font-family: var(--font-mono); color: var(--pine); }
.stats-table tr:last-child td{ border-bottom: none; }
.stats-table td.zero{ color: #9AA6A0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px){
  .summary-grid{ grid-template-columns: 1fr; }
  .summary-stats{ grid-template-columns: 1fr; }
  .meta-grid{ grid-template-columns: 1fr; }
  .meta-grid .data-card.span-2{ grid-column: auto; }
  .heading-grid{ grid-template-columns: 1fr; }
  .stat-row-grid, .stat-row-grid.two{ grid-template-columns: 1fr; }
  .checklist{ grid-template-columns: 1fr; }
  .network-grid{ grid-template-columns: repeat(2,1fr); }
  .vitals-grid{ grid-template-columns: repeat(2,1fr); }
  /* Drop the last column rather than squeezing four into a phone width. */
  .resource-row{ grid-template-columns: 1fr 90px 90px; }
  .resource-row .resource-time{ display:none; }
}

@media (max-width: 860px){
  .monitor-summary{ grid-template-columns: 1fr; }
}

@media (max-width: 620px){
  .url-form{ flex-direction:column; }
  .url-form .btn{ width:100%; }
  .network-grid{ grid-template-columns: 1fr; }
  .vitals-grid{ grid-template-columns: 1fr; }
  .resource-row{ grid-template-columns: 1fr 80px; }
  .resource-row .resource-type{ display:none; }
  .monitor-status-card, .status-code-card{ padding: 34px 24px; }
  .status-code-card .status-code-num{ font-size: 52px; }
  .notice-card{ padding: 40px 24px; }
  .breakdown-row{ padding: 11px 18px; }
}
