/* ===== CONTAINER ===== */
.voting-container {
  position: relative;
  min-height: calc(100vh - 70px);
  overflow: hidden;
  font-family: 'Helvetica', Arial, sans-serif;
  background: linear-gradient(135deg, #e0f7f1, #baddcf, #f8fefb);
}

/* ===== WAVES BACKGROUND ===== */
.wave-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.wave-bg svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: auto;
  min-height: 150px;
  pointer-events: none;
}

.parallax > use {
  animation: moveWaves 25s cubic-bezier(0.55,0.5,0.45,0.5) infinite;
}

.parallax > use:nth-child(1) { animation-duration: 7s; animation-delay: -2s; }
.parallax > use:nth-child(2) { animation-duration: 10s; animation-delay: -3s; }
.parallax > use:nth-child(3) { animation-duration: 13s; animation-delay: -4s; }

@keyframes moveWaves {
  0% { transform: translate3d(-90px,0,0); }
  100% { transform: translate3d(85px,0,0); }
}

/* ===== WAVE OVERLAY ===== */
.wave-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(12,74,110,0.7), hsla(138, 73%, 58%, 0.6), rgba(14,165,233,0.6));
  z-index: 1;
  pointer-events: none;
}

/* ===== WATER DROPS ===== */
.water-drops {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 5;
  pointer-events: none;
}

.water-drop {
  position: absolute;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(135,206,250,0.7));
  border-radius: 50%;
  pointer-events: none !important;
  animation: waterDrop linear infinite;
  box-shadow: 0 0 8px rgba(135,206,235,0.6), inset 0 0 3px rgba(255,255,255,0.8);
  will-change: transform;
}

@keyframes waterDrop {
  0% { 
    transform: translateY(-10vh) translateX(0) scale(0); 
    opacity: 0;
  }
  10% { 
    opacity: 0.8;
  }
  50% { 
    transform: translateY(50vh) translateX(20px) scale(1); 
    opacity: 0.9;
  }
  80% {
    opacity: 0.6;
  }
  100% { 
    transform: translateY(100vh) translateX(-20px) scale(0.5); 
    opacity: 0;
  }
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper-voting {
  position: relative;
  z-index: 10;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: hsla(185, 29%, 76%, 0.95);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 10px rgba(0,0,0,0.1);
  text-align: center;
  animation: slideDown 0.5s ease;
  width: 60%;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.page-header .title {
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg,#0c4a6e,#0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.page-header p {
  font-size: 14px;
  color: #475569;
  margin-top: 10px;
}

/* ===== BALLOT CARD ===== */
.ballot-card {
  background: rgba(255,255,255,0.98);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  padding: 30px;
  width: 100%;
  max-width: 800px;
  animation: slideUp 0.6s ease;
  position: relative;
  z-index: 21;
  pointer-events: auto;
}

/* Override box styling from backend */
.box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.box-header {
  background: transparent !important;
  border-bottom: 2px solid #e0e0e0 !important;
  padding-bottom: 15px !important;
  margin-bottom: 20px !important;
}

.box-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0c4a6e !important;
}

.box-body {
  padding: 0 !important;
}

#candidate_list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#candidate_list li {
  padding: 12px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

#candidate_list li:hover {
  background: #e0f7f1;
  transform: translateX(5px);
}

#candidate_list img.clist {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

#candidate_list span.cname {
  flex: 1;
  font-weight: 500;
  color: #333;
}

/* ===== BUTTONS ===== */
.btn-modern {
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  margin: 0 10px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  z-index: 22;
  pointer-events: auto;
}

.btn-preview {
  background: linear-gradient(135deg,#f59e0b,#ef4444);
  color: white;
}

.btn-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245,158,11,0.3);
}

.btn-submit {
  background: linear-gradient(135deg,#10b981,#059669);
  color: white;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16,185,129,0.3);
}

.btn-modern:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Ultra Compact Loading Modal */
.loading-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  text-align: center;
}

.loading-content {
  background: white;
  border-radius: 12px;
  padding: 20px 25px;
  text-align: center;
  animation: scaleIn 0.3s ease;
  pointer-events: auto;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  display: inline-block;
  width: auto;
}

/* Tiny Spinner */
.loading-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 12px auto;
  border: 2.5px solid #e0e0e0;
  border-top: 2.5px solid #10b981;
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
  display: block;
}

