/* =========================================================
   PressChain SYNC — Vote Bar (Light Theme)
   ========================================================= */

.pc-vote-bar-wrap {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px 14px;
  margin: 24px 0;
  box-shadow: 0 1px 4px rgba(0,42,67,.07);
  max-width: 680px;
}

/* ── Header row ─────────────────────────────────────────── */
.pc-vb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.pc-vb-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #002A43;
}
.pc-vb-title svg { flex-shrink: 0; color: #009BF9; }
.pc-vb-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}
.pc-vb-status-badge.voting   { background: #ede9fe; color: #7c3aed; border-color: #c4b5fd; }
.pc-vb-status-badge.accepted { background: #dcfce7; color: #16a34a; border-color: #86efac; }
.pc-vb-status-badge.rejected { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.pc-vb-status-badge.pending  { background: #fef3c7; color: #d97706; border-color: #fde68a; }
.pc-vb-status-badge.canonical{ background: #cffafe; color: #0891b2; border-color: #a5f3fc; }
.pc-vb-status-badge.staged   { background: #e6f5ff; color: #007ccc; border-color: #93c5fd; }
.pc-vb-status-badge.draft    { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }

/* ── Vote counts row ────────────────────────────────────── */
.pc-vb-counts {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.pc-vb-yes-count { font-size: 22px; font-weight: 700; color: #16a34a; line-height: 1; }
.pc-vb-no-count  { font-size: 22px; font-weight: 700; color: #dc2626; line-height: 1; }
.pc-vb-count-sep { font-size: 15px; color: #8fa9bc; font-weight: 400; }
.pc-vb-count-label { font-size: 11.5px; color: #8fa9bc; margin-left: 4px; }
.pc-vb-pct {
  font-size: 13px; font-weight: 700; color: #002A43;
  margin-left: auto; white-space: nowrap;
}

/* ── Track ──────────────────────────────────────────────── */
.pc-vb-track-wrap { position: relative; margin-bottom: 6px; }
.pc-vb-track {
  height: 10px;
  background: #fee2e2;
  border-radius: 5px;
  overflow: visible;
  position: relative;
}
.pc-vb-fill-yes {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
  border-radius: 5px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 0;
}
.pc-vb-threshold-marker {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 2px;
  background: #f59e0b;
  border-radius: 2px;
  left: 60%;
  z-index: 2;
}
.pc-vb-threshold-marker::after {
  content: '60%';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: #d97706;
  white-space: nowrap;
}

/* ── Track labels ───────────────────────────────────────── */
.pc-vb-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #8fa9bc;
  font-weight: 500;
  margin-top: 4px;
}
.pc-vb-label-yes { color: #16a34a; font-weight: 700; }
.pc-vb-label-no  { color: #dc2626; font-weight: 700; }

/* ── Quorum bar ─────────────────────────────────────────── */
.pc-vb-quorum-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.pc-vb-quorum-label { font-size: 11px; color: #8fa9bc; font-weight: 500; white-space: nowrap; }
.pc-vb-quorum-track {
  flex: 1; height: 4px;
  background: #e2e8f0; border-radius: 2px; overflow: hidden;
}
.pc-vb-quorum-fill {
  height: 100%;
  background: #009BF9;
  border-radius: 2px;
  transition: width .6s;
}
.pc-vb-quorum-pct { font-size: 11px; font-weight: 700; color: #002A43; white-space: nowrap; min-width: 36px; text-align: right; }

/* ── Timer ──────────────────────────────────────────────── */
.pc-vb-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4a6278;
  font-weight: 500;
  margin-bottom: 14px;
}
.pc-vb-timer svg { color: #009BF9; flex-shrink: 0; }
.pc-vb-timer-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #002A43; }
.pc-vb-timer.pc-vb-timer-ending .pc-vb-timer-value { color: #dc2626; animation: pcTimerPulse 1s infinite; }
@keyframes pcTimerPulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Vote buttons ───────────────────────────────────────── */
.pc-vb-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pc-vb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .14s ease;
  text-decoration: none;
  line-height: 1;
}
.pc-vb-btn-yes {
  background: #dcfce7;
  color: #16a34a;
  border-color: #86efac;
}
.pc-vb-btn-yes:hover { background: #16a34a; color: white; border-color: #16a34a; }
.pc-vb-btn-no {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
.pc-vb-btn-no:hover { background: #dc2626; color: white; border-color: #dc2626; }
.pc-vb-btn:disabled, .pc-vb-btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.pc-vb-btn-connecting {
  background: #e6f5ff;
  color: #007ccc;
  border-color: #93c5fd;
  cursor: pointer;
}
.pc-vb-btn-connecting:hover { background: #009BF9; color: white; border-color: #009BF9; }

/* ── PressKey status ────────────────────────────────────── */
.pc-vb-presskey-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: #8fa9bc;
}
.pc-vb-pk-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pc-vb-pk-dot-ok      { background: #16a34a; box-shadow: 0 0 0 3px #bbf7d0; }
.pc-vb-pk-dot-missing { background: #f59e0b; box-shadow: 0 0 0 3px #fde68a; }
.pc-vb-pk-label { font-weight: 600; }
.pc-vb-pk-link { color: #009BF9 !important; text-decoration: none; margin-left: 4px; font-weight: 600; }
.pc-vb-pk-link:hover { text-decoration: underline !important; }

/* Test mode wallet input */
.pc-vb-test-input {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.pc-vb-test-input input {
  flex: 1;
  min-width: 200px;
  padding: 7px 11px;
  border: 1.5px solid #dde5ee;
  border-radius: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #002A43;
  background: white;
}
.pc-vb-test-input input:focus { outline: none; border-color: #009BF9; box-shadow: 0 0 0 3px rgba(0,155,249,.12); }

/* ── Result message ─────────────────────────────────────── */
.pc-vb-result {
  display: none;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 12px;
  align-items: center;
  gap: 8px;
}
.pc-vb-result.success { background: #dcfce7; color: #16a34a; display: flex; }
.pc-vb-result.error   { background: #fee2e2; color: #dc2626; display: flex; }
.pc-vb-result.info    { background: #e6f5ff; color: #007ccc; display: flex; }

/* Vote closed state */
.pc-vb-closed {
  text-align: center;
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: #64748b;
  margin-top: 10px;
}
.pc-vb-closed strong { display: block; font-size: 15px; color: #002A43; margin-bottom: 3px; }

/* ── Footer / Powered by ────────────────────────────────── */
.pc-vb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.pc-vb-footer-links {
  display: flex;
  gap: 12px;
  font-size: 11px;
}
.pc-vb-footer-links a {
  color: #8fa9bc !important;
  text-decoration: none !important;
  font-weight: 500;
  transition: color .12s;
}
.pc-vb-footer-links a:hover { color: #009BF9 !important; }
.pc-vb-powered {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8fa9bc;
  text-decoration: none !important;
  transition: color .12s;
}
.pc-vb-powered:hover { color: #009BF9 !important; }
.pc-vb-powered svg { color: #009BF9; }
.pc-vb-powered-text { letter-spacing: .01em; }

/* ── Voted state overlay ────────────────────────────────── */
.pc-vb-voted-state {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #16a34a;
  margin-top: 12px;
}
.pc-vb-voted-state.show { display: flex; }
.pc-vb-vote-direction-yes { color: #16a34a; }
.pc-vb-vote-direction-no  { color: #dc2626; }

/* ── Signing overlay ────────────────────────────────────── */
.pc-vb-signing {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #4a6278;
  padding: 10px 0;
}
.pc-vb-signing.show { display: flex; }
.pc-vb-spinner {
  width: 16px; height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #009BF9;
  border-radius: 50%;
  animation: pcSpin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes pcSpin { to { transform: rotate(360deg); } }

/* ── Size variants ──────────────────────────────────────── */
.pc-vote-bar-sm .pc-vote-bar-wrap { padding: 13px 15px 10px; }
.pc-vote-bar-sm .pc-vb-yes-count,
.pc-vote-bar-sm .pc-vb-no-count   { font-size: 18px; }
.pc-vote-bar-sm .pc-vb-btn        { padding: 7px 14px; font-size: 12.5px; }
.pc-vote-bar-sm .pc-vb-footer      { margin-top: 10px; padding-top: 8px; }

/* ── Shortcode above/below content ─────────────────────── */
.entry-content .pc-vote-bar-wrap,
.post-content  .pc-vote-bar-wrap {
  margin: 28px 0;
}
