/* EaglePress — Polling & Voting (States) Plugin CSS */

/* ── Poll Widget Container ─────────────────────────────────────── */
.pvs-poll-block {
  background: var(--ep-content-bg, #fff);
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px 28px 22px;
  margin: 28px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  font-family: inherit;
  position: relative;
  transition: border-color 0.2s;
}

.pvs-loading {
  text-align: center;
  padding: 28px;
  color: #94a3b8;
  font-style: italic;
  font-size: 14px;
}

/* ── Voting UI ─────────────────────────────────────────────────── */
.pvs-poll-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pvs-question {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}

.pvs-choices-wrap {
  margin-bottom: 6px;
}

/* ── List Choice Items (custom sets, voting_list, etc.) ────────── */
.pvs-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.pvs-multi-hint {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px;
  font-style: italic;
}

.pvs-no-choices {
  color: #94a3b8;
  font-size: 14px;
  font-style: italic;
  padding: 8px 0;
}

.pvs-choice-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.pvs-choice-item:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}

.pvs-choice-item--selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 2px 10px rgba(59,130,246,0.15);
}

.pvs-choice-item--selected:hover {
  border-color: #2563eb;
}

.pvs-choice-input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: #3b82f6;
  cursor: pointer;
  margin: 0;
}

.pvs-choice-item span {
  font-size: 15px;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}

.pvs-choice-item--selected span {
  color: #1d4ed8;
  font-weight: 600;
}

/* ── Button Group (Yes/No, True/False) ─────────────────────────── */
.pvs-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.pvs-choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  width: 100%;
  box-sizing: border-box;
}

.pvs-choice-btn:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}

.pvs-choice-btn--selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 2px 10px rgba(59,130,246,0.15);
  color: #1d4ed8;
  font-weight: 600;
}

.pvs-choice-btn input[type="radio"],
.pvs-choice-btn input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: #3b82f6;
  cursor: pointer;
  margin: 0;
}

/* ── Stars Rating ──────────────────────────────────────────────── */
.pvs-stars {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pvs-star {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.pvs-star input[type="radio"] { display: none; }

.pvs-star span {
  font-size: 34px;
  color: #d1d5db;
  transition: color 0.1s, transform 0.1s;
  line-height: 1;
}

.pvs-star--hover span,
.pvs-star--selected span { color: #f59e0b; }
.pvs-star:hover span { transform: scale(1.15); }

/* ── Rating Scale (1–10) ───────────────────────────────────────── */
.pvs-rating-scale {
  margin-bottom: 10px;
}

.pvs-rating-scale > div:first-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.pvs-rating-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pvs-rating-num input[type="radio"] { display: none; }

.pvs-rating-num span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pvs-rating-num span:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #3b82f6;
}

.pvs-rating-num--selected span {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.pvs-rating-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  padding: 0 2px;
}

/* ── Likert Scale ──────────────────────────────────────────────── */
.pvs-likert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.pvs-likert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  background: #fff;
}

.pvs-likert-item:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.pvs-likert-item--selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.pvs-likert-item input[type="radio"] { display: none; }

.pvs-likert-label {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  flex: 1;
}

.pvs-likert-item--selected .pvs-likert-label {
  color: #1d4ed8;
  font-weight: 600;
}

/* ── Ranked Choice (click) ─────────────────────────────────────── */
.pvs-ranked-click { margin-bottom: 8px; }

.pvs-ranked-hint {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 10px;
  font-style: italic;
}

.pvs-ranked-source {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.pvs-ranked-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  user-select: none;
}

.pvs-ranked-item:hover { border-color: #93c5fd; background: #f0f7ff; }

.pvs-ranked-item.pvs-ranked-selected {
  opacity: 0.45;
  cursor: default;
  border-style: dashed;
}

.pvs-ranked-order-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.pvs-ranked-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.pvs-ranked-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
}

.pvs-ranked-list li:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.pvs-rank-num {
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
  min-width: 22px;
}

/* ── Ranked Choice (dropdown) ──────────────────────────────────── */
.pvs-ranked-dropdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.pvs-ranked-dd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.pvs-ranked-dd-label {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  flex: 1;
}

.pvs-rank-select {
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  min-width: 56px;
}

/* ── State Selector ────────────────────────────────────────────── */
.pvs-state-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.pvs-state-label {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
}

.pvs-state-select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  color: #1e293b;
  background: #fff;
  min-width: 160px;
  transition: border-color 0.15s;
}

