/* VoteTheFacts — Clean Political Information Design */
:root {
  --navy: #1a365d;
  --navy-light: #2a4a7f;
  --red: #c53030;
  --red-light: #feb2b2;
  --red-bg: #fff5f5;
  --blue: #2b6cb0;
  --blue-light: #bee3f8;
  --blue-bg: #ebf8ff;
  --purple: #6b46c1;
  --purple-light: #d6bcfa;
  --gray-50: #f7fafc;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e0;
  --gray-400: #a0aec0;
  --gray-500: #718096;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;
  --white: #ffffff;
  --green: #38a169;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-700);
  background: var(--gray-50);
  line-height: 1.6;
}

/* === NAV === */
nav {
  background: var(--navy);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 1.2rem;
}
.nav-brand span { opacity: 0.9; }
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}
.nav-mobile { display: none; cursor: pointer; color: white; font-size: 1.5rem; }

/* === HERO === */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 60px 24px 50px;
  text-align: center;
  color: var(--white);
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 32px;
}
.search-container {
  max-width: 640px;
  margin: 0 auto 20px;
  position: relative;
}
.search-container input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  font-size: 1.1rem;
  background: rgba(255,255,255,0.12);
  color: white;
  outline: none;
  transition: all 0.2s;
}
.search-container input::placeholder { color: rgba(255,255,255,0.6); }
.search-container input:focus {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.18);
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.6;
}
.zip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.zip-row label { font-size: 0.95rem; opacity: 0.8; }
.zip-row input {
  padding: 10px 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255,255,255,0.12);
  color: white;
  width: 120px;
  outline: none;
}
.zip-row input::placeholder { color: rgba(255,255,255,0.5); }
.zip-row button {
  padding: 10px 20px;
  background: var(--white);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
}
.zip-row button:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* === STATS BAR === */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
}
.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* === SECTIONS === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 48px 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
}
.section-header a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

/* === YOUR REPS (zip result) === */
#your-reps {
  display: none;
  background: var(--blue-bg);
  border: 1px solid var(--blue-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}
#your-reps h3 {
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 16px;
}
.reps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* === TRENDING === */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.trending-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--navy);
  transition: all 0.15s;
}
.trending-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.trending-card .label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.trending-card h3 {
  font-size: 1.05rem;
  color: var(--gray-800);
  margin-bottom: 8px;
  line-height: 1.4;
}
.trending-card p {
  font-size: 0.9rem;
  color: var(--gray-500);
}
.trending-card .vote-result {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 10px;
}
.vote-passed { background: #c6f6d5; color: #276749; }
.vote-failed { background: #fed7d7; color: #9b2c2c; }

/* === CHAMBER TABS === */
.chamber-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
}
.chamber-tab {
  padding: 10px 24px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
}
.chamber-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar select, .filter-bar input {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--gray-700);
}
.filter-bar input { width: 220px; }
.member-count {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-left: auto;
}