.loading-message {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

.loading-submessage {
  font-size: 10px;
  color: #999;
  margin-top: 5px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Tiny Checkmark */
.checkmark {
  width: 30px;
  height: 30px;
  margin: 0 auto 12px auto;
}

.loading-message {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

.loading-submessage {
  font-size: 10px;
  color: #999;
  margin-top: 5px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Simple Checkmark for Success */
.checkmark {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px auto;
  animation: checkmarkScale 0.5s ease;
}

.checkmark-circle {
  stroke: #10b981;
  stroke-width: 2;
  fill: none;
}

.checkmark-check {
  stroke: #10b981;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmarkDraw 0.5s ease forwards 0.3s;
}

@keyframes checkmarkDraw {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes checkmarkScale {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-message {
  margin-top: 10px;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.loading-submessage {
  margin-top: 8px;
  font-size: 13px;
  color: #999;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Info Modal - Centers the entire container */
.info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10001;
  justify-content: center;
  align-items: center;
}

/* Make sure the modal is shown as flex when active */
.info-modal[style*="display: block"],
.info-modal[style*="display: flex"],
.info-modal.show {
  display: flex !important;
}

.info-modal-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  animation: scaleIn 0.3s ease;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Center content inside modal */
.info-modal-header {
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-modal-header h3 {
  margin: 0;
  color: #0c4a6e;
}

.close-info {
  cursor: pointer;
  font-size: 28px;
  color: #999;
  transition: color 0.3s;
  line-height: 1;
}

.close-info:hover {
  color: #ef4444;
}

.info-modal-body {
  margin-bottom: 20px;
  line-height: 1.6;
  text-align: center;
}

.info-modal-body img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 15px auto;
}

.text-center {
  text-align: center;
}

/* Animation */
@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.text-center {
  text-align: center;
}

/* Preview Modal - Centered */
.preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

/* Make sure modal is displayed as flex when shown */
.preview-modal[style*="display: block"],
.preview-modal.show {
  display: flex !important;
}

.preview-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
  pointer-events: auto;
  position: relative;
  margin: 0 auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.preview-header {
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-header h3 {
  margin: 0;
  color: #0c4a6e;
}

.close-preview {
  cursor: pointer;
  font-size: 28px;
  color: #999;
  transition: color 0.3s;
  line-height: 1;
}

.close-preview:hover {
  color: #ef4444;
}

.preview-body {
  margin-bottom: 20px;
}

.preview-selection {
  background: #f0fdf4;
  padding: 15px;
  border-radius: 10px;
  margin: 10px 0;
  border-left: 4px solid #10b981;
}

/* Animation */
@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  border-radius: 10px;
  padding: 15px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  pointer-events: auto;
}

.toast-notification.show {
  transform: translateX(0);
}

.toast-icon {
  font-size: 20px;
}

.toast-icon.success {
  color: #10b981;
}

.toast-icon.error {
  color: #ef4444;
}

.toast-icon.warning {
  color: #f59e0b;
}

.toast-message {
  font-size: 14px;
  color: #333;
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp { from { opacity:0; transform:translateY(20px);} to {opacity:1; transform:translateY(0);} }
@keyframes slideDown { from { opacity:0; transform:translateY(-20px);} to {opacity:1; transform:translateY(0);} }

/* Disabled form overlay */
.form-disabled {
  position: relative;
  pointer-events: none;
  opacity: 0.5;
}

/* Ballot content styling */
.ballot-content {
  max-height: 500px;
  overflow-y: auto;
  padding: 10px;
}

.ballot-content::-webkit-scrollbar {
  width: 8px;
}

.ballot-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.ballot-content::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 10px;
}

/* Ensure all interactive elements can be clicked */
button, 
input, 
select, 
textarea,
a,
[role="button"],
.clickable,
.reset,
.btn,
.clist {
  position: relative;
  z-index: 25;
  pointer-events: auto !important;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .page-header {
    width: 90%;
  }
  
  .ballot-card {
    padding: 20px;
  }
  
  .btn-modern {
    padding: 8px 20px;
    margin: 5px;
  }
  
  #candidate_list li {
    flex-wrap: wrap;
  }
  
  .loading-content {
    padding: 40px 30px;
    min-width: 280px;
  }
}