.voter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(340px, 1fr);
  gap: 2.5rem;
  align-items: start;
  margin-top: 2rem;
}

.position-section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  position: relative;
  overflow: hidden;
}

.position-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #10b981, #34d399, #059669);
  opacity: 0.9;
  border-radius: 6px 0 0 6px;
}

.position-section:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 30px 60px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.position-section .section-heading.compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  gap: 1rem;
}

.position-section .section-heading.compact h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Candidate Card Grid */
.candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

/* Interactive Candidate Card */
.candidate-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 20px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Glassmorphism shine effect */
.candidate-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  z-index: 1;
  pointer-events: none;
}

.candidate-card:hover::after {
  left: 200%;
}

/* Radio button overlay styling */
.candidate-card input[type="radio"] {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  accent-color: #10b981;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.candidate-card input[type="radio"]:hover {
  transform: scale(1.1);
}

.candidate-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.08);
}

/* Selected State */
.candidate-card.selected {
  background: linear-gradient(145deg, #ffffff, #f5f3ff);
  border-color: #10b981;
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.15), inset 0 0 0 1px #10b981;
}

.candidate-card.selected .avatar {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transform: scale(1.05);
}

.candidate-card.selected .candidate-name {
  color: #4f46e5;
}

/* Abstain Card Specific Styling */
.candidate-card.abstain {
  background: rgba(241, 245, 249, 0.5);
  border: 2px dashed rgba(148, 163, 184, 0.4);
}

.candidate-card.abstain:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.candidate-card.abstain.selected {
  border-color: #64748b;
  border-style: solid;
  background: #f1f5f9;
  box-shadow: 0 15px 35px rgba(100, 116, 139, 0.15), inset 0 0 0 1px #64748b;
}

.candidate-card.abstain .avatar {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: none;
  border: 2px solid transparent;
}

/* Metadata Text inside cards */
.candidate-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 2;
}

.candidate-meta .candidate-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
  transition: color 0.3s ease;
}

.candidate-meta .candidate-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  border: 3px solid white;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

/* Premium Sidebar Summary Panel */
.summary-panel {
  padding: 2.5rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  position: sticky;
  top: 2rem;
}

.summary-panel h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: none;
}

/* Custom Progress Track for the dynamic progress bar */
.progress-container {
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-percentage {
  font-size: 1.25rem;
  font-weight: 900;
  color: #10b981;
}

.progress-track {
  height: 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Selection list items */
#selectionSummary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

#selectionSummary .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#selectionSummary .summary-row:hover {
  background: #ffffff;
  transform: translateX(5px) scale(1.02);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

#selectionSummary .summary-key {
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
}

#selectionSummary .summary-val {
  font-weight: 800;
  font-size: 0.95rem;
  color: #10b981;
  text-align: right;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#selectionSummary .summary-row:has(.summary-val:empty),
#selectionSummary .summary-row.not-selected {
  background: rgba(241, 245, 249, 0.5);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

#selectionSummary .summary-row.not-selected .summary-val {
  color: #94a3b8 !important;
  font-weight: 600;
}

/* Submitting controls */
.summary-panel .primary-button {
  height: 3.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  color: white;
  border: none;
  cursor: pointer;
}

.summary-panel .primary-button:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.summary-panel .primary-button:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  color: #f8fafc;
}

.summary-panel .ghost-button.subtle {
  border-radius: 16px;
  padding: 1rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.summary-panel .ghost-button.subtle:hover {
  background: rgba(241, 245, 249, 0.8);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.2);
}

/* Adjustments for responsive view */
@media (max-width: 1100px) {
  .voter-layout {
    grid-template-columns: 1fr;
  }

  .candidate-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .summary-panel {
    position: relative;
    top: 0;
  }
}

@media (max-width: 720px) {
  .candidate-list {
    grid-template-columns: 1fr;
  }

  .position-section {
    padding: 1.5rem;
  }

  .summary-panel {
    padding: 1.5rem;
  }
}