/* ===== SiteSleuth by ADGSTUDIOS ===== */

html, body { overflow-x: hidden; }
canvas { max-width: 100%; }

/* Plain CSS (not a Tailwind utility) so Chart.js always measures a real,
   already-applied box on first paint — Tailwind's CDN JIT injects rules for
   dynamically-added classes asynchronously, which is too late for Chart.js's
   initial synchronous size measurement. */
.chart-box { position: relative; width: 100%; height: 16rem; min-width: 0; }
.chart-box.chart-box-sm { height: 14rem; }

/* Live activity ticker */
.ticker-viewport { overflow: hidden; }
#ticker-text { animation: ticker-in 0.35s ease both; }
@keyframes ticker-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Recent audit cards */
.recent-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-radius: 1rem;
  padding: 1.1rem;
  display: block;
  transition: transform 0.2s, border-color 0.2s;
}
.recent-card:hover { transform: translateY(-3px); border-color: rgba(56, 240, 200, 0.3); }

#hero-glow {
  background:
    radial-gradient(600px 300px at 50% -10%, rgba(124, 92, 255, 0.35), transparent 70%),
    radial-gradient(500px 260px at 15% 20%, rgba(56, 240, 200, 0.18), transparent 70%),
    radial-gradient(500px 260px at 85% 10%, rgba(245, 196, 81, 0.12), transparent 70%);
}

/* Steps + features */
.step-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.25s, border-color 0.25s;
}
.step-card:hover { transform: translateY(-4px); border-color: rgba(56, 240, 200, 0.35); }
.step-num { font-family: "Space Grotesk", sans-serif; color: #38f0c8; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.2em; }
.step-card h3 { font-family: "Space Grotesk", sans-serif; color: #fff; font-weight: 600; margin: 0.5rem 0 0.35rem; }
.step-card p { color: #94a3b8; font-size: 0.9rem; line-height: 1.5; }

.feature {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d1220;
  border-radius: 1rem;
  padding: 1.5rem;
}
.feature .ico { font-size: 1.6rem; }
.feature h4 { font-family: "Space Grotesk", sans-serif; color: #fff; font-weight: 600; margin: 0.75rem 0 0.35rem; }
.feature p { color: #94a3b8; font-size: 0.9rem; line-height: 1.55; }

/* ===== Radar loader ===== */
.radar {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 240, 200, 0.06), transparent 70%);
  border: 1px solid rgba(56, 240, 200, 0.25);
  box-shadow: 0 0 60px -10px rgba(56, 240, 200, 0.4), inset 0 0 40px rgba(124, 92, 255, 0.1);
  overflow: hidden;
}
.radar-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image:
    repeating-radial-gradient(circle, transparent 0 34px, rgba(56, 240, 200, 0.12) 34px 35px),
    linear-gradient(rgba(56, 240, 200, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 240, 200, 0.1) 1px, transparent 1px);
  background-size: 100% 100%, 50% 50%, 50% 50%;
  background-position: center, center, center;
}
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(56, 240, 200, 0.55), transparent 25%);
  animation: sweep 2.4s linear infinite;
  mix-blend-mode: screen;
}
.radar-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(56, 240, 200, 0.7));
  animation: bob 2s ease-in-out infinite;
}
.radar-blip {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f5c451;
  box-shadow: 0 0 12px 2px rgba(245, 196, 81, 0.8);
  animation: blip 2.4s ease-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes blip { 0%, 100% { opacity: 0; transform: scale(0.4); } 15% { opacity: 1; transform: scale(1.3); } 60% { opacity: 0.2; } }

.dots::after { content: ""; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ===== Report ===== */
.reveal { animation: reveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-radius: 1.25rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}
.gauge-label { font-family: "Space Grotesk", sans-serif; }

/* Demo iframe frame */
.demo-frame {
  width: 100%;
  height: 480px;
  border: 0;
  border-radius: 0 0 1rem 1rem;
  background: #fff;
}

/* Print / PDF friendliness — the PDF is now real Chrome printing (Puppeteer),
   so these rules actively apply. Keep the dark brand theme (don't force a
   light background — the report is designed dark-on-dark with light text). */
@media print {
  #loader, header, footer, #hero-glow, #audit-form, #how, #features, #ticker-section, #recent, .no-print {
    display: none !important;
  }
  html, body { background: #070a12 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* The PDF is generated with zero page margin (lib/pdf.js) — a Puppeteer
     margin renders as blank, unprinted paper regardless of background, which
     showed up as a stark white frame around every page. Breathing room from
     the physical edge now comes from padding on the content itself. */
  #audit { padding: 10mm 9mm !important; }

  /* Chrome has a long-standing bug where a CSS Grid that doesn't fit in the
     remaining page space gets DUPLICATED across the page break instead of
     cleanly split or moved — the 4-gauge grid rendered in full on both page 1
     and page 2. Sidestep it entirely: every grid becomes a plain vertical
     stack for print (normal block flow paginates correctly). */
  .grid { display: block !important; }
  .grid > * { margin-bottom: 0.75rem; }

  /* Keep small, self-contained cards intact across a page break. The huge
     multi-category audit ledger is explicitly exempted — forcing 100+ audits
     to avoid breaking would leave a giant blank gap at the bottom of a page
     instead, which looks worse than a clean break between rows. */
  .card { break-inside: avoid; }
  .card.card-breakable { break-inside: auto; }
  details, tr { break-inside: avoid; }

  /* Scrollable boxes (raw WHOIS, overflow tables) must show FULL content in
     print — a page can't scroll, so a fixed max-height here would silently
     truncate text instead of just becoming scrollable. */
  .card-breakable pre, .overflow-auto, .overflow-x-auto {
    max-height: none !important;
    overflow: visible !important;
  }
}
