/* ─── Elections Page ──────────────────────────────────────────────────────── */

/* Page Hero */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  padding: 56px 48px 48px;
}

.page-hero-inner {
  max-width: 860px;
  margin: 0 auto;
}

.page-hero .eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}

.page-hero h2 {
  font-family: 'Merriweather', serif;
  font-size: 36px;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.2;
}

.page-hero p {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  line-height: 1.6;
}

/* Nav active state */
nav a.nav-active {
  color: var(--blue-dark);
  background: var(--gray-100);
  border-radius: 6px;
}

/* Main layout */
.elections-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Section */
.elec-section {
  margin-bottom: 48px;
}

.elec-section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.elec-section-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.elec-section-header h2 {
  font-family: 'Merriweather', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 4px;
}

.elec-section-header p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Divider */
.elec-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 48px 0;
}

/* State selector */
.state-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.selector-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
}

.state-select {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-400);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  cursor: pointer;
  min-width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.state-select:focus {
  border-color: var(--blue);
}

/* Results area */
.elec-results {
  min-height: 40px;
}

/* Loading */
.elec-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  color: var(--gray-500);
  font-size: 14px;
}

.elec-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Race group */
.race-group {
  margin-bottom: 32px;
}

.race-group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

/* Race card */
.race-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.race-card:last-child {
  margin-bottom: 0;
}

