
/* ================================
   POLLING STATION - MODERN DESIGN
================================ */

:root {
  --primary: #6246ea;
  --primary-dark: #4932c6;
  --background: #f6f7fc;
  --white: #ffffff;
  --text: #24243b;
  --muted: #73758b;
  --border: #e6e7f0;
  --shadow: 0 8px 30px rgba(35, 30, 80, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

/* NAVBAR */

header {
  background: var(--white);
  padding: 18px 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

header h1 {
  margin: 0;
  color: var(--primary);
  font-size: 25px;
  font-weight: 800;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

nav a:hover {
  color: var(--primary);
}

/* MAIN LAYOUT */

main {
  width: min(1100px, 92%);
  margin: 45px auto;
  text-align: center;
}

main h2 {
  font-size: 30px;
  margin-bottom: 10px;
}

main > p {
  color: var(--muted);
}

/* BUTTONS */

button,
.btn {
  display: inline-block;
  background: linear-gradient(135deg, #6246ea, #8665f5);
  color: white;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(98,70,234,0.25);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #a99aff;
  outline-offset: 3px;
}

/* DASHBOARD STATS */

.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 35px 0;
}

.stat-card {
  background: var(--white);
  padding: 28px 20px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-card h3 {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}

.stat-card h2 {
  font-size: 38px;
  color: var(--primary);
  margin: 8px 0 0;
}

/* SEARCH */

.search-section {
  max-width: 650px;
  margin: 25px auto;
}

.search-section input {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  font-size: 16px;
  box-shadow: var(--shadow);
}

/* CATEGORY FILTER */

.category-filter {
  max-width: 650px;
  margin: 20px auto 30px;
  text-align: left;
}

.category-filter label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.category-filter select,
.poll-card select {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  font-size: 15px;
}

/* POLL CARDS */

.poll-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 30px 0;
  text-align: left;
}

.poll-card {
  background: var(--white);
  padding: 28px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: left;
  max-width: 650px;
  margin: 25px auto;
}

.poll-list .poll-card {
  width: 100%;
  max-width: none;
  margin: 0;
}

.poll-card h3 {
  margin-top: 0;
  font-size: 19px;
}

.poll-card h2 {
  text-align: center;
}

.poll-card a:not(.btn) {
  color: var(--primary);
  margin-left: 10px;
  font-weight: 600;
  text-decoration: none;
}

.poll-category {
  display: inline-block;
  background: #eee9ff;
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* CREATE POLL FORM */

.poll-card label {
  display: block;
  margin: 15px 0 7px;
  font-weight: 600;
}

.poll-card input[type="text"] {
  display: block;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
}

.poll-card form button {
  margin-top: 20px;
}

/* VOTING OPTIONS */

.vote-option {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.vote-option:hover {
  background: #f5f2ff;
  border-color: var(--primary);
}

.vote-option input {
  accent-color: var(--primary);
}

/* RESULTS */

.result-item {
  margin: 22px 0;
}

.result-track {
  height: 15px;
  background: #e9e8f2;
  border-radius: 20px;
  overflow: hidden;
}

.result-fill {
  height: 100%;
  background: linear-gradient(90deg, #6246ea, #a18aff);
  border-radius: 20px;
  transition: width 0.5s ease;
}

.live-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #16a34a;
  font-weight: 600;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

/* SHARE */

.share-section {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.share-section button {
  margin: 7px;
}

#shareMessage {
  color: var(--primary);
  font-weight: 600;
}

#updateStatus,
#noSearchResults {
  color: var(--muted);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

/* FOOTER */

.site-footer {
  background: #24243b;
  color: #ddd;
  text-align: center;
  padding: 25px 15px;
  margin-top: 60px;
}

.site-footer p {
  margin: 0;
  font-size: 14px;
}

/* MOBILE */

@media (max-width: 768px) {
  .stats-container,
  .poll-list {
    grid-template-columns: 1fr;
  }

  header {
    padding: 18px 5%;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  main {
    margin: 30px auto;
  }

  main h2 {
    font-size: 25px;
  }

  .poll-card {
    padding: 20px;
  }

  .stat-card h2 {
    font-size: 30px;
  }
}

/* Poll Card Button Alignment */

.poll-list .poll-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.poll-list .poll-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.poll-list .poll-card .btn {
  margin: 0;
}

.poll-list .poll-card a:not(.btn) {
  margin-left: 0;
}

/* Better dashboard spacing */

.dashboard {
  padding-top: 20px;
}

.stats-container {
  margin-top: 25px;
}

@media (max-width: 768px) {
  .poll-list {
    grid-template-columns: 1fr;
  }
}

/* Admin login */

.poll-card input[type="password"] {
  display: block;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
}

header nav form {
  margin: 0;
}

header nav form button {
  padding: 9px 16px;
}

/* ADMIN POLL STATUS */

.status-active {
  color: #16a34a;
  font-weight: bold;
}

.status-closed {
  color: #dc2626;
  font-weight: bold;
}

.close-btn {
  background: #dc2626;
  margin-top: 12px;
}

.reopen-btn {
  background: #16a34a;
  margin-top: 12px;
}

.closed-message {
  background: #fee2e2;
  color: #991b1b;
  padding: 15px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
}

/* ADMIN DELETE BUTTON */

.delete-btn {
  background: #b91c1c;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 10px;
}

.delete-btn:hover {
  background: #991b1b;
}

.delete-btn {
  background-color: #dc2626;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
}

.delete-btn:hover {
  background-color: #b91c1c;
}

/* ADMIN EDIT POLL */

.edit-btn {
  display: inline-block;
  background: #6246ea;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
}

.edit-btn:hover {
  background: #4f35d5;
  color: white;
}


.poll-card form input:not([type="hidden"]),
.poll-card form select {
  width: 100%;
  padding: 12px;
  margin: 8px 0 18px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}


/* =====================================
   STEP 18 - MOBILE RESPONSIVE DESIGN
===================================== */

/* Prevent horizontal overflow */
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  overflow-wrap: break-word;
}

img, video, iframe {
  max-width: 100%;
}

/* Mobile-friendly forms */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  max-width: 100%;
}

textarea {
  resize: vertical;
}

button,
input[type="submit"],
.btn {
  max-width: 100%;
}

/* Tablets */
@media (max-width: 768px) {

  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Poll cards in one column */
  .poll-grid,
  .polls-grid,
  .stats-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Navigation */
  nav,
  .navbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Forms and cards */
  .poll-card,
  .form-card,
  .admin-card {
    max-width: 100%;
    min-width: 0;
  }

  /* Prevent tables from breaking layout */
  .table-wrapper {
    overflow-x: auto;
  }

  /* Headings */
  h1 {
    font-size: clamp(24px, 6vw, 34px);
  }

  h2 {
    font-size: clamp(20px, 5vw, 28px);
  }
}

/* Small mobile phones */
@media (max-width: 480px) {

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .poll-card,
  .form-card,
  .admin-card {
    padding: 16px;
  }

  /* Touch-friendly controls */
  button,
  .btn,
  input[type="submit"] {
    min-height: 44px;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px;
  }

  .poll-grid,
  .polls-grid,
  .stats-grid,
  .dashboard-grid {
    gap: 12px;
  }
}

/* =====================================
   STEP 18.2 - PROFESSIONAL UI
===================================== */

/* Smooth navigation */
html {
  scroll-behavior: smooth;
}

/* Navbar improvements */
header {
  position: relative;
  z-index: 10;
}

header nav a {
  transition: color 0.2s ease;
}

header nav a:hover {
  color: var(--primary);
}

/* Poll card hover effects */
.poll-list .poll-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.poll-list .poll-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(35, 30, 80, 0.12);
  border-color: #d7ceff;
}

/* Dashboard cards */
.stat-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(35, 30, 80, 0.1);
}

/* Better search and form focus */
.search-section input,
.poll-card input[type="text"],
.poll-card input[type="password"],
.poll-card select {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.search-section input:focus,
.poll-card input[type="text"]:focus,
.poll-card input[type="password"]:focus,
.poll-card select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(98, 70, 234, 0.1);
}

/* Voting option selection */

.vote-option {
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}


.vote-option:has(input[type="radio"]:checked) {
  background: #f0ebff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(98, 70, 234, 0.12);
}

/* Better button interactions */
button:active,
.btn:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Admin action buttons */
.close-btn,
.reopen-btn,
.delete-btn,
.edit-btn {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Mobile improvements */
@media (max-width: 768px) {
  header nav {
    gap: 10px 16px;
  }

  .poll-list {
    gap: 16px;
  }

  .stats-container {
    gap: 14px;
  }

  .poll-list .poll-card {
    padding: 20px;
  }

  .poll-list .poll-card:hover,
  .stat-card:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 22px;
  }

  header nav a {
    font-size: 14px;
  }

  .poll-card {
    padding: 16px;
  }

  .share-section button {
    margin: 5px;
  }

  .poll-list .poll-card .btn {
    text-align: center;
  }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .poll-list .poll-card,
  .stat-card,
  .vote-option,
  button,
  .btn {
    transition: none;
  }
}

/* =====================================
   STEP 18.2.1 - POLL CARD REFINEMENT
===================================== */

.poll-list {
  align-items: stretch;
}

.poll-list .poll-card {
  padding: 24px;
  gap: 14px;
  border-radius: 18px;
  min-height: 230px;
}

.poll-list .poll-card h3 {
  font-size: 20px;
  line-height: 1.4;
  margin: 0;
  color: var(--text);
}

.poll-list .poll-card .poll-category {
  margin: 0;
  align-self: flex-start;
}

.poll-list .poll-card .btn {
  padding: 11px 20px;
  border-radius: 10px;
}

.poll-list .poll-card a:not(.btn) {
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .poll-list .poll-card {
    min-height: auto;
    padding: 20px;
  }
}

/* =====================================
   STEP 18.3 - LOADING BUTTON
===================================== */

.is-loading {
  position: relative;
  cursor: wait;
  opacity: 0.8;
  pointer-events: none;
}

.is-loading::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  vertical-align: middle;
  animation: button-spin 0.7s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-loading::after {
    animation: none;
  }
}

/* =====================================
   STEP 18.4 - SUCCESS / ERROR ALERTS
===================================== */

.site-alert {
  max-width: 650px;
  margin: 18px auto;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  line-height: 1.5;
}

.site-alert-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.site-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.site-alert-info {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.site-alert:focus {
  outline: none;
}

@media (max-width: 480px) {
  .site-alert {
    padding: 13px 14px;
    font-size: 14px;
  }
}

/* =====================================
   STEP 18.5 - PROFESSIONAL ERROR PAGE
===================================== */

.error-page {
  max-width: 620px;
  margin: 70px auto;
  padding: 48px 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.error-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 800;
}

.error-page h2 {
  font-size: 28px;
  color: var(--text);
  margin: 0 0 12px;
}

.error-page p {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 28px;
}

.error-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.error-home-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.error-home-link:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .error-page {
    margin: 35px auto;
    padding: 32px 18px;
  }

  .error-page h2 {
    font-size: 23px;
  }

  .error-actions {
    flex-direction: column;
  }
}

/* STEP 18.7 - SOCIAL MEDIA TOP BAR */

.social-topbar {
  background: #25243d;
  color: #ffffff;
  padding: 10px 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.social-label {
  font-size: 14px;
  font-weight: 600;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.social-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: #a99bff;
}

@media (max-width: 600px) {
  .social-topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .social-links {
    gap: 12px;
  }

  .social-links a {
    font-size: 12px;
  }
}

/* Colorful Hindi Caption */
.site-caption {
  text-align: center;
  font-family: "Nirmala UI", "Mangal", sans-serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.9;
  letter-spacing: 0.3px;

  background: linear-gradient(
    90deg,
    #ff3b30,
    #ff9500,
    #e91e63,
    #7c3aed,
    #008cff
  );

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  margin: 10px auto 18px;
  padding: 5px 15px;
  max-width: 850px;
}

@media (max-width: 600px) {
  .site-caption {
    font-size: 15px;
    line-height: 1.8;
  }
}

/* Rajasthan Selection - Colorful 3x2 Grid */

.rajasthan-selection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 25px auto;
  padding: 25px;
  border-radius: 18px;
  background: #f8f7ff;
}

.rajasthan-selection h2,
.rajasthan-selection p {
  grid-column: 1 / -1;
  text-align: center;
  margin: 5px 0;
}

.rajasthan-selection h2 {
  color: #7134d3;
  font-size: 26px;
  font-weight: 900;
}

.rajasthan-selection p {
  color: #e91e63;
  font-size: 17px;
  font-weight: 700;
}

.rajasthan-selection label {
  display: block;
  font-weight: 800;
  font-size: 16px;
  color: #673ab7;
}

/* Each dropdown */
.rajasthan-selection select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 2px solid #a78bfa;
  border-radius: 10px;
  background: white;
  color: #24243e;
  font-size: 15px;
  font-weight: 700;
}

/* Mobile view */
@media (max-width: 600px) {
  .rajasthan-selection {
    grid-template-columns: 1fr;
    padding: 15px;
  }
}

/* Rajasthan Area Colorful Cards */

.rajasthan-selection .area-box {
  padding: 18px;
  border-radius: 14px;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rajasthan-selection .area-box label {
  font-size: 17px;
  font-weight: 900;
}

.rajasthan-selection .area-box select {
  width: 100%;
  font-weight: 700;
}

.district-box {
  background: #ffe5ef;
  border-color: #e91e63 !important;
}

.assembly-box {
  background: #efe4ff;
  border-color: #7c3aed !important;
}

.samiti-box {
  background: #e3f2ff;
  border-color: #0284c7 !important;
}

.panchayat-box {
  background: #e2f8e9;
  border-color: #16a34a !important;
}

.ward-box {
  background: #fff0d9;
  border-color: #f59e0b !important;
}

.zilla-box {
  background: #ffe6f5;
  border-color: #db2777 !important;
}

/* Poll voting options alignment fix */

.poll-card label.vote-option {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 12px !important;
  text-align: left !important;
  direction: ltr !important;
  padding: 18px !important;
}

.poll-card label.vote-option input[type="radio"] {
  position: static !important;
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  flex: 0 0 18px !important;
  transform: none !important;
}
.contact-success {
  background: #e8f8ee;
  color: #176b37;
  border: 1px solid #a5dfb5;
  padding: 16px;
  border-radius: 12px;
  margin: 15px 0 22px;
  font-weight: 600;
  text-align: center;
}

/* ===================================
   MOBILE RESPONSIVE - HOME HEADER
   =================================== */

@media (max-width: 480px) {

  header {
    padding: 18px 12px;
  }

  header h1 {
    font-size: 25px;
    line-height: 1.3;
    margin: 8px 0 14px;
  }

  .site-caption {
    font-size: 16px;
    line-height: 1.6;
    margin: 12px auto 18px;
    padding: 0 6px;
    max-width: 100%;
  }

  header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
  }

  header nav a {
    font-size: 15px;
  }

  .rajasthan-selection h2 {
    font-size: 25px;
    line-height: 1.4;
    overflow-wrap: break-word;
  }

}

/* ===================================
   RAJASTHAN SELECTION - MOBILE VIEW
   =================================== */

@media (max-width: 600px) {

  .rajasthan-selection {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px 12px;
    margin: 15px auto;
  }

  .rajasthan-selection .area-box {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 14px;
    padding: 14px 12px;
  }

  .rajasthan-selection .area-box label {
    display: block;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
  }

  .rajasthan-selection .area-box select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 16px;
    padding: 11px 8px;
  }

}

/* ===================================
   MOBILE - 6 DROPDOWNS IN 3 x 2 GRID
   =================================== */

@media (max-width: 600px) {

  .rajasthan-selection {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 15px 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .rajasthan-selection > h2,
  .rajasthan-selection > p {
    grid-column: 1 / -1;
    text-align: center;
  }

  .rajasthan-selection .area-box {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 8px 5px;
    box-sizing: border-box;
  }

  .rajasthan-selection .area-box label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
  }

  .rajasthan-selection .area-box select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 7px 2px;
  }

}

