/* Create Proposal — fixed height when switching Normal ↔ Whitelist */
.proposal-dynamic-fields {
  display: grid;
  /* Both field sets share the same cell → height = taller (normal) set */
}

.proposal-dynamic-fields > .proposal-fields-set {
  grid-area: 1 / 1;
  width: 100%;
}

.proposal-fields-set.is-hidden {
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

.proposal-fields-set:not(.is-hidden) {
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

/* VoodooDAO Governance styles */

/* Dual wallet buttons (same UX as Plinko / Faucet) */
.wallet-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wallet-btn {
  min-width: 9.5rem;
  height: 2.4rem;
  padding: 0 14px;
  border: none;
  border-radius: 0.5rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.wallet-btn-voodoo {
  background: #073749;
}
.wallet-btn-voodoo:hover:not(:disabled) {
  background: #0a4a61;
}

/* Other button colour matches VoodooBank-V4 */
.wallet-btn-other {
  background: #1e40af;
}
.wallet-btn-other:hover:not(:disabled) {
  background: #1d4ed8;
}

.wallet-btn.is-connected,
.wallet-btn.connected {
  cursor: default;
  opacity: 1;
}

.wallet-btn-voodoo.is-connected,
.wallet-btn-voodoo.connected,
.wallet-btn-voodoo.is-connected:hover,
.wallet-btn-voodoo.connected:hover {
  background: #073749 !important;
}

.wallet-btn-other.is-connected,
.wallet-btn-other.connected,
.wallet-btn-other.is-connected:hover,
.wallet-btn-other.connected:hover {
  background: #1e40af !important;
}

.wallet-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

#rainbowkit-root {
  position: fixed;
  width: 0;
  height: 0;
  overflow: visible;
  z-index: 2147483000;
  pointer-events: none;
}

/* ── ui.js modals — identical to VoodooBank-V4 / Plinko / Miner ── */
body.voodoo-ui-open {
  overflow: hidden;
}

.voodoo-ui-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Self-contained type — ignore body / page h2 rules (Tailwind too) */
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #111 !important;
  -webkit-font-smoothing: antialiased;
}

.voodoo-ui-modal.hidden {
  display: none !important;
}

.voodoo-ui-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.voodoo-ui-panel {
  position: relative;
  background: #fff !important;
  color: #111 !important;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  box-shadow: none;
  border: none;
}

.voodoo-ui-title {
  display: block;
  margin: 0 0 0.5rem !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: #111 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.voodoo-ui-message {
  display: block;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #374151 !important;
  white-space: pre-wrap;
  text-align: center;
}

.voodoo-ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.voodoo-ui-btn {
  border: none !important;
  border-radius: 8px !important;
  padding: 0.55rem 1rem !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  line-height: 1.25 !important;
  min-width: auto;
  height: auto;
}

.voodoo-ui-btn-primary {
  background: #1e40af !important;
  color: #fff !important;
}

.voodoo-ui-btn-secondary {
  background: #e5e7eb !important;
  color: #111 !important;
  text-decoration: none;
  display: inline-flex;
}

.voodoo-ui-btn-ghost {
  background: transparent !important;
  color: #4b5563 !important;
}

/* Gray circle only — same as Bank (no red/green tint) */
.voodoo-ui-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #111 !important;
  background: #e5e7eb !important;
}

/*
 * Scroll model for modern Chrome/Edge (same as Staking / Plinko):
 * Overlay root scrollbars ignore ::-webkit-scrollbar on body/html.
 * Scroll on #page-scroll.windows-scrollbar so exact plugin CSS is visible.
 * Plugin CSS: css/windows-scrollbar.css (1:1 WordPress rules).
 */
html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a url('../assets/voodoo-token-background.png') center center / cover no-repeat fixed;
  color: white;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden; /* scroll is on #page-scroll */
  display: block;
  box-sizing: border-box;
}

#page-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

body.voodoo-ui-open #page-scroll {
  overflow: hidden;
}

footer {
  flex-shrink: 0;
  width: 100%;
}

.proposal-card {
  background: rgba(30, 41, 59, 0.9);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-active { color: #4caf50; }
.status-queued { color: #ffeb3b; }
.status-executed { color: #2196f3; }
.status-canceled { color: #f44336; }
.status-ended { color: #94a3b8; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border: 1px solid #444;
  background: transparent;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

colgroup col:nth-child(1) { width: 50px; }
colgroup col:nth-child(2) { width: 140px; }
colgroup col:nth-child(3) { width: 220px; }
colgroup col:nth-child(4) { width: 90px; }
colgroup col:nth-child(5) { width: 90px; }
colgroup col:nth-child(6) { width: 90px; }
colgroup col:nth-child(7) { width: 90px; }
colgroup col:nth-child(8) { width: 140px; }
colgroup col:nth-child(9) { width: 140px; }

th {
  font-weight: 600;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #444;
}

tr:hover {
  background: rgba(100, 116, 139, 0.2);
}

.vote-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.vote-yes {
  background: #4caf50;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: bold;
  white-space: nowrap;
  min-width: 50px;
  text-align: center;
}

.vote-no {
  background: #f44336;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: bold;
  white-space: nowrap;
  min-width: 50px;
  text-align: center;
}

.action-btn {
  background: #2563eb;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: bold;
  white-space: nowrap;
}

.action-btn.execute {
  background: #7c3aed;
}

.vote-yes:disabled,
.vote-no:disabled,
.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#info-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#info-content {
  background: #1e293b;
  width: 90vw;
  max-width: 640px;
  min-width: 320px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 2rem;
  padding: 2.5rem;
  border-radius: 16px;
  position: relative;
  box-sizing: border-box;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  border: 1px solid rgba(148, 163, 184, 0.2);
  scrollbar-width: thin;
  scrollbar-color: #475569 #1e293b;
}

#info-content::-webkit-scrollbar { width: 6px; }
#info-content::-webkit-scrollbar-track { background: #1e293b; border-radius: 10px; }
#info-content::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 10px;
  border: 1px solid #334155;
}
#info-content::-webkit-scrollbar-thumb:hover { background: #64748b; }

.close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2.2rem;
  font-weight: bold;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

.close-btn:hover {
  color: white;
}

footer p { font-size: 18px; }
footer a { font-size: 28px; color: white; }
footer a:hover { color: white; }

td:nth-child(4),
td:nth-child(5),
td:nth-child(6) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.token-management {
  background: rgba(30, 41, 59, 0.9);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.token-stat {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Compact create-proposal form for laptop viewports */
.create-proposal-box select,
.create-proposal-box input,
.create-proposal-box textarea {
  box-sizing: border-box;
}

@media (max-height: 900px) {
  .token-stat {
    font-size: 1.25rem;
  }
  main {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

#my-balance,
#my-locked,
#dao-total-locked {
  color: white;
}

@media (max-width: 640px) {
  #info-content {
    width: 94vw;
    margin: 1.5rem;
    padding: 1.8rem 1.5rem;
    border-radius: 14px;
  }
}
