/*
 * notiduck share page (R8 / 4.1a) — handwritten, no framework, no build step.
 * Colors mirror the Next.js page's Tailwind palette (stone + duckie #F6A600).
 * CSP is style-src 'self': no inline styles anywhere; sparklines and the
 * response-time chart are SVG presentation attributes, not CSS.
 */

/* ── Palette (Tailwind references, kept as comments for parity reviews)
   stone-900 #1c1917 · stone-800 #292524 · stone-700 #44403c · stone-600 #57534e
   stone-500 #78716c · stone-400 #a8a29e · stone-300 #d6d3d1 · stone-200 #e7e5e4
   stone-100 #f5f5f4 · duckie #F6A600 · red-500 #ef4444 · amber-400 #fbbf24
   green-400 #4ade80 · orange-400 #fb923c · emerald-400 #34d399 ── */

* { box-sizing: border-box; margin: 0; padding: 0; }

.share-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #292524;
  color: #F6A600;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Shared page heading (login, dashboard — moved from auth.css so both pages
   get it from the one stylesheet they both load). */
.auth-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f5f5f4;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background-color: rgba(68, 64, 60, 0.95);
  backdrop-filter: blur(8px);
  color: #F6A600;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(246, 166, 0, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo-link { display: flex; }
.logo-img { height: 1.5rem; width: auto; }
@media (min-width: 640px) { .logo-img { height: 2rem; } }

