/* ======================
   GLOBAL / LAYOUT
   Mobile-first
   ====================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans Malayalam", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.page {
  max-width: 480px;            /* mobile card width */
  margin: 16px auto 32px;
  padding: 0 12px;
}

/* ======================
   TOP TABS (Ward/Block/District)
   ====================== */

.top-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  flex: 1;
  padding: 6px 0;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #9ca3af;
  background: #d1d5db;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tab--active {
  background: #4b5563;
  color: #f9fafb;
}

/* ======================
   EVM DEVICE SHELL
   ====================== */

.evm-device {
  background: #f5f5f5;
  border-radius: 24px;
  border: 2px solid #e5e7eb;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  padding: 10px;
}

/* Header strip */

.evm-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: #f9fafb;
  border-radius: 18px 18px 12px 12px;
  border: 1px solid #e4e4e7;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.evm-header-section {
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}

.evm-header-section--left {
  text-align: left;
}

.evm-header-section--right {
  text-align: right;
}

.evm-header-label {
  font-weight: 700;
  margin-right: 4px;
}

.evm-header-led {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid #166534;
  vertical-align: middle;
}

.evm-header-led--green {
  background: #22c55e;
}

/* Ballot body */

.evm-body {
  background: #f9fafb;
  border-radius: 18px;
  border: 1px solid #e4e4e7;
  padding: 6px 0 8px;
}

/* ======================
   TABLE-LIKE GRID
   ====================== */

.evm-table {
  width: 100%;
}

/* Each row = grid with 5 columns:
   [SLNO] [Candidate] [Symbol] [LED] [Button]
*/
.evm-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 56px 26px 72px;
  align-items: stretch;
  min-height: 38px;
  border-bottom: 1px solid #e5e7eb;
}

.evm-row:last-child {
  border-bottom: none;
}

/* Cells */

.evm-cell {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  font-size: 14px;
}

.evm-cell--slno {
  border-right: 1px solid #e5e7eb;
  justify-content: center;
  font-size: 13px;
}

.evm-cell--candidate {
  border-right: 1px solid #e5e7eb;
}

.evm-cell--symbol {
  justify-content: center;
  border-right: 1px solid #e5e7eb;
}

.evm-cell--led {
  justify-content: center;
  border-right: 1px solid #e5e7eb;
}

.evm-cell--button {
  justify-content: center;
}

/* Candidate text (Malayalam bigger, others smaller) */

.candidate-name-ml {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 1px;
}

.candidate-name-en {
  font-size: 11px;
  color: #4b5563;
}

.candidate-party {
  font-size: 11px;
  color: #6b7280;
}

/* Symbol box */

.symbol-box {
  width: 44px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.symbol-box img {
  max-height: 22px;
  max-width: 38px;
}

/* LED + Button */

.led-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #991b1b; /* red */
  border: 2px solid #7f1d1d;
}

.led-dot--off {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.led-dot--green {
  background: #16a34a;
  border-color: #166534;
}

.vote-button {
  width: 66px;
  height: 30px;
  border-radius: 16px;
  border: none;
  background: #0f3c86; /* dark blue like EVM */
  cursor: pointer;
  box-shadow: 0 2px 0 #082f49;
}

.vote-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #082f49;
}

.vote-button--disabled {
  background: #9ca3af;
  box-shadow: none;
  cursor: default;
}

/* Row highlight when selected */

.evm-row--selected {
  background: #e0f2fe;
}

/* ======================
   STATUS BAR
   ====================== */

.status-bar {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #374151;
}

.status-bar strong {
  font-weight: 600;
}

/* ======================
   TOAST
   ====================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 7px 14px;
  background: #16a34a;
  color: #f9fafb;
  font-size: 13px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.toast--show {
  opacity: 1;
}

/* ======================
   LARGER SCREENS
   (scale up for tablets/desktop)
   ====================== */

@media (min-width: 640px) {
  .page {
    max-width: 900px;
    margin-top: 24px;
    padding: 0 16px;
  }

  .top-tabs {
    gap: 16px;
  }

  .tab {
    max-width: 160px;
    padding: 8px 0;
    font-size: 14px;
  }

  .evm-device {
    padding: 16px;
    border-radius: 28px;
  }

  .evm-header {
    padding: 12px 24px;
    margin-bottom: 12px;
    font-size: 16px;
  }

  .evm-row {
    grid-template-columns: 70px minmax(0, 1fr) 110px 60px 120px;
    min-height: 42px;
  }

  .evm-cell {
    padding: 6px 10px;
    font-size: 15px;
  }

  .candidate-name-ml {
    font-size: 17px;
  }
  .candidate-name-en,
  .candidate-party {
    font-size: 12px;
  }

  .symbol-box {
    width: 64px;
    height: 40px;
  }

  .symbol-box img {
    max-height: 30px;
    max-width: 56px;
  }

  .led-dot {
    width: 18px;
    height: 18px;
  }

  .vote-button {
    width: 96px;
    height: 36px;
    border-radius: 18px;
  }

  .status-bar {
    flex-direction: row;
    justify-content: space-between;
    font-size: 14px;
  }
}
/* ================
   VVPAT OVERLAY
   ================ */

.hidden {
  display: none !important;
}

.vvpat-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at top, #ffffff 0, #d4d4d8 45%, #9ca3af 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vvpat-card {
  max-width: 360px;
  width: 100%;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
  padding: 18px 18px 16px;
  text-align: center;
  position: relative;
}

.vvpat-heading {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  line-height: 1.35;
}

.vvpat-heading p:first-child {
  color: #111827;
}

.vvpat-heading p:last-child {
  color: #059669;
}

.vvpat-card-main {
  background: #f9fafb;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.vvpat-photo-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  background: #e5e7eb;
}

.vvpat-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vvpat-voted-chip {
  position: absolute;
  left: 12px;
  bottom: 14px;
  padding: 6px 14px;
  background: #1d4ed8;
  color: #f9fafb;
  border-radius: 999px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vvpat-check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.vvpat-info {
  width: 100%;
  padding-inline: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vvpat-name-ml {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.vvpat-name-en {
  font-size: 12px;
  color: #4b5563;
}

.vvpat-party {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  text-align: left;
}

.vvpat-symbol-wrap {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d4d4d8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vvpat-symbol {
  max-width: 60px;
  max-height: 60px;
}

.vvpat-ok-btn {
  margin-top: 14px;
  padding: 8px 26px;
  border-radius: 999px;
  border: none;
  background: #0f3c86;
  color: #f9fafb;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
}

.vvpat-ok-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
}