.pvs-state-select:focus { border-color: #3b82f6; outline: none; }

.pvs-save-state-btn {
  font-size: 12px;
  padding: 5px 12px;
  background: #fff;
  border: 1.5px solid #3b82f6;
  border-radius: 6px;
  color: #3b82f6;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.pvs-save-state-btn:hover { background: #3b82f6; color: #fff; }
.pvs-save-state-btn:disabled { opacity: 0.6; cursor: default; }

.pvs-state-saved-msg {
  font-size: 12px;
  color: #16a34a;
  font-weight: 600;
}

/* ── Submit Row ────────────────────────────────────────────────── */
.pvs-submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pvs-submit-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.pvs-submit-btn:hover {
  opacity: 0.92;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.pvs-submit-btn:active { transform: scale(0.97); }

.pvs-submit-btn:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.pvs-vote-msg {
  font-size: 13px;
  font-weight: 600;
}

.pvs-msg-error { color: #dc2626; }

/* ── Results Container ─────────────────────────────────────────── */
.pvs-results-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pvs-results-container .pvs-question {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.pvs-voted-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  font-size: 14px;
  color: #166534;
  font-weight: 600;
  margin-bottom: 14px;
}

.pvs-poll-closed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.pvs-total-count {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ── Percent Bars ──────────────────────────────────────────────── */
.pvs-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.pvs-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 5px 10px;
}

.pvs-bar-label {
  grid-column: 1;
  grid-row: 1;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  align-self: end;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pvs-bar-stat {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  color: #475569;
  font-weight: 700;
  text-align: right;
  align-self: end;
  white-space: nowrap;
}

.pvs-bar-track {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 13px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
}

.pvs-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
  min-width: 3px;
}

.pvs-no-results {
  color: #94a3b8;
  font-size: 14px;
  font-style: italic;
  padding: 4px 0;
}

/* ── Combo divider ─────────────────────────────────────────────── */
.pvs-combo-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}

/* ── Pie Chart ─────────────────────────────────────────────────── */
.pvs-pie-wrap {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pvs-pie-svg { flex-shrink: 0; }

.pvs-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pvs-pie-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e293b;
}

.pvs-pie-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Text Results ──────────────────────────────────────────────── */
.pvs-text-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.pvs-text-results li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
}

/* ── State Results Toggle ──────────────────────────────────────── */
.pvs-state-results {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.pvs-state-toggle-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid #bfdbfe;
  border-radius: 20px;
  background: #eff6ff;
  transition: background 0.15s, border-color 0.15s;
}

.pvs-state-toggle-link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  text-decoration: none;
}

.pvs-state-collapsible {
  margin-top: 16px;
}

/* ── Geographic SVG Map ────────────────────────────────────────── */
.pvs-map-svg-wrap {
  position: relative;
  margin-bottom: 12px;
  min-height: 48px;
}

.pvs-map-loading-text {
  display: block;
  padding: 12px 0;
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

.pvs-map-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.pvs-map-tooltip {
  background: rgba(15,23,42,0.88);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

.pvs-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 10px;
  font-size: 12px;
  color: #475569;
}

.pvs-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pvs-map-legend-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── State Table ───────────────────────────────────────────────── */
.pvs-state-list-wrap {
  overflow-x: auto;
}

.pvs-state-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pvs-state-table th {
  text-align: left;
  padding: 7px 12px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
}

.pvs-state-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.pvs-state-table tr:last-child td { border-bottom: none; }
.pvs-state-table tbody tr { cursor: pointer; }
.pvs-state-table tbody tr:hover td { background: #fef9c3; }

.pvs-show-more-states {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #3b82f6;
  background: none;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.pvs-show-more-states:hover { background: #eff6ff; }

/* ── Map mode toggle button ─────────────────────────────────────── */
.pvs-map-legend-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  margin-bottom: 6px;
}

.pvs-map-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 20px;
  padding: 5px 14px;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px rgba(59,130,246,0.12);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s, transform 0.1s;
}

.pvs-map-mode-toggle::before {
  content: '🗺';
  font-size: 13px;
  line-height: 1;
}

.pvs-map-mode-toggle:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(59,130,246,0.22);
  transform: translateY(-1px);
}

.pvs-map-mode-toggle:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(59,130,246,0.15);
}

/* ── "You Voted" legend tag ────────────────────────────────────── */
.pvs-you-voted-tag {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  white-space: nowrap;
}

/* ── Anonymous badge + tooltip ────────────────────────────────── */
.pvs-anon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #6366f1;
  background: #ede9fe;
  border-radius: 50%;
  cursor: default;
  vertical-align: middle;
  margin-left: 4px;
  user-select: none;
}

.pvs-anon-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(15,23,42,0.88);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Voter State Indicator ─────────────────────────────────────── */
.pvs-voter-state-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  font-size: 13px;
  color: #1d4ed8;
  font-weight: 500;
  margin-bottom: 10px;
}

/* ── Results Countdown ─────────────────────────────────────────── */
.pvs-results-delay {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-size: 14px;
  background: #f8fafc;
  border-radius: 8px;
}

.pvs-countdown { font-weight: 700; color: #3b82f6; }

/* ── Error ─────────────────────────────────────────────────────── */
.pvs-error {
  color: #dc2626;
  font-size: 14px;
  padding: 12px;
  background: #fff1f1;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

/* ── Deleted poll notice ────────────────────────────────────────── */
.pvs-poll-deleted {
  background: #fafafa;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 20px 24px;
}

.pvs-deleted-notice {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pvs-deleted-icon {
  font-size: 32px;
  opacity: 0.4;
  flex-shrink: 0;
  filter: grayscale(1);
}

.pvs-deleted-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.pvs-deleted-msg {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* ── Editor Preview Wrapper ────────────────────────────────────── */
.pvs-editor-preview-wrap {
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  background: #f0f7ff;
  position: relative;
}

.pvs-editor-preview-label {
  position: absolute;
  top: -10px;
  left: 16px;
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pvs-poll-block { padding: 18px 16px 16px; }
  .pvs-question { font-size: 16px; }
  .pvs-choice-item,
  .pvs-choice-btn { padding: 12px 14px; gap: 12px; }
  .pvs-submit-btn { width: 100%; }
  .pvs-pie-wrap { flex-direction: column; }
  .pvs-map-svg-wrap svg { max-width: 100%; }
}
