/* Design tokens ported from the Citizen Playbook app (citizenplaybook.app)
   for visual consistency across the two public-facing tools. */
:root {
  --background: #FFFFFE;
  --foreground: #00000e;
  --card: #F9F9F8;
  --border: hsl(60 2.6% 54.5%);
  --link: #205cff;
  --radius: .75rem;

  --font-sans: 'Google Sans Flex', 'Google Sans', system-ui, -apple-system, sans-serif;

  /* Type scale — Perfect Fourth (1.333), 1rem base */
  --step-0: 1rem;
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: 3.157rem;

  --status-passed: #1e7d34;
  --status-vetoed: #b3261e;
  --status-progress: #205cff;
  --status-default: #6b6b66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.55;
  background: var(--background);
  color: var(--foreground);
}

h1, h2, h3 {
  color: var(--foreground);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}
/* In-app sizing (this is a utility page, not a marketing hero) */
h1 { font-size: var(--step-3); font-weight: 600; }
h2 { font-size: var(--step-2); font-weight: 600; }
h3 { font-size: var(--step-1); font-weight: 500; }

.header {
  background: linear-gradient(135deg, #00000e 0%, #101b4d 55%, #205cff 130%);
  padding: 40px 24px 64px;
}
.header-inner { max-width: 1100px; margin: 0 auto; }
.header-brand {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}
.header h1 { color: #FFFFFE; }
.header-sub { margin: 8px 0 0; font-size: 0.9375rem; color: rgba(255,255,255,0.75); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* Glassmorphism — floats over the header's gradient so it actually reads as glass */
.cp-glass {
  background: rgba(255, 255, 255, 0.19);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.50),
    inset 0 -1px 0 rgba(255, 255, 255, 0.10),
    inset 0 0 36px 6px rgba(255, 255, 255, 0.22);
  position: relative;
  overflow: hidden;
}
.cp-glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
}
.cp-glass::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent, rgba(255,255,255,0.3));
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px;
  margin-top: -40px;
  margin-bottom: 16px;
}
.filters input, .filters select {
  padding: 10px 12px;
  border: 1px solid rgba(0,0,14,0.15);
  border-radius: calc(var(--radius) - 4px);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  background: rgba(255,255,255,0.85);
  color: var(--foreground);
}
.filters input { flex: 1 1 260px; }
.filters select { flex: 0 1 180px; }

.stats {
  font-size: 0.875rem;
  color: #57574f;
  margin-bottom: 10px;
}

#table-wrap {
  background: var(--background);
  border: 1px solid rgba(0,0,14,0.12);
  border-radius: var(--radius);
  overflow-x: auto;
}

table.bills {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.bills th {
  text-align: left;
  background: var(--card);
  color: var(--foreground);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,14,0.10);
  white-space: nowrap;
}
table.bills td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,14,0.06);
  vertical-align: top;
}
table.bills tbody tr.bill-row { cursor: pointer; }
table.bills tbody tr.bill-row:hover { background: var(--card); }
.bill-number { font-weight: 500; white-space: nowrap; }

.bill-link { color: var(--link); text-decoration: none; font-size: 0.875rem; }
.bill-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
}
.status-passed, .status-enrolled { background: var(--status-passed); }
.status-vetoed, .status-failed { background: var(--status-vetoed); }
.status-introduced, .status-engrossed, .status-prefiled { background: var(--status-progress); }
.status-default { background: var(--status-default); }

tr.detail-row td { background: #fdfdfc; padding: 0; }
.detail-content { padding: 18px 16px; }

/* The bills table is wider than the screen on mobile and scrolls
   horizontally — pin the expanded detail content to the visible area
   instead of letting it scroll off with the rest of the row. */
@media (max-width: 640px) {
  .detail-content {
    position: sticky;
    left: 0;
    width: calc(100vw - 32px);
    box-sizing: border-box;
  }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.detail-tile {
  background: var(--card);
  border-radius: calc(var(--radius) - 4px);
  padding: 10px 12px;
  font-size: 0.8125rem;
}
.detail-tile span { display: block; color: #6b6b66; font-size: 0.75rem; margin-bottom: 2px; }

.save-row { display: flex; gap: 8px; margin-bottom: 14px; }
.print-footer { display: none; }

.analysis-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-bottom: 12px;
}
.analysis-box p, .qa-answer p { margin: 0 0 10px; }
.analysis-box p:last-child, .qa-answer p:last-child { margin-bottom: 0; }
.analysis-box h3, .analysis-box h4, .analysis-box h5,
.qa-answer h3, .qa-answer h4, .qa-answer h5 { margin: 0 0 8px; font-size: var(--step-1); font-weight: 500; }
.analysis-box ul, .qa-answer ul { margin: 0 0 10px 18px; padding: 0; }

/* Buttons — solid ink or 1px ink outline, per brand spec.
   Also used on <a> tags (e.g. the PDF download link), so reset anchor
   defaults (underline, inline layout) rather than assuming a <button>. */
.cp-btn-solid, .cp-btn-outline {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.cp-btn-solid {
  background: var(--foreground);
  color: var(--background);
  border: 1px solid var(--foreground);
}
.cp-btn-solid:hover { opacity: 0.88; }
.cp-btn-solid:disabled { opacity: 0.5; cursor: default; }

.cp-btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--foreground);
}
.cp-btn-outline:hover { background: var(--card); }
.cp-btn-outline:disabled { opacity: 0.4; cursor: default; }

.qa-row { display: flex; gap: 8px; margin-top: 12px; }
.qa-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid rgba(0,0,14,0.15);
  border-radius: calc(var(--radius) - 4px);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.qa-answer {
  margin-top: 10px;
  font-size: 0.875rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  input[type="text"], input[type="search"], select {
    font-size: 16px !important; /* prevent iOS auto-zoom */
  }
}

.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b6b66;
}
.footer a { color: var(--link); text-decoration: none; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Printing / saving a bill — isolate just the expanded row's content,
   hide everything interactive (search, filters, other rows, buttons). */
@media print {
  body { background: #fff; }
  .header { background: none; padding: 0 0 16px; }
  .header-brand, .header h1, .header-sub { color: #00000e; }
  .filters, .stats, .pagination, .footer,
  table.bills thead, tr.bill-row, .save-row, .cp-btn-solid, .qa-row {
    display: none !important;
  }
  #table-wrap { border: none; overflow: visible; }
  tr.detail-row td { padding: 0; }
  .detail-content { position: static !important; width: auto !important; }
  #qa-answer:empty { display: none; }
  .print-footer {
    display: block;
    margin-top: 24px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    font-size: 11px;
    color: #888;
  }
}