/* ==========================================
   POLLING STATION - GLOBAL MOBILE RESPONSIVE
   ========================================== */

html {
  max-width: 100%;
}

body {
  max-width: 100%;
  overflow-x: clip;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe, canvas {
  max-width: 100%;
}

img, video {
  height: auto;
}

input, select, textarea, button {
  max-width: 100%;
  font-family: inherit;
}

h1, h2, h3, p, a {
  overflow-wrap: break-word;
}

/* Tablet and Mobile */

@media (max-width: 768px) {

  header {
    width: 100%;
    padding: 18px 12px;
    text-align: center;
  }

  header h1 {
    font-size: clamp(23px, 6vw, 32px);
  }

  header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  header nav a {
    font-size: 14px;
    padding: 9px 12px;
  }

  main,
  .dashboard {
    width: 100%;
    max-width: 100%;
    padding: 15px 10px;
    margin-left: auto;
    margin-right: auto;
  }

  .stats-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    min-width: 0;
    width: 100%;
    padding: 12px 6px;
    text-align: center;
  }

  .stat-card h3 {
    font-size: 12px;
    line-height: 1.4;
  }

  .stat-card h2 {
    font-size: 22px;
  }

  .search-section,
  .category-filter {
    width: 100%;
    max-width: 100%;
  }

  .search-section input,
  .category-filter select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
    padding: 12px;
  }

  .poll-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
  }

  .poll-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px 12px;
  }

  .poll-card h3 {
    font-size: 17px;
    line-height: 1.5;
  }

  .poll-card .btn {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
  }

  .site-footer {
    text-align: center;
    padding: 20px 12px;
    font-size: 13px;
  }

}

