/* ── NigeriaDecide Frontend Styles ──────────────────────────── */
:root {
  --nd-green:       #006400;
  --nd-green-dark:  #004d00;
  --nd-green-light: #e8f5e9;
  --nd-cream:       #f5f2eb;
  --nd-ink:         #0d1f0d;
  --nd-muted:       #6b7c6b;
  --nd-border:      #d4cfbf;
  --nd-white:       #ffffff;
  --nd-red:         #b71c1c;
  --nd-radius:      10px;
  --nd-shadow:      0 2px 12px rgba(0,0,0,.08);
}

/* ── Grid System ── */
.nd-grid { display: grid; gap: 18px; }
.nd-cols-2 { grid-template-columns: repeat(2, 1fr); }
.nd-cols-3 { grid-template-columns: repeat(3, 1fr); }
.nd-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Base Card ── */
.nd-card {
  background: var(--nd-white);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.nd-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.11);
  border-color: var(--nd-green);
}
.nd-card-body { padding: 16px 18px 18px; }

/* ── Empty / Error states ── */
.nd-empty, .nd-error {
  padding: 24px;
  text-align: center;
  color: var(--nd-muted);
  font-size: 14px;
  border: 1px dashed var(--nd-border);
  border-radius: var(--nd-radius);
}
.nd-error { border-color: #ffcdd2; color: var(--nd-red); }

/* ═══════════════════════════════════════════
   CANDIDATE CARDS
═══════════════════════════════════════════ */
.nd-card-banner {
  height: 76px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0 18px;
}
.nd-candidate-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--nd-white);
  box-shadow: 0 2px 10px rgba(0,0,0,.14);
  position: relative;
  top: 36px;
  flex-shrink: 0;
}
.nd-candidate-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--nd-white);
  box-shadow: 0 2px 10px rgba(0,0,0,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  position: relative;
  top: 36px;
  flex-shrink: 0;
  font-family: monospace;
}
.nd-party-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .4px;
  font-family: monospace;
}
.nd-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--nd-green);
  margin-bottom: 8px;
  font-family: monospace;
}
.nd-verified-icon {
  width: 14px;
  height: 14px;
  background: var(--nd-green);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  flex-shrink: 0;
}
.nd-candidate-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--nd-ink);
  margin: 0 0 3px;
  line-height: 1.25;
}
.nd-candidate-name a { color: inherit; text-decoration: none; }
.nd-candidate-name a:hover { color: var(--nd-green); }
.nd-candidate-role {
  font-size: 11px;
  color: var(--nd-muted);
  margin-bottom: 12px;
  font-family: monospace;
}
.nd-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.nd-fact {
  background: var(--nd-cream);
  border-radius: 5px;
  padding: 6px 8px;
}
.nd-fact-full { grid-column: 1 / -1; }
.nd-fact-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--nd-muted);
  font-weight: 700;
  font-family: monospace;
}
.nd-fact-value {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--nd-ink);
  margin-top: 1px;
}

/* ── Buttons ── */
.nd-card-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.nd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  border: none;
  font-family: inherit;
}
.nd-btn-primary { background: var(--nd-green); color: #fff; flex: 1; }
.nd-btn-primary:hover { background: var(--nd-green-dark); color: #fff; }
.nd-btn-secondary {
  background: transparent;
  color: var(--nd-green);
  border: 1.5px solid var(--nd-green);
  flex: 1;
}
.nd-btn-secondary:hover { background: var(--nd-green-light); }
.nd-btn-lg { width: 100%; padding: 12px; font-size: 14px; }

.nd-card-social { display: flex; gap: 6px; flex-wrap: wrap; }
.nd-social-link {
  font-size: 11px;
  color: var(--nd-muted);
  text-decoration: none;
  font-family: monospace;
}
.nd-social-link:hover { color: var(--nd-green); }

/* ═══════════════════════════════════════════
   SINGLE CANDIDATE PROFILE
═══════════════════════════════════════════ */
.nd-single-candidate {
  max-width: 900px;
  margin: 0 auto;
}
.nd-single-header {
  background: var(--nd-white);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius);
  padding: 28px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.nd-single-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--nd-white);
  box-shadow: var(--nd-shadow);
  flex-shrink: 0;
}
.nd-single-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-family: monospace;
}
.nd-single-name {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--nd-ink);
  margin: 0 0 8px;
  line-height: 1.1;
}
.nd-single-party {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}
.nd-single-type {
  font-size: 13px;
  color: var(--nd-muted);
  margin-bottom: 10px;
  font-family: monospace;
}
.nd-single-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.nd-social-btn {
  padding: 6px 12px;
  border: 1px solid var(--nd-border);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nd-ink);
  text-decoration: none;
  transition: all .15s;
  font-family: monospace;
}
.nd-social-btn:hover { border-color: var(--nd-green); color: var(--nd-green); }

