/* CLARA - shared styles across landing + app
   Design system notes:
   - Neutral scale: Tailwind zinc, used for structure/text.
   - Single brand accent: indigo ("accent" in tailwind.config, renderer.tsx) —
     reserved for links, focus states, and "AI / smart feature" affordances,
     so it reads as a distinct signal from the near-black primary action color.
   - Semantic status colors (success/warning/danger/info) are applied via
     Tailwind utility classes per-component (green/amber/red/blue), but should
     always pair a light background with a matching border for definition —
     see .badge and .banner-* below.
*/

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.015em;
  line-height: 1.25;
}

p {
  line-height: 1.6;
}

/* Slightly better default readability for small/meta text used everywhere
   (badges, table meta rows, helper copy) without having to touch every
   Tailwind class in every page. */
.text-xs, .text-sm {
  letter-spacing: 0.005em;
}

/* ---------- Hero / brand backgrounds ---------- */
.gradient-hero {
  background: radial-gradient(circle at 15% 0%, #eef2ff 0%, transparent 55%),
    radial-gradient(circle at 100% 20%, #faf5ff 0%, transparent 50%),
    linear-gradient(135deg, #f8fafc 0%, #ffffff 60%);
}

.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-glow::before,
.hero-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.hero-glow::before {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, #a5b4fc, transparent 70%);
}
.hero-glow::after {
  width: 380px;
  height: 380px;
  top: 40px;
  right: -100px;
  background: radial-gradient(circle, #c4b5fd, transparent 70%);
}

/* ---------- Buttons ---------- */
.btn-primary {
  background-color: #18181b;
  color: #fafafa;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.08);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover {
  background-color: #27272a;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.3);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background-color: #fff;
  border: 1px solid #d4d4d8;
  color: #18181b;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-outline:hover {
  background-color: #f4f4f5;
  border-color: #a1a1aa;
  color: #18181b;
}
.btn-outline:active {
  transform: translateY(1px);
}
.btn-outline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Secondary "AI / smart" action style — same shape rhythm as
   btn-primary/btn-outline but tinted with the accent color, for the
   handful of AI-forward CTAs (Smart Filters, Ask CLARA, etc.) so they read
   as a distinct, intentional category of action rather than a random blue
   button. Opt-in: existing indigo buttons are untouched unless migrated. */
.btn-accent {
  background-color: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-accent:hover {
  background-color: #e0e7ff;
  border-color: #a5b4fc;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid #e4e4e7;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(15, 15, 20, 0.03), 0 1px 3px 0 rgba(15, 15, 20, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.card-hover:hover {
  box-shadow: 0 10px 24px -6px rgba(15, 15, 20, 0.1), 0 4px 8px -4px rgba(15, 15, 20, 0.06);
  border-color: #d4d4d8;
  transform: translateY(-2px);
}

/* Standard card section heading row (icon + title, optional trailing
   action/badge) — using this class keeps vertical rhythm/border consistent
   for cards that separate a header from body content. */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid #f4f4f5;
}

/* ---------- Nav ---------- */
.nav-link {
  color: #3f3f46;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}
.nav-link:hover {
  color: #18181b;
}

/* Small uppercase section label used throughout dashboard/landing pages
   ("Workspace", "Resources", "How It Works", stat captions, etc.) — a
   single class instead of repeating the same five utility classes inline
   everywhere, and keeps tracking/weight perfectly consistent. */
.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1aa;
}

/* simple fade-in for dashboard panels */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner {
  border: 2px solid #e4e4e7;
  border-top-color: #18181b;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Tables ---------- */
table.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
table.data-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #71717a;
  padding: 0.75rem 0.9rem;
  background: #fafafa;
  border-bottom: 1px solid #e4e4e7;
  white-space: nowrap;
}
table.data-table thead tr:first-child th:first-child {
  border-top-left-radius: 0.6rem;
}
table.data-table thead tr:first-child th:last-child {
  border-top-right-radius: 0.6rem;
}
table.data-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid #f4f4f5;
  font-size: 0.875rem;
  vertical-align: top;
  color: #27272a;
}
table.data-table tbody tr {
  transition: background-color 0.12s ease;
}
table.data-table tbody tr:hover td {
  background-color: #fafafa;
}
table.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* ---------- Inline banners / alerts (info, success, warning, danger) ----------
   A shared shape for the many one-off "<div class='card p-4 bg-X-50
   border-X-200 text-X-800 ...'>" alert blocks scattered across pages —
   opt-in class that standardizes padding/radius/icon alignment; the
   semantic color utility (bg-emerald-50 border-emerald-200 text-emerald-800,
   etc.) is still applied alongside it per-instance. */
.banner {
  border-radius: 0.75rem;
  border-width: 1px;
  padding: 0.9rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  position: relative;
  overflow: hidden;
}
.stat-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #18181b, #52525b);
  opacity: 0.85;
}

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #a1a1aa;
}
.empty-state i {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: #d4d4d8;
}

/* ---------- Scrollbar polish (webkit) ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

/* ---------- Focus rings ---------- */
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Checkboxes/radios pick up the same accent tint instead of default blue,
   so form controls feel like one coherent system. */
input[type="checkbox"], input[type="radio"] {
  accent-color: #18181b;
}