.btn-primary {
  display: inline-block;
  background-color: #F6A600;
  color: #292524;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover { background-color: #facc15; transform: scale(1.05); }
.btn-large { padding: 0.75rem 1.5rem; border-radius: 0.75rem; }

/* ── Main / card ─────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Full-page states (404, 500) sit vertically centered, like error.tsx's
   flex-1 items-center wrapper. */
.main-centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.monitor-card {
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: rgba(68, 64, 60, 0.3);
  border: 1px solid rgba(68, 64, 60, 0.3);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  color: #e7e5e4;
}

.monitor-card.card-offline { border-left: 4px solid #ef4444; }
.monitor-card.card-degraded { border-left: 4px solid #f59e0b; }

.card-padding { padding: 1rem; }
@media (min-width: 1024px) { .card-padding { padding: 1.5rem; } }

.title-block { margin-bottom: 1rem; }

.title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.status-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid;
  flex-shrink: 0;
}
.badge-offline { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.badge-degraded { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.badge-muted { background: rgba(120, 113, 108, 0.2); color: #d6d3d1; border-color: rgba(120, 113, 108, 0.4); }

.monitor-url {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f5f5f4;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.url-link { color: #F6A600; text-decoration: none; }
.url-link:hover { color: rgba(246, 166, 0, 0.8); text-decoration: underline; }

.page-title {
  font-size: 0.75rem;
  color: #a8a29e;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Degradation callout (amber-950/20 + border-amber-500/60) ────────── */

.degrade-banner {
  display: flex;
  gap: 0.75rem;
  background: rgba(69, 26, 3, 0.2);
  border-left: 2px solid rgba(245, 158, 11, 0.6);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.75rem;
  margin: 0.75rem 0;
}

.degrade-mark { color: #fbbf24; flex-shrink: 0; font-size: 0.875rem; }
.degrade-body { display: flex; flex-direction: column; gap: 0.375rem; }
.degrade-title { font-size: 0.75rem; font-weight: 500; color: #e7e5e4; line-height: 1.375; }
.degrade-text { font-size: 0.75rem; color: #a8a29e; line-height: 1.625; }

/* ── Sparkline rows ──────────────────────────────────────────────────── */

.sparkline-block { margin-top: 0.75rem; }

.sparkline-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: #a8a29e;
}
.legend-learning { color: #a8a29e; }

.spark-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.5rem;
  border-left: 4px solid transparent;
  margin-bottom: 0.125rem;
}
.spark-row.anomaly-problem { border-left-color: #F97316; }
.spark-row.anomaly-warning { border-left-color: #F59E0B; }

.spark-city {
  font-size: 0.75rem;
  color: #a8a29e;
  width: 5rem;
  flex-shrink: 0;
}

.anomaly-label {
  margin-left: 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.anomaly-label.anomaly-problem { color: #F97316; }
.anomaly-label.anomaly-warning { color: #F59E0B; }

.spark-chart { flex: 1; min-width: 0; }

.spark-svg {
  display: block;
  width: 100%;
  height: 40px;
}

.spark-empty {
  height: 1.5rem;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #a8a29e;
  font-style: italic;
}

.spark-times {
  display: flex;
  justify-content: space-between;
  color: #a8a29e;
  margin-top: 1px;
  font-size: 10px;
}

.spark-right {
  flex-shrink: 0;
  text-align: right;
  min-width: 72px;
}

.spark-learning { font-size: 0.75rem; color: #a8a29e; font-style: italic; }
.spark-eta { font-size: 0.75rem; color: #a8a29e; }
.spark-mean { font-size: 0.75rem; font-family: ui-monospace, monospace; color: #d6d3d1; }

/* ── Vitals strips ───────────────────────────────────────────────────── */

.vitals { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }

.vital-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.vital-label { display: flex; flex-direction: column; min-width: 130px; flex-shrink: 0; }
.vital-name { font-size: 0.75rem; font-weight: 600; color: #a8a29e; line-height: 1.25; }
.vital-sub { font-size: 10px; color: #a8a29e; line-height: 1.25; margin-top: 2px; }

.vital-divider { width: 1px; height: 1.5rem; background: #44403c; flex-shrink: 0; }

.vital-value { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.vital-key {
  font-size: 10px;
  color: #a8a29e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.25;
}
.vital-score { font-size: 0.875rem; font-weight: 600; line-height: 1.25; }
.vital-na { font-size: 0.875rem; color: #a8a29e; line-height: 1.25; }

.score-excellent { color: #4ade80; }
.score-good { color: #facc15; }  /* yellow-400: the server health score */
.score-fair { color: #fb923c; }
.score-poor { color: #f87171; }
.lh-good { color: #fbbf24; }  /* amber-400: the Lighthouse 70+ band */
.score-ai { color: #34d399; }

.report-link {
  display: flex;
  align-items: center;
  color: #a8a29e;
  margin-left: 0.25rem;
}
.report-link:hover { color: #e7e5e4; }
.external-icon { width: 0.875rem; height: 0.875rem; }

/* ── Expiry warnings ─────────────────────────────────────────────────── */

.expiry-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.expiry-item { color: #a8a29e; }
.expiry-days { font-weight: 500; color: #d6d3d1; }
.expiry-days.expiry-urgent-30 { color: #e7e5e4; }
.expiry-days.expiry-urgent-7 { color: #f5f5f4; }
.expiry-days.expiry-notfound { color: #e7e5e4; }
.expiry-date { color: #a8a29e; }

/* ── Server checks grid (ExpandedMonitorDetails' per-check evidence) ─── */

.checks-section {
  border-top: 1px solid rgba(68, 64, 60, 0.5);
  padding: 1rem;
}

.checks-title { font-size: 1rem; font-weight: 600; color: #F6A600; margin-bottom: 1.5rem; }

.check-category { margin-bottom: 1.5rem; }
.check-category:last-child { margin-bottom: 0; }

.check-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.check-cat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #d6d3d1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.check-cat-score { font-size: 0.75rem; font-family: ui-monospace, monospace; color: #a8a29e; }

.check-bar {
  width: 100%;
  height: 4px;
  display: block;
  margin-bottom: 0.75rem;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) { .check-grid { grid-template-columns: 1fr 1fr; } }

.check-card {
  background-color: #292524;
  padding: 1rem;
  border-radius: 0.5rem;
}
.check-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.check-name { font-size: 0.875rem; font-weight: 500; color: #e7e5e4; }
.check-points { font-size: 0.875rem; font-weight: 600; color: #d6d3d1; text-align: right; }
.check-message { font-size: 0.75rem; color: #a8a29e; }

/* ── Checked / added ─────────────────────────────────────────────────── */

.checked-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #a8a29e;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.dot-sep { color: #78716c; user-select: none; }

/* ── 24h response-time chart ─────────────────────────────────────────── */

.chart-section {
  border-top: 1px solid rgba(68, 64, 60, 0.5);
  padding: 1rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chart-title { font-size: 0.75rem; font-weight: 600; color: #a8a29e; }

.chart-legend { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 10px; color: #a8a29e; }
.legend-swatch { width: 8px; height: 8px; }

.chart-svg { width: 100%; height: 160px; }

/* ── About (the `_meta.about` block) ─────────────────────────────────── */

.about-section {
  border-top: 1px solid rgba(68, 64, 60, 0.5);
  padding: 1rem;
}

.about-text { font-size: 0.75rem; color: #a8a29e; line-height: 1.625; }
.about-text strong { color: #a8a29e; font-weight: 600; }
.about-notiduck { margin-top: 0.5rem; }
.about-summary { margin-top: 0.5rem; color: #a8a29e; }

/* ── Not found ───────────────────────────────────────────────────────── */

.notfound-box {
  max-width: 28rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.notfound-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: rgba(68, 64, 60, 0.5);
  margin-bottom: 1.5rem;
  margin-left: auto;
  margin-right: auto;
}

.warning-icon { width: 2rem; height: 2rem; color: #a8a29e; }

.notfound-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e7e5e4;
  margin-bottom: 0.75rem;
}

.notfound-text {
  color: #a8a29e;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  line-height: 1.625;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer {
  background: #1c1917;
  border-top: 1px solid #44403c;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; }
}

.footer-text { font-size: 0.75rem; color: #a8a29e; }
.footer-link { color: #F6A600; text-decoration: none; font-weight: 500; }
.footer-link:hover { color: rgba(246, 166, 0, 0.8); }
.footer-links { display: flex; align-items: center; gap: 1rem; font-size: 0.75rem; }
.footer-muted-link { color: #a8a29e; text-decoration: none; }
.footer-muted-link:hover { color: #a8a29e; }
