@tailwind base;
@tailwind components;
@tailwind utilities;

/* Dossier Editorial Stylesheet — Inspired by ERP.AI & ProtoAgent.AI */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-sand: #fbfbfa;
  --bg-card: #ffffff;
  --bg-subtle: #f5f5f4;
  --border-subtle: #e7e5e4;
  --border-strong: #d6d3d1;
  --text-main: #09090b;
  --text-muted: #71717a;
  --accent-gold: #facc15;
  --accent-gold-hover: #eab308;
}

html.dark {
  --bg-sand: #0c0a09;
  --bg-card: #1c1917;
  --bg-subtle: #292524;
  --border-subtle: #292524;
  --border-strong: #44403c;
  --text-main: #fafaf9;
  --text-muted: #a8a29e;
  --accent-gold: #facc15;
  --accent-gold-hover: #fde047;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-sand);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Dark mode overrides for editorial clarity */
html.dark header {
  background-color: rgba(12, 10, 9, 0.88) !important;
  border-color: #292524 !important;
}

html.dark footer {
  background-color: #0c0a09 !important;
  border-color: #292524 !important;
}

html.dark .bg-white {
  background-color: #171717 !important;
  color: #fafaf9 !important;
}

html.dark .bg-sand-50,
html.dark [class*="bg-sand-50"] {
  background-color: #121110 !important;
}

html.dark .bg-sand-100,
html.dark [class*="bg-sand-100"] {
  background-color: #1c1a19 !important;
}

html.dark .border-sand-200,
html.dark .border-sand-100,
html.dark .border-sand-300,
html.dark [class*="border-sand-"] {
  border-color: #262422 !important;
}

html.dark [class*="shadow-"] {
  box-shadow: none !important;
}

html.dark .divide-sand-200 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-sand-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: #2b2927 !important;
}

html.dark .text-zinc-950,
html.dark .text-zinc-900,
html.dark .text-zinc-800 {
  color: #fafaf9 !important;
}

html.dark .text-zinc-700,
html.dark .text-zinc-600 {
  color: #d4d4d8 !important;
}

html.dark .text-zinc-500,
html.dark .text-zinc-400 {
  color: #a1a1aa !important;
}

html.dark .bg-zinc-950 {
  background-color: #27272a !important;
  color: #ffffff !important;
}

html.dark .bg-zinc-100,
html.dark [class*="bg-zinc-100"] {
  background-color: #201e1d !important;
}

html.dark .border-zinc-200,
html.dark [class*="border-zinc-200"] {
  border-color: #2b2927 !important;
}

html.dark input,
html.dark textarea,
html.dark select {
  background-color: #1c1a19 !important;
  border-color: #383533 !important;
  color: #fafaf9 !important;
}

html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  border-color: #71717a !important;
  outline: none;
}

/* Subtle focus ring */
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

/* Clean Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d6d3d1;
  border-radius: 3px;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #44403c;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8a29e;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #57534e;
}

/* Micro-badge pulse */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.pulse-dot {
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Shimmer scanline effect for active sandbox */
@keyframes shimmer-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.shimmer-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.15), transparent);
  animation: shimmer-sweep 2s ease-in-out infinite;
}

/* Telemetry number styling */
.tabular-numbers {
  font-variant-numeric: tabular-nums;
}

/* Print optimizations */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  header, footer, #evalForm, #recentRuns, .no-print {
    display: none !important;
  }
  #resultsSection {
    display: block !important;
  }
  .shadow-sm, .shadow-md, .shadow-lg {
    box-shadow: none !important;
  }
  .border-sand-200, .border-sand-100 {
    border-color: #cccccc !important;
  }
}
