/* ============================================================
   Vote Modal — global shared component
   Included in en/, si/, ta/ via <link rel="stylesheet" href="../assets/vote-modal.css">
   ============================================================ */

/* ── Entrance animation ── */
@keyframes voteModalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Modal container
     Override tracker modal defaults:
       margin-top: 60px → 0
       height: 83vh    → auto
       max-width: 1400px → 480px
   ── */
.vote-modal-content {
  max-width: 480px !important;
  width: 100%;
  height: auto !important;
  max-height: 90vh;
  margin-top: 0 !important;
  animation: voteModalFadeIn 0.3s ease;
}

/* ── Header — always a single row (title left, ✕ right)
     Mobile breakpoints in styles.css force .modal-header to
     flex-direction:column and .modal-close to position:absolute;
     both are reset here for the vote modal.
   ── */
.vote-modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: space-between;
  gap: 16px;
}

.vote-modal-header .modal-header-content {
  flex: 1;
  display: flex;
  align-items: flex-start;
  width: auto;
  justify-content: flex-start;
}

.vote-modal-header h2 {
  font-size: 20px !important;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

/* Reset the absolute-position override mobile breakpoints apply */
.vote-modal-header .modal-close {
  position: static !important;
  top: auto !important;
  right: auto !important;
  flex-shrink: 0;
  padding: 6px;
  margin-top: 2px;
}

/* ── Body ── */
.vote-modal-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

/* ── Proposal summary callout ── */
.vote-modal-summary {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--pf-accent);
}

/* ── Form fields
     .input inside @media(max-width:1024px) gets max-width:200px
     (to constrain the search bar). Reset it here so name/email
     inputs fill the full modal width.
   ── */
.vote-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vote-form .field {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}

.vote-form .field:last-of-type {
  margin-bottom: 0;
}

.vote-form .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.1px;
}

.vote-form .input {
  max-width: 100% !important;
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vote-form .input:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px rgba(40, 142, 118, 0.15);
}

/* ── Error message ── */
.vote-form-error {
  font-size: 13px;
  color: #dc2626;
  line-height: 1.4;
  margin: 8px 0;
}

/* ── Submit button
     .button uses height:52px and border-radius:999px (pill).
     Override to a standard rectangular form button.
   ── */
.vote-submit-btn {
  width: 100% !important;
  height: 50px !important;
  border-radius: 10px !important;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 12px rgba(40, 142, 118, 0.28) !important;
}

.vote-submit-btn:hover {
  box-shadow: 0 8px 16px rgba(40, 142, 118, 0.38) !important;
}

.vote-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Pending confirmation state ── */
.vote-pending-msg {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  text-align: center;
  padding: 32px 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--pf-accent);
  margin: 0;
}

/* ── Success state ── */
.vote-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 48px 24px;
  text-align: center;
}

.vote-success p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* ── Mobile — bottom sheet ── */
@media (max-width: 520px) {
  .vote-modal-content {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-top: auto !important;
    height: auto !important;
    max-height: 92vh;
  }

  .modal-overlay:has(.vote-modal-content) {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .vote-modal-header {
    padding: 20px 24px 16px;
  }

  .vote-modal-body {
    padding: 24px 20px;
    max-height: calc(92vh - 70px);
  }
}
