/* =====================================================================
   VeriFOIA — Custom animations, glass surfaces & scrollbars
   Layered on top of Tailwind CDN utilities.
   ===================================================================== */

:root {
  --navy: #0B132B;
  --charcoal: #1C2541;
  --cyan: #48CAE4;
  --electric: #0096FF;
}

html, body { background-color: var(--navy); }

/* ---------- Frosted glass surface ---------- */
.glass {
  background: rgba(28, 37, 65, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.glass-strong {
  background: rgba(11, 19, 43, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(72, 202, 228, 0.14);
}

/* ---------- Verified badge: pulsing green glow ---------- */
.verified-badge {
  position: relative;
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: verifiedPulse 2.4s ease-in-out infinite;
}
.verified-badge .dot {
  background: #34D399;
  box-shadow: 0 0 8px 2px rgba(52, 211, 153, 0.8);
}
@keyframes verifiedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Entity tag color coding ---------- */
.entity-person       { color:#93C5FD; background:rgba(59,130,246,.12); border-color:rgba(59,130,246,.35); }
.entity-organization { color:#6EE7B7; background:rgba(16,185,129,.12); border-color:rgba(16,185,129,.35); }
.entity-location     { color:#FCA5A5; background:rgba(239,68,68,.12);  border-color:rgba(239,68,68,.35); }
.entity-amount       { color:#FDE68A; background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.35); }
.entity-date         { color:#C4B5FD; background:rgba(139,92,246,.12); border-color:rgba(139,92,246,.35); }

/* ---------- Skeleton loading shimmer ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg,
    transparent,
    rgba(72, 202, 228, 0.12),
    transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Glow utilities ---------- */
.glow-cyan { box-shadow: 0 0 24px rgba(72, 202, 228, 0.35); }
.text-glow { text-shadow: 0 0 24px rgba(72, 202, 228, 0.45); }

/* ---------- Dropzone (verify.php) ---------- */
.dropzone {
  border: 2px dashed rgba(72, 202, 228, 0.35);
  transition: all .2s ease;
}
.dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(72, 202, 228, 0.08);
  box-shadow: 0 0 40px rgba(72, 202, 228, 0.25) inset;
}

/* ---------- Custom scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(72,202,228,.4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--electric), var(--cyan));
  border-radius: 999px;
  border: 2px solid var(--navy);
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ---------- Prose tweaks for AI summary ---------- */
.summary-prose { line-height: 1.75; color: #CBD5E1; }
.summary-prose::first-letter {
  font-size: 2.4rem; font-weight: 700; color: var(--cyan);
  float: left; line-height: 1; padding-right: .5rem; padding-top: .25rem;
}

/* ---------- Hash monospace block ---------- */
.hash-chip {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  word-break: break-all;
  letter-spacing: .02em;
}

/* =====================================================================
   Theme toggle icons  (dark = default, .light = day mode)
   ===================================================================== */
[x-cloak] { display: none !important; }
.theme-sun  { display: none; }
.theme-moon { display: block; }
html.light .theme-sun  { display: block; }
html.light .theme-moon { display: none; }

/* =====================================================================
   Ad slots
   ===================================================================== */
.ad-slot {
  margin: 0 auto;
  text-align: center;
  border-radius: 1rem;
  overflow: hidden;
}
.ad-slot .ad-label {
  display: block;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .35rem;
}
.ad-slot .ad-body { min-height: 1px; }
.ad-slot-header { max-width: 970px; }
.ad-slot-footer { max-width: 970px; }
.ad-slot-infeed { width: 100%; }
/* Give empty/loading AdSense units a subtle placeholder box */
.ad-slot .ad-body:empty::before,
.ad-slot ins.adsbygoogle:not([data-ad-status]) {
  display: block;
  min-height: 90px;
}

/* =====================================================================
   DAY (LIGHT) MODE
   The site is dark-first; these overrides recolour surfaces, text and
   borders when <html> has the .light class. Selector specificity
   (html.light .x) beats the base Tailwind utilities without !important.
   ===================================================================== */
html.light { --navy: #eef2f8; --charcoal: #ffffff; }
html.light, html.light body { background-color: #eef2f8; color: #1e293b; }

/* Ambient background blobs — soften for light */
html.light .bg-electric\/20 { background-color: rgba(0,150,255,0.10) !important; }
html.light .bg-cyan\/10     { background-color: rgba(72,202,228,0.12) !important; }

/* Glass surfaces */
html.light .glass {
  background: rgba(255,255,255,0.72);
  border-color: rgba(15,23,42,0.08);
  box-shadow: 0 8px 30px rgba(15,23,42,0.08);
}
html.light .glass-strong {
  background: rgba(255,255,255,0.9);
  border-color: rgba(72,202,228,0.30);
}

/* Text colours */
html.light .text-white { color: #0f172a; }
html.light .text-slate-200 { color: #1e293b; }
html.light .text-slate-300 { color: #334155; }
html.light .text-slate-400 { color: #475569; }
html.light .text-slate-500 { color: #64748b; }
html.light .text-cyan { color: #0891b2; }

/* Surfaces / fills that were dark */
html.light .bg-navy { background-color: #eef2f8; }
html.light .bg-charcoal { background-color: #ffffff; }
html.light .bg-black\/30 { background-color: rgba(15,23,42,0.04); }
html.light .bg-black\/40 { background-color: rgba(15,23,42,0.05); }
html.light .bg-white\/5 { background-color: rgba(15,23,42,0.04); }
html.light .bg-white\/10 { background-color: rgba(15,23,42,0.06); }
html.light .hover\:bg-white\/5:hover { background-color: rgba(15,23,42,0.05); }

/* Borders / rings */
html.light .border-white\/5 { border-color: rgba(15,23,42,0.08); }
html.light .border-white\/10 { border-color: rgba(15,23,42,0.10); }
html.light .ring-white\/10 { --tw-ring-color: rgba(15,23,42,0.12); }
html.light .divide-white\/5 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(15,23,42,0.08); }

/* Inputs */
html.light input, html.light textarea, html.light select { color: #0f172a; }
html.light input::placeholder, html.light textarea::placeholder { color: #94a3b8; }

/* Cyan accent chips stay legible */
html.light .bg-cyan\/10 { background-color: rgba(8,145,178,0.10); }
html.light .bg-cyan\/15 { background-color: rgba(8,145,178,0.12); }
html.light .ring-cyan\/30 { --tw-ring-color: rgba(8,145,178,0.35); }

/* Emerald text (SHA-256 fingerprint, verified badge, success states) —
   the light 200/300 shades are invisible on light backgrounds; darken them. */
html.light .text-emerald-200 { color: #047857; }   /* emerald-700 */
html.light .text-emerald-300 { color: #059669; }   /* emerald-600 */
html.light .text-emerald-300\/80 { color: rgba(4,120,87,0.95); }
html.light .text-emerald-400 { color: #059669; }
html.light .verified-badge { color: #047857; background: rgba(16,185,129,0.12); border-color: rgba(5,150,105,0.45); }
html.light .verified-badge .dot { background:#059669; box-shadow:0 0 6px 1px rgba(5,150,105,.6); }
/* Amber (draft / warnings) legible in light */
html.light .text-amber-300 { color: #b45309; }
html.light .text-amber-400 { color: #d97706; }
/* Red (no-match) legible in light */
html.light .text-red-300 { color: #b91c1c; }
html.light .text-red-400 { color: #dc2626; }

/* Summary drop-cap + prose in light */
html.light .summary-prose { color: #334155; }
html.light .summary-prose::first-letter { color: #0891b2; }

/* Gradient buttons keep navy text — but the "V" logo mark text stays navy (fine) */
html.light .text-navy { color: #0B132B; }

/* Scrollbar track in light */
html.light ::-webkit-scrollbar-thumb { border-color: #eef2f8; }

/* =====================================================================
   Mobile polish
   ===================================================================== */
@media (max-width: 640px) {
  h1 { line-height: 1.1; }
  .hash-chip { font-size: 11px; }
  /* PDF embeds: shorter, tappable on phones */
  embed[type="application/pdf"] { height: 60vh !important; min-height: 380px; }
  /* Prevent any wide element from causing horizontal scroll */
  body { overflow-x: hidden; }
}