/* === MEMBER CARDS === */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.member-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.member-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}
.member-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gray-200);
  flex-shrink: 0;
}
.member-photo.party-R { border-color: var(--red); }
.member-photo.party-D { border-color: var(--blue); }
.member-photo.party-I { border-color: var(--purple); }
.member-info { flex: 1; min-width: 0; }
.member-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 2px;
}
.party-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.party-badge.R { background: var(--red-bg); color: var(--red); }
.party-badge.D { background: var(--blue-bg); color: var(--blue); }
.party-badge.I { background: #faf5ff; color: var(--purple); }

/* === FOOTER === */
footer {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: 40px 24px;
  margin-top: 48px;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-about h3 { color: var(--white); margin-bottom: 12px; font-size: 1.1rem; }
.footer-about p { font-size: 0.85rem; line-height: 1.7; }
.footer-col h4 {
  color: var(--gray-300);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 3px 0;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--gray-700);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-mobile { display: block; }
  .hero { padding: 40px 16px 36px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  .stats-bar { gap: 24px; padding: 12px 16px; }
  .stat-number { font-size: 1.2rem; }
  .zip-row { flex-direction: column; }
  .members-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar input { width: 100%; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* === LOADING === */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  height: 80px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* === ISSUE PAGES === */
.issue-hero { background: var(--navy); color: var(--white); padding: 56px 24px 48px; text-align: center; }
.issue-hero .issue-tag { display: inline-block; background: rgba(255,255,255,0.15); border-radius: 20px; padding: 4px 14px; font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 16px; }
.issue-hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; }
.issue-hero p { font-size: 1.1rem; opacity: 0.85; max-width: 640px; margin: 0 auto; }
.issue-nav { background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 0 24px; display: flex; gap: 0; overflow-x: auto; }
.issue-nav a { padding: 14px 20px; font-size: 0.9rem; font-weight: 500; color: var(--gray-600); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.issue-nav a:hover, .issue-nav a.active { color: var(--navy); border-bottom-color: var(--navy); }

.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.fact-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; }
.fact-card .fact-number { font-size: 1.8rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.fact-card .fact-label { font-size: 0.9rem; color: var(--gray-600); margin-top: 6px; }
.fact-card .fact-source { font-size: 0.75rem; color: var(--gray-400); margin-top: 8px; }

.party-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.party-card { border-radius: var(--radius-lg); padding: 20px; }
.party-card.dem { background: var(--blue-bg); border: 1px solid var(--blue-light); }
.party-card.rep { background: var(--red-bg); border: 1px solid var(--red-light); }
.party-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.party-card.dem h4 { color: var(--blue); }
.party-card.rep h4 { color: var(--red); }
.party-card ul { list-style: none; padding: 0; }
.party-card ul li { padding: 6px 0; font-size: 0.9rem; border-bottom: 1px solid rgba(0,0,0,0.06); }
.party-card ul li:last-child { border-bottom: none; }
.party-card ul li::before { content: '• '; }

.votes-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9rem; }
.votes-table th { background: var(--gray-100); padding: 10px 14px; text-align: left; font-weight: 600; color: var(--gray-700); border-bottom: 2px solid var(--gray-200); }
.votes-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.votes-table tr:hover td { background: var(--gray-50); }
.vote-pct { display: inline-flex; align-items: center; gap: 6px; }
.vote-bar { height: 8px; border-radius: 4px; min-width: 4px; display: inline-block; }
.vote-bar.dem { background: var(--blue); }
.vote-bar.rep { background: var(--red); }
.vote-year { font-size: 0.78rem; color: var(--gray-400); }

/* Rep Lookup Widget */
.rep-lookup-widget { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 28px; }
.rep-lookup-widget h3 { font-size: 1.15rem; color: var(--navy); margin-bottom: 6px; }
.rep-lookup-desc { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 16px; }
.rep-lookup-form { display: flex; gap: 10px; flex-wrap: wrap; }
.rep-lookup-form input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 0.95rem; }
.rep-lookup-form input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,54,93,0.1); }
.rep-lookup-form button { padding: 10px 20px; background: var(--navy); color: var(--white); border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; white-space: nowrap; }
.rep-lookup-form button:hover { background: var(--navy-light); }
.rep-results { margin-top: 20px; }
.rep-group { margin-bottom: 24px; }
.rep-group h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); margin-bottom: 12px; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rep-card { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.rep-photo { flex-shrink: 0; }
.rep-photo img, .rep-initials { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.rep-initials { display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.9rem; }
.rep-name { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; }
.rep-party { color: white; font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.rep-office { font-size: 0.82rem; color: var(--gray-500); margin-top: 2px; }
.rep-contact { font-size: 0.82rem; color: var(--gray-600); margin-top: 4px; }
.rep-contact a { color: var(--blue); text-decoration: none; }
.rep-loading, .rep-error { color: var(--gray-500); font-size: 0.9rem; padding: 12px 0; }
.rep-fallback { padding: 16px; background: var(--blue-bg); border-radius: var(--radius); }

/* Subscribe CTA */
.subscribe-cta { background: var(--navy); color: var(--white); border-radius: var(--radius-lg); padding: 32px; text-align: center; margin-top: 8px; }
.subscribe-cta h3 { font-size: 1.3rem; margin-bottom: 8px; }
.subscribe-cta p { opacity: 0.8; font-size: 0.95rem; margin-bottom: 20px; }
.subscribe-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 480px; margin: 0 auto; }
.subscribe-form input { flex: 1; min-width: 200px; padding: 10px 14px; border-radius: var(--radius); border: none; font-size: 0.95rem; }
.subscribe-form button { padding: 10px 22px; background: var(--green); color: var(--white); border: none; border-radius: var(--radius); font-weight: 700; cursor: pointer; }
.subscribe-form button:hover { background: #2f855a; }
.subscribe-success { color: #68d391; font-weight: 600; margin-top: 12px; display: none; }
.btn-secondary { display: inline-block; padding: 8px 16px; border: 1px solid var(--blue); color: var(--blue); border-radius: var(--radius); text-decoration: none; font-size: 0.85rem; font-weight: 500; }

/* This Week in Congress */
.congress-week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.congress-item { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; text-decoration: none; color: inherit; display: block; transition: box-shadow 0.15s; }
.congress-item:hover { box-shadow: var(--shadow-md); border-color: var(--navy); }
.congress-item .ci-type { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-bottom: 10px; }
.ci-type.vote { background: #fed7e2; color: #97266d; }
.ci-type.bill { background: #e9d8fd; color: #553c9a; }
.ci-type.hearing { background: #c6f6d5; color: #276749; }
.congress-item h4 { font-size: 0.95rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; line-height: 1.4; }
.congress-item .ci-meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 8px; }
.congress-item .ci-issue-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.ci-issue-tag { font-size: 0.72rem; background: var(--gray-100); color: var(--gray-600); padding: 2px 8px; border-radius: 10px; }

/* ZIP Lookup page */
.zip-page-hero { background: linear-gradient(135deg, var(--navy) 0%, #2a4a7f 100%); color: white; padding: 60px 24px; text-align: center; }
.zip-page-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; }
.zip-page-hero p { font-size: 1.05rem; opacity: 0.85; max-width: 560px; margin: 0 auto 24px; }
.zip-search-box { background: white; border-radius: var(--radius-lg); padding: 20px 24px; max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.zip-search-box input { flex: 1; padding: 12px 16px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 1rem; color: var(--gray-800); }
.zip-search-box button { padding: 12px 24px; background: var(--navy); color: white; border: none; border-radius: var(--radius); font-weight: 700; cursor: pointer; font-size: 0.95rem; }
.rep-detail-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px; }
.rep-detail-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.rep-detail-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.rep-detail-photo-placeholder { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 1.4rem; flex-shrink: 0; }
.rep-detail-name { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.rep-detail-title { font-size: 0.95rem; color: var(--gray-600); margin-top: 4px; }
.rep-detail-contacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.rep-contact-pill { font-size: 0.82rem; padding: 4px 12px; border-radius: 14px; background: var(--gray-100); color: var(--gray-700); text-decoration: none; }
.rep-contact-pill:hover { background: var(--gray-200); }

@media (max-width: 768px) {
  .party-grid { grid-template-columns: 1fr; }
  .issue-hero h1 { font-size: 1.7rem; }
  .rep-lookup-form { flex-direction: column; }
  .zip-search-box { flex-direction: column; }
  .rep-detail-header { flex-direction: column; }
}