.race-seat {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.race-info {
  flex: 1;
  min-width: 0;
}

.race-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-meta {
  font-size: 13px;
  color: var(--gray-500);
}

/* Current incumbent card — seat not up for election this cycle */
.not-on-ballot-card {
  border-color: var(--gray-300);
  background: var(--gray-50, #F9FAFB);
}

.not-on-ballot-meta {
  font-size: 13px;
  font-style: italic;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.cand-photo-sm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-right: 10px;
  float: left;
}

/* Special election card — amber accent to distinguish from November general */
.special-election-card {
  border-color: #F59E0B;
  border-left: 4px solid #F59E0B;
  background: #FFFBEB;
}

.special-election-card .race-seat {
  background: #FEF3C7;
}

.special-election-meta {
  font-size: 13px;
  font-weight: 600;
  color: #B45309;
  margin-bottom: 10px;
}

.special-election-cands {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.race-incumbent {
  flex-shrink: 0;
  text-align: right;
}

.incumbent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
}

.incumbent-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

.party-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.party-badge.rep  { background: #FEE2E2; color: #B91C1C; }
.party-badge.dem  { background: #DBEAFE; color: #1D4ED8; }
.party-badge.cons { background: #EDE9FE; color: #6D28D9; }
.party-badge.wfp  { background: #FFEDD5; color: #C2410C; }
.party-badge.grn  { background: #D1FAE5; color: #065F46; }
.party-badge.lib  { background: #FEF9C3; color: #92400E; }
.party-badge.inp  { background: #CCFBF1; color: #0F766E; }
.party-badge.ind  { background: #F3F4F6; color: #374151; }
.party-badge.open { background: #FEF9C3; color: #854D0E; }

.party-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.party-badges-row .party-badge {
  margin-top: 0;
}

/* Open seat */
.race-open-badge {
  font-size: 11px;
  font-weight: 700;
  color: #854D0E;
  background: #FEF9C3;
  border-radius: 20px;
  padding: 3px 10px;
}

/* Empty state */
.elec-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--gray-500);
  font-size: 14px;
}

.elec-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

/* No Senate race notice */
.no-senate-notice {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Filter tabs */
.race-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.race-filter-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--gray-400);
  border-radius: 20px;
  background: var(--white);
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.race-filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.race-filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.race-group.hidden {
  display: none;
}

/* Prompt shown before a tab is selected */
.race-pick-prompt {
  font-size: 14px;
  color: var(--gray-500);
  padding: 20px 0 8px;
}

/* Coming soon card */
.coming-soon-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
}

.coming-soon-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.coming-soon-card h3 {
  font-family: 'Merriweather', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

.coming-soon-card p {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 480px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.coming-soon-note {
  font-size: 12px;
  color: var(--gray-400);
  letter-spacing: 0.3px;
}

/* Split incumbent vs. challenger layout */
.race-split-row {
  display: flex;
  align-items: flex-start;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.split-cand {
  flex: 1;
  min-width: 0;
}

.split-vs {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  padding: 2px 12px 0;
  align-self: flex-start;
}

.split-empty .cand-no-challengers {
  line-height: 1.5;
}

.split-challenger-entry {
  margin-bottom: 10px;
}

.split-challenger-entry:last-child {
  margin-bottom: 0;
}

.cand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 3px;
}

.cand-role {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 3px;
}

.cand-role.challenger {
  color: #059669;
  font-weight: 600;
}

.cand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  align-items: center;
}

.cand-link {
  display: inline-block;
  font-size: 11px;
  color: var(--blue);
  text-decoration: none;
}
.cand-link:hover { text-decoration: underline; }

.cand-votes-btn {
  font-size: 11px;
  color: var(--blue);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.cand-votes-btn:hover { text-decoration: underline; }
.cand-votes-btn:disabled { opacity: 0.6; cursor: default; text-decoration: none; }

.elec-context-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.cand-no-challengers {
  font-size: 12px;
  color: var(--gray-400);
  font-style: italic;
}

/* ─── Report Card Button ────────────────────────────────────────────────────── */
.cand-report-btn {
  font-size: 11px;
  color: var(--blue);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.cand-report-btn:hover { text-decoration: underline; }
.cand-report-btn:disabled { opacity: 0.6; cursor: default; text-decoration: none; }

/* ─── Report Card Modal ─────────────────────────────────────────────────────── */
.rc-loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
  font-size: 14px;
}

.rc-wrap {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--gray-800, #1F2937);
}

.rc-header {
  padding: 4px 0 20px;
  border-bottom: 2px solid var(--gray-100, #F3F4F6);
  margin-bottom: 20px;
}

.rc-header-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin-bottom: 4px;
}

.rc-header-sub {
  font-size: 13px;
  color: var(--gray-500, #6B7280);
}

.rc-section {
  margin-bottom: 4px;
}

.rc-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray-400, #9CA3AF);
  margin-bottom: 10px;
}

.rc-source {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gray-400, #9CA3AF);
  margin-left: 6px;
}

.rc-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rc-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rc-label {
  flex-shrink: 0;
  width: 180px;
  font-size: 13px;
  color: var(--gray-500, #6B7280);
}

.rc-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800, #1F2937);
}

.rc-val.rc-good { color: #059669; }
.rc-val.rc-mid  { color: #D97706; }
.rc-val.rc-warn { color: #DC2626; }

.rc-context {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-400, #9CA3AF);
  margin-left: 4px;
}

.rc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rc-tag {
  padding: 2px 8px;
  background: var(--gray-100, #F3F4F6);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600, #4B5563);
}

.rc-na {
  font-size: 12px;
  color: var(--gray-400, #9CA3AF);
  font-style: italic;
}

.rc-na-block {
  font-size: 13px;
  color: var(--gray-400, #9CA3AF);
  font-style: italic;
  padding: 4px 0;
}

/* Party alignment progress bar */
.rc-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--gray-100, #F3F4F6);
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 0 6px;
}

.rc-bar-fill {
  height: 100%;
  background: #3B82F6;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.rc-divider {
  border: none;
  border-top: 1px solid var(--gray-100, #F3F4F6);
  margin: 16px 0;
}

.rc-link {
  color: #2563EB;
  text-decoration: none;
  font-weight: 500;
}
.rc-link:hover { text-decoration: underline; }

.rc-pending-notice {
  font-size: 12px;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 2px;
}

.rc-disclaimer {
  margin-top: 20px;
  font-size: 11px;
  color: var(--gray-400, #9CA3AF);
  text-align: center;
  border-top: 1px solid var(--gray-100, #F3F4F6);
  padding-top: 12px;
}

/* Senate class badge */
.senate-class-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #EDE9FE;
  color: #5B21B6;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── AI Analysis ─────────────────────────────────────────────────────────── */
.rc-ai-trigger {
  margin-top: 4px;
}

.rc-ai-btn {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: opacity 0.15s;
}
.rc-ai-btn:hover  { opacity: 0.88; }
.rc-ai-btn:active { opacity: 0.75; }

.rc-ai-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray-400, #9CA3AF);
  text-align: center;
}

.rc-ai-block {
  margin-bottom: 14px;
}

.rc-ai-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400, #9CA3AF);
  margin-bottom: 5px;
}

.rc-ai-para {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700, #374151);
  margin: 0;
}

.rc-ai-disclaimer {
  margin-top: 12px;
  font-size: 11px;
  color: var(--gray-400, #9CA3AF);
  text-align: center;
  font-style: italic;
}