/* Small Mobile */

@media (max-width: 480px) {

  .site-caption {
    font-size: 15px;
    line-height: 1.5;
    padding: 0 5px;
  }

  h2 {
    font-size: 22px;
  }

  .stats-container {
    gap: 6px;
  }

  .stat-card {
    padding: 10px 4px;
  }

  .stat-card h3 {
    font-size: 11px;
  }

  .stat-card h2 {
    font-size: 20px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  button,
  .btn {
    min-height: 40px;
  }

}

/* Forms and tables */

@media (max-width: 768px) {

  form {
    max-width: 100%;
  }

  form input:not([type="checkbox"]):not([type="radio"]),
  form select,
  form textarea {
    max-width: 100%;
  }

  table {
    max-width: 100%;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

}

/* ======================================
   POLLING STATION - FINAL MOBILE FIX
   ====================================== */

@media (max-width: 768px) {

  header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  header nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  main,
  .dashboard {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 15px 12px;
  }

  .poll-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .poll-card,
  .form-card,
  .admin-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .poll-card input,
  .poll-card select,
  .poll-card textarea {
    max-width: 100%;
  }

  .vote-option {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .stats-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-card {
    min-width: 0;
  }

  .stat-card h3 {
    font-size: 12px;
  }

  .stat-card h2 {
    font-size: 21px;
  }

  .share-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .share-section button {
    margin: 0;
  }

  .table-wrapper,
  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Small mobile - Rajasthan 3 x 2 grid */

@media (max-width: 600px) {

  .rajasthan-selection {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 12px 6px;
  }

  .rajasthan-selection > h2,
  .rajasthan-selection > p {
    grid-column: 1 / -1;
  }

  .rajasthan-selection .area-box {
    min-width: 0;
    width: 100%;
    padding: 8px 4px;
    margin: 0;
    gap: 6px;
  }

  .rajasthan-selection .area-box label {
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
    margin: 0;
  }

  .rajasthan-selection .area-box select {
    width: 100%;
    min-width: 0;
    padding: 7px 2px;
    font-size: 12px;
  }

  .social-topbar,
  .social-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* POLL SHARE BUTTONS - MOBILE */

@media (max-width: 600px) {

  .share-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px 8px;
  }

  .share-section button,
  .share-section .btn {
    flex: 1 1 110px;
    width: auto;
    min-width: 0;
    max-width: 180px;
    margin: 0;
    padding: 12px 8px;
    font-size: 12px;
    text-align: center;
  }

  .share-section #shareMessage {
    flex-basis: 100%;
    text-align: center;
  }

}

/* HAMBURGER MENU */

.menu-toggle {
  display: none;
}

@media (max-width: 768px) {

  .menu-toggle {
    display: block;
    width: auto;
    margin: 10px auto;
    padding: 11px 20px;
    font-size: 16px;
    cursor: pointer;
  }

  header .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  header .main-nav.menu-open {
    display: flex;
  }

  header .main-nav a {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    background: #f2efff;
    color: #4932c6;
  }

  header .main-nav a:hover {
    background: #e4ddff;
  }

}

/* CREATE POLL BUTTON BELOW TITLE */

.top-create-poll {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto;
  width: 100%;
}

.top-create-btn {
  display: inline-block;
  background: linear-gradient(135deg, #e91e63, #7c3aed);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 5px 15px rgba(124, 58, 237, 0.2);
}

.top-create-btn:hover {
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .top-create-btn {
    font-size: 14px;
    padding: 11px 14px;
    max-width: 100%;
  }
}
