﻿/* ============================================================
   PigDrop — protected report styles (dark, print-ready)
   ============================================================ */

:root {
  --bg: #09090b;
  --surface: #131316;
  --surface-2: #18181b;
  --border: #27272a;
  --text: #f4f4f5;
  --text-soft: #a1a1aa;
  --text-faint: #71717a;
  --accent: #fafafa;
  --accent-strong: #fafafa;
  --accent-soft: rgba(250,250,250,0.06);
  --accent-border: #26262a;
  --warn: #fafafa;
  --warn-soft: rgba(250,250,250,0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-w: 1000px;
  font-family: "Outfit", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(1000px 460px at 85% -10%, rgba(16, 185, 129, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

svg { flex-shrink: 0; }

/* ---------- Header ---------- */

.report-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.report-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 32px);
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228, 228, 231, 0.08);
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.report-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--accent-strong);
  background: linear-gradient(160deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent-border);
}

.report-brand__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.report-actions { display: flex; align-items: center; gap: 12px; }

.report-ref {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 160ms ease;
}

.report-btn:hover { border-color: var(--text-faint); }
.report-btn:active { transform: translateY(1px) scale(0.98); }

/* ---------- Main ---------- */

.report-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 32px) 48px;
}

.report-title { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; }
.report-subtitle { margin: 0 0 24px; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Cards ---------- */

.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  margin-bottom: 16px;
}

.card--accent {
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.09), rgba(24, 24, 27, 0.6));
  border-color: var(--accent-border);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card__head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }

.card__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

/* ---------- Overview grid ---------- */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.overview {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.overview--span-2 { grid-column: span 2; }

.overview__label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.overview__value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.overview__value--accent { color: var(--accent-strong); }
.overview__value--mono { font-family: "JetBrains Mono", monospace; font-size: 0.95rem; }

/* ---------- Sources ---------- */

.source {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 16px;
  margin-bottom: 12px;
}

.source--empty { border-left-color: var(--text-faint); opacity: 0.85; }

.source__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.source__name {
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  word-break: break-word;
}

.source__desc { color: var(--text-soft); font-size: 0.9rem; line-height: 1.5; margin-bottom: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill--found { color: var(--accent-strong); background: var(--accent-soft); border: 1px solid var(--accent-border); }
.pill--none { color: var(--text-faint); background: var(--surface-3, #1f1f23); border: 1px solid var(--border); }

/* ---------- Fields table ---------- */

.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.field-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-faint);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.field-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(228, 228, 231, 0.06);
  vertical-align: top;
  word-break: break-word;
}

.field-table td:first-child {
  color: var(--accent-strong);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  width: 36%;
}

.field-table tr:last-child td { border-bottom: none; }

/* ---------- Empty state ---------- */

.state-box { text-align: center; padding: 44px 20px; }

.state-box__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.state-box h2 { margin: 0 0 6px; }
.state-box p { margin: 0; color: var(--text-soft); line-height: 1.5; }

/* ---------- Skeletons ---------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  animation: shimmer 1.4s infinite;
}

.skeleton--title { height: 34px; width: 40%; margin-bottom: 20px; }
.skeleton--card { height: 120px; margin-bottom: 14px; }

@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Error state ---------- */

.error-box {
  display: grid;
  place-items: center;
  min-height: 50vh;
  text-align: center;
  padding: 24px;
}

.error-box h1 { font-size: 1.4rem; margin: 0 0 8px; }
.error-box p { color: var(--text-soft); margin: 0 0 20px; }

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--accent-strong), var(--accent));
  color: #06281d;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

/* ---------- Footer ---------- */

.report-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-faint);
  font-size: 0.82rem;
  border-top: 1px solid rgba(228, 228, 231, 0.06);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .overview--span-2 { grid-column: span 2; }
  .report-header { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .overview-grid { grid-template-columns: 1fr; }
  .overview--span-2 { grid-column: auto; }
}

/* ---------- Print ---------- */

@media print {
  :root { color-scheme: light; }

  body {
    background: #ffffff !important;
    color: #18181b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print { display: none !important; }

  .report-header {
    position: static;
    background: #ffffff !important;
    border-bottom: 2px solid #18181b;
    padding: 0 0 12px;
  }

  .report-brand__mark { border-color: #18181b; color: #18181b; }
  .report-brand__tag { color: #18181b; border-color: #18181b; }

  .report-main { padding: 20px 0 0; max-width: none; }

  .card, .source, .overview {
    background: #ffffff !important;
    border-color: #d4d4d8 !important;
    box-shadow: none;
    break-inside: avoid;
  }

  .card--accent, .pill--found {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #18181b !important;
  }

  .overview__value--accent, .field-table td:first-child { color: #18181b !important; }
  .source { border-left-color: #18181b; }
  .field-table td { border-bottom-color: #e4e4e7; }
  .report-footer { color: #71717a; }
}