.nd-single-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
}
.nd-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nd-muted);
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--nd-border);
}
.nd-section-title:first-child { margin-top: 0; }
.nd-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nd-detail-table th {
  text-align: left;
  padding: 8px 12px 8px 0;
  color: var(--nd-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #f0ece0;
  width: 40%;
}
.nd-detail-table td {
  padding: 8px 0;
  color: var(--nd-ink);
  font-weight: 500;
  border-bottom: 1px solid #f0ece0;
}
.nd-list { padding-left: 18px; margin: 0; }
.nd-list li { font-size: 13px; color: var(--nd-ink); line-height: 1.7; padding: 2px 0; }
.nd-bio-content { font-size: 15px; line-height: 1.8; color: #2a3d2a; }

/* ═══════════════════════════════════════════
   PARTY DIRECTORY
═══════════════════════════════════════════ */
.nd-party-card { position: relative; }
.nd-party-stripe { height: 5px; width: 100%; }
.nd-party-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--nd-cream);
  border: 1px solid var(--nd-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.nd-party-logo { width: 100%; height: 100%; object-fit: contain; }
.nd-party-initials { font-size: 22px; font-weight: 900; }
.nd-party-acronym { font-size: 22px; font-weight: 900; color: var(--nd-ink); margin-bottom: 3px; }
.nd-party-acronym a { color: inherit; text-decoration: none; }
.nd-party-fullname { font-size: 11px; color: var(--nd-muted); margin-bottom: 14px; line-height: 1.4; }
.nd-party-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.nd-pstat {
  background: var(--nd-cream);
  border-radius: 5px;
  padding: 8px 6px;
  text-align: center;
}
.nd-pstat-num { display: block; font-size: 16px; font-weight: 700; font-family: monospace; color: var(--nd-ink); }
.nd-pstat-lbl { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .4px; color: var(--nd-muted); font-weight: 600; margin-top: 1px; }
.nd-party-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--nd-border); }
.nd-party-rl { font-size: 11px; color: var(--nd-muted); font-family: monospace; }
.nd-party-rv { font-size: 12px; font-weight: 600; color: var(--nd-ink); }
.nd-party-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
  margin-top: 6px;
}
.nd-party-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--nd-border);
  font-size: 11px;
  color: var(--nd-muted);
  font-family: monospace;
}
.nd-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   ELECTIONS TABLE
═══════════════════════════════════════════ */
.nd-elections-table-wrap { overflow-x: auto; }
.nd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--nd-white);
  border-radius: var(--nd-radius);
  overflow: hidden;
  border: 1px solid var(--nd-border);
}
.nd-table th {
  padding: 10px 14px;
  text-align: left;
  background: #fafaf8;
  border-bottom: 1px solid var(--nd-border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--nd-muted);
  font-weight: 700;
  font-family: monospace;
}
.nd-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0ece0;
  vertical-align: middle;
}
.nd-table tr:last-child td { border-bottom: none; }
.nd-table tbody tr:hover td { background: #fdfcf8; }
.nd-table a { color: var(--nd-green); text-decoration: none; font-weight: 600; }
.nd-table a:hover { text-decoration: underline; }

/* ── Badges ── */
.nd-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  font-family: monospace;
}
.nd-badge-green  { background: #e8f5e9; color: #1b5e20; }
.nd-badge-red    { background: #ffebee; color: #b71c1c; }
.nd-badge-amber  { background: #fff3e0; color: #e65100; }
.nd-badge-blue   { background: #e3f2fd; color: #0d47a1; }
.nd-badge-gray   { background: #f5f5f5; color: #555; }
.nd-ml-8 { margin-left: 8px; }

/* ═══════════════════════════════════════════
   RESULTS BARS
═══════════════════════════════════════════ */
.nd-results-wrap {
  background: #0d1f0d;
  border-radius: var(--nd-radius);
  padding: 24px;
}
.nd-results-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.nd-results-meta {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  font-family: monospace;
  margin-bottom: 22px;
}
.nd-results-bars { display: flex; flex-direction: column; gap: 14px; }
.nd-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nd-result-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  flex-shrink: 0;
}
.nd-rank-1 { background: #b8860b; color: #fff; }
.nd-rank-2 { background: #777; color: #fff; }
.nd-rank-3 { background: #7a4219; color: #fff; }
.nd-result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-family: monospace;
}
.nd-result-info { flex: 1; }
.nd-result-name { color: #fff; font-size: 13px; font-weight: 600; }
.nd-result-party { font-size: 10px; color: rgba(255,255,255,.45); font-family: monospace; }
.nd-result-bar-wrap {
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  height: 6px;
  margin-top: 5px;
}
.nd-result-bar {
  height: 6px;
  border-radius: 3px;
  transition: width .5s ease;
  max-width: 100%;
}
.nd-result-numbers { text-align: right; flex-shrink: 0; min-width: 70px; }
.nd-result-votes { color: #4caf50; font-size: 12px; font-weight: 600; font-family: monospace; }
.nd-result-pct { color: rgba(255,255,255,.4); font-size: 10px; font-family: monospace; }
.nd-results-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); }

/* ═══════════════════════════════════════════
   STATES GRID
═══════════════════════════════════════════ */
.nd-states-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.nd-state-tile {
  aspect-ratio: 1;
  border-radius: 7px;
  background: var(--nd-white);
  border: 1px solid var(--nd-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  padding: 4px;
  text-align: center;
}
.nd-state-tile:hover { border-color: var(--nd-green); background: var(--nd-green-light); }
.nd-state-code { font-family: monospace; font-size: 12px; font-weight: 700; color: var(--nd-ink); }
.nd-state-name { font-size: 8px; color: var(--nd-muted); margin-top: 2px; line-height: 1.2; }
.nd-state-zone-dot { position: absolute; bottom: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; }

/* Zone colours */
.nd-zone-south-west   .nd-state-zone-dot { background: #e65100; }
.nd-zone-south-east   .nd-state-zone-dot { background: #1b5e20; }
.nd-zone-south-south  .nd-state-zone-dot { background: #0d47a1; }
.nd-zone-north-east   .nd-state-zone-dot { background: #880e4f; }
.nd-zone-north-west   .nd-state-zone-dot { background: #4a148c; }
.nd-zone-north-central .nd-state-zone-dot { background: #006064; }

.nd-zone-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.nd-zone-key { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--nd-muted); font-family: monospace; }
.nd-zone-swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nd-zone-swatch.nd-zone-south-west   { background: #e65100; }
.nd-zone-swatch.nd-zone-south-east   { background: #1b5e20; }
.nd-zone-swatch.nd-zone-south-south  { background: #0d47a1; }
.nd-zone-swatch.nd-zone-north-east   { background: #880e4f; }
.nd-zone-swatch.nd-zone-north-west   { background: #4a148c; }
.nd-zone-swatch.nd-zone-north-central { background: #006064; }

/* ═══════════════════════════════════════════
   ELECTION MAP
═══════════════════════════════════════════ */
.nd-map-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.nd-map-tile {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--nd-white);
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
}
.nd-map-code { font-size: 11px; font-weight: 700; font-family: monospace; }
.nd-map-winner { font-size: 9px; font-weight: 700; font-family: monospace; margin-top: 2px; }

/* ═══════════════════════════════════════════
   SUBMIT FORM
═══════════════════════════════════════════ */
.nd-submit-form-wrap { max-width: 680px; }
.nd-submit-form { display: flex; flex-direction: column; gap: 0; }
.nd-form-row { display: flex; gap: 14px; margin-bottom: 14px; }
.nd-form-row-2 > * { flex: 1; }
.nd-form-row-3 > * { flex: 1; }
.nd-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.nd-form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--nd-muted);
  font-family: monospace;
}
.nd-form-input, .nd-form-select {
  border: 1.5px solid var(--nd-border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--nd-ink);
  background: var(--nd-white);
  outline: none;
  transition: border-color .15s;
  width: 100%;
  -webkit-appearance: none;
}
.nd-form-input:focus, .nd-form-select:focus { border-color: var(--nd-green); }
.nd-form-file { font-size: 12px; color: var(--nd-muted); }
.nd-form-desc { font-size: 11px; color: var(--nd-muted); margin: 4px 0 0; }

.nd-party-votes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nd-party-vote-row { display: flex; align-items: center; gap: 8px; }
.nd-pvr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.nd-pvr-label { font-size: 12px; font-weight: 700; font-family: monospace; min-width: 36px; }
.nd-pvr-input {
  flex: 1;
  border: 1.5px solid var(--nd-border);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: monospace;
  outline: none;
  min-width: 0;
}
.nd-pvr-input:focus { border-color: var(--nd-green); }

.nd-submit-success {
  text-align: center;
  padding: 40px 20px;
}
.nd-success-icon {
  width: 60px;
  height: 60px;
  background: var(--nd-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}
.nd-submit-success h3 { font-size: 20px; color: var(--nd-ink); margin-bottom: 10px; }
.nd-submit-success p { font-size: 14px; color: var(--nd-muted); margin-bottom: 10px; }
.nd-success-sms { font-family: monospace; background: var(--nd-cream); padding: 10px 14px; border-radius: 6px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nd-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .nd-states-grid, .nd-map-grid { grid-template-columns: repeat(5, 1fr); }
  .nd-single-body { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nd-cols-3, .nd-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .nd-cols-2 { grid-template-columns: 1fr; }
  .nd-states-grid, .nd-map-grid { grid-template-columns: repeat(4, 1fr); }
  .nd-form-row { flex-direction: column; }
  .nd-party-votes-grid { grid-template-columns: 1fr; }
  .nd-single-header { flex-direction: column; }
}
@media (max-width: 480px) {
  .nd-cols-2, .nd-cols-3, .nd-cols-4 { grid-template-columns: 1fr; }
  .nd-states-grid, .nd-map-grid { grid-template-columns: repeat(3, 1fr); }
}
