/* Election formal theme — light default, dark via [data-theme="dark"] */

:root,
[data-theme="light"] {
  --el-bg: #f4f6f8;
  --el-bg-elevated: #ffffff;
  --el-bg-muted: #e8eef2;
  --el-surface: #ffffff;
  --el-surface-2: #f0f4f7;
  --el-border: #cfd8df;
  --el-border-strong: #9aadb8;
  --el-text: #1a2332;
  --el-text-muted: #5a6a7a;
  --el-accent: #0d7a6f;
  --el-accent-hover: #0a5f56;
  --el-accent-soft: rgba(13, 122, 111, 0.12);
  --el-danger: #b42318;
  --el-danger-soft: rgba(180, 35, 24, 0.12);
  --el-warning: #b54708;
  --el-warning-soft: rgba(181, 71, 8, 0.12);
  --el-success: #067647;
  --el-success-soft: rgba(6, 118, 71, 0.12);
  --el-info: #175cd3;
  --el-info-soft: rgba(23, 92, 211, 0.12);
  --el-shadow: 0 1px 2px rgba(26, 35, 50, 0.06), 0 8px 24px rgba(26, 35, 50, 0.06);
  --el-radius: 10px;
  --el-nav-bg: rgba(255, 255, 255, 0.92);
  --el-progress-track: #d9e2e8;
  --el-progress-fill: #0d7a6f;
  --el-timeline-line: #c5d0d8;
  --el-focus: 0 0 0 3px rgba(13, 122, 111, 0.28);
  color-scheme: light;
}

[data-theme="dark"] {
  --el-bg: #0f1419;
  --el-bg-elevated: #171e26;
  --el-bg-muted: #1c2530;
  --el-surface: #1a222c;
  --el-surface-2: #222c38;
  --el-border: #2e3a48;
  --el-border-strong: #4a5d70;
  --el-text: #e8eef4;
  --el-text-muted: #9aabba;
  --el-accent: #2bb5a5;
  --el-accent-hover: #3ec9b8;
  --el-accent-soft: rgba(43, 181, 165, 0.16);
  --el-danger: #f97066;
  --el-danger-soft: rgba(249, 112, 102, 0.16);
  --el-warning: #fdb022;
  --el-warning-soft: rgba(253, 176, 34, 0.16);
  --el-success: #47cd89;
  --el-success-soft: rgba(71, 205, 137, 0.16);
  --el-info: #84caff;
  --el-info-soft: rgba(132, 202, 255, 0.16);
  --el-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  --el-nav-bg: rgba(15, 20, 25, 0.92);
  --el-progress-track: #2a3542;
  --el-progress-fill: #2bb5a5;
  --el-timeline-line: #344354;
  --el-focus: 0 0 0 3px rgba(43, 181, 165, 0.35);
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body.election-body,
.election-shell {
  background:
    radial-gradient(1200px 500px at 100% -10%, var(--el-accent-soft), transparent 55%),
    radial-gradient(900px 400px at 0% 100%, var(--el-info-soft), transparent 50%),
    var(--el-bg);
  color: var(--el-text);
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

.election-shell .container {
  max-width: 1100px;
}

/* Navbar */
.election-nav {
  position: relative;
  z-index: 1050;
  background: var(--el-nav-bg) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--el-border);
  box-shadow: none !important;
  margin-bottom: 1.5rem;
  border-radius: 0 0 var(--el-radius) var(--el-radius);
  padding: 0.35rem 0.5rem;
}

.election-nav .navbar-brand,
.election-nav .nav-link,
.election-nav .dropdown-toggle {
  color: var(--el-text) !important;
  font-weight: 600;
}

.election-nav .nav-link:hover,
.election-nav .nav-link:focus {
  color: var(--el-accent) !important;
}

.election-nav .dropdown-menu {
  position: absolute;
  z-index: 1060;
  background: var(--el-surface);
  border: 1px solid var(--el-border);
  box-shadow: var(--el-shadow);
}

.election-nav .dropdown-item {
  color: var(--el-text);
}

.election-nav .dropdown-item:hover {
  background: var(--el-accent-soft);
  color: var(--el-accent);
}

.election-nav .navbar-toggler {
  border-color: var(--el-border);
  color: var(--el-text);
  padding: 0.35rem 0.5rem;
}

.election-nav .navbar-toggler:focus {
  box-shadow: var(--el-focus);
}

.election-nav .navbar-toggler-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  background-image: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--el-border);
  background: var(--el-surface-2);
  color: var(--el-text);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--el-accent);
  background: var(--el-accent-soft);
  color: var(--el-accent);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--el-focus);
}

.theme-toggle .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: inline; }

/* Page header */
.election-page-header {
  margin-bottom: 1.75rem;
  animation: el-fade-up 0.45s ease both;
}

.election-page-header h1,
.election-page-header .election-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--el-text);
}

.election-page-header p,
.election-page-header .election-subtitle {
  margin: 0;
  color: var(--el-text-muted);
  font-size: 0.95rem;
}

/* Panels / stages */
.election-flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 3rem;
  position: relative;
}

.election-flow::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  right: 1.15rem;
  width: 2px;
  background: linear-gradient(180deg, var(--el-accent), var(--el-timeline-line) 30%, transparent);
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 576px) {
  .election-flow::before {
    display: none;
  }
}

.election-panel {
  background: var(--el-surface);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  box-shadow: var(--el-shadow);
  overflow: hidden;
  margin-right: 2.75rem;
  animation: el-fade-up 0.5s ease both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

@media (max-width: 576px) {
  .election-panel {
    margin-right: 0;
  }
}

.election-panel:hover {
  border-color: var(--el-border-strong);
}

.election-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--el-border);
  background: var(--el-surface-2);
}

.election-panel-header h2,
.election-panel-header h3,
.election-panel-header .election-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--el-text);
}

.election-panel-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.election-panel-footer {
  padding: 0.85rem 1.25rem 1.15rem;
  border-top: 1px solid var(--el-border);
  background: var(--el-bg-muted);
}

.election-stage-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  margin: 0.25rem 2.75rem 0.15rem 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--el-accent-soft);
  color: var(--el-accent);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
  animation: el-fade-up 0.4s ease both;
}

@media (max-width: 576px) {
  .election-stage-label {
    margin-right: 0;
  }
}

.election-stage-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--el-accent);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: var(--el-shadow);
  flex-shrink: 0;
}

/* Meta chips */
.election-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.election-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--el-bg-muted);
  border: 1px solid var(--el-border);
  color: var(--el-text);
  font-size: 0.82rem;
  font-weight: 600;
}

.election-chip small,
.election-chip .label {
  color: var(--el-text-muted);
  font-weight: 500;
}

.election-chip--accent {
  background: var(--el-accent-soft);
  border-color: transparent;
  color: var(--el-accent);
}

.election-chip--danger {
  background: var(--el-danger-soft);
  color: var(--el-danger);
  border-color: transparent;
}

.election-chip--warning {
  background: var(--el-warning-soft);
  color: var(--el-warning);
  border-color: transparent;
}

/* Alerts inside election UI */
.election-shell .alert,
.election-panel .alert,
.election-form-shell .alert {
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 500;
}

.election-shell .alert-success,
.election-panel .alert-success {
  background: var(--el-success-soft);
  color: var(--el-success);
}

.election-shell .alert-danger,
.election-shell .alert-error,
.election-panel .alert-danger,
.election-panel .alert-error {
  background: var(--el-danger-soft);
  color: var(--el-danger);
}

.election-shell .alert-warning,
.election-panel .alert-warning {
  background: var(--el-warning-soft);
  color: var(--el-warning);
}

.election-shell .alert-info,
.election-shell .alert-primary,
.election-panel .alert-info,
.election-panel .alert-primary {
  background: var(--el-info-soft);
  color: var(--el-info);
}

/* Progress */
.election-progress {
  height: 0.65rem;
  background: var(--el-progress-track);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.election-progress > .progress-bar,
.election-progress-bar {
  height: 100%;
  background: var(--el-progress-fill);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.election-shell .progress {
  background: var(--el-progress-track);
  border-radius: 999px;
  height: 0.65rem;
}

.election-shell .progress-bar {
  background: var(--el-progress-fill);
}

/* Buttons */
.election-shell .btn-success,
.election-actions .btn-success,
.election-form-shell .btn-success {
  background: var(--el-accent) !important;
  border-color: var(--el-accent) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
}

.election-shell .btn-success:hover,
.election-actions .btn-success:hover {
  background: var(--el-accent-hover) !important;
  border-color: var(--el-accent-hover) !important;
}

.election-shell .btn-primary,
.election-form-shell .btn-primary,
.election-report-shell .btn-primary {
  background: var(--el-accent) !important;
  border-color: var(--el-accent) !important;
  color: rgb(225, 234, 233) !important;
  font-weight: 600;
  border-radius: 8px;
}

.election-shell .btn-warning {
  font-weight: 600;
  border-radius: 8px;
}

.election-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.election-actions .btn {
  border-radius: 8px;
  font-weight: 600;
}

.candidate-profile-link {
  border: 1px solid var(--el-border);
  background: var(--el-surface);
  color: var(--el-text) !important;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.candidate-profile-link:hover {
  border-color: var(--el-accent);
  color: var(--el-accent) !important;
  background: var(--el-accent-soft);
}

.election-profile-modal {
  background: var(--el-surface);
  color: var(--el-text);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
}

.election-profile-modal .modal-header,
.election-profile-modal .modal-footer {
  border-color: var(--el-border);
}

.election-profile-modal .modal-title {
  color: var(--el-text);
  font-weight: 700;
}

.election-profile-modal .btn-close {
  filter: invert(0.35);
}

[data-theme="dark"] .election-profile-modal .btn-close {
  filter: invert(0.85);
}

/* Candidate cards */
.election-candidate {
  background: var(--el-surface-2);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.election-candidate:hover {
  transform: translateY(-2px);
  border-color: var(--el-accent);
  box-shadow: var(--el-shadow);
}

.election-candidate .card-body,
.election-candidate-body {
  padding: 1rem;
  flex: 1;
  color: var(--el-text);
}

.election-candidate .card-footer,
.election-candidate-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--el-border);
  background: var(--el-bg-muted);
}

.election-candidate img,
.election-candidate .img-circle {
  border-radius: 50%;
  border: 2px solid var(--el-border);
  max-width: 88px;
  object-fit: cover;
}

.election-profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--el-border);
  object-fit: cover;
  box-shadow: var(--el-shadow);
}

.profile-summary {
  max-width: 640px;
  margin: 0 auto;
}

.profile-summary .election-profile-photo {
  width: 160px;
  height: 160px;
}

.profile-summary-about {
  border-top: 1px solid var(--el-border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

.profile-summary-about-body {
  color: var(--el-text);
  line-height: 1.7;
}

.election-form-shell .note-editor.note-frame {
  border-color: var(--el-border);
  border-radius: var(--el-radius);
  background: var(--el-bg-elevated);
}

/* Summernote/Bootstrap dialogs must sit above election-nav (z-index: 1050)
   and above the page stacking contexts when dialogsInBody is enabled. */
body > .modal-backdrop {
  z-index: 2000 !important;
}

body > .modal,
body > .note-modal {
  z-index: 2010 !important;
}

body > .modal .modal-dialog,
body > .note-modal .modal-dialog {
  position: relative;
  z-index: 2011;
}

.election-form-shell .note-toolbar {
  background: var(--el-surface-2);
  border-bottom-color: var(--el-border);
}

.election-form-shell .note-editable {
  background: var(--el-bg-elevated);
  color: var(--el-text);
}

.election-candidate h2,
.election-candidate .lead {
  color: var(--el-text);
  font-size: 1.05rem;
}

.election-candidate .text-muted {
  color: var(--el-text-muted) !important;
}

/* List cards (election list / timeline) */
.election-card {
  display: block;
  background: var(--el-surface);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  box-shadow: var(--el-shadow);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: el-fade-up 0.45s ease both;
}

.election-card:hover {
  transform: translateY(-2px);
  border-color: var(--el-accent);
  color: inherit;
  text-decoration: none;
}

.election-card h5,
.election-card h3 {
  margin: 0 0 0.65rem;
  color: var(--el-text);
  font-weight: 700;
}

.election-card a {
  color: var(--el-accent);
  font-weight: 700;
  text-decoration: none;
}

.election-card a:hover {
  color: var(--el-accent-hover);
}

.election-empty {
  background: var(--el-danger-soft);
  color: var(--el-danger);
  border-radius: var(--el-radius);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

/* Forms */
.election-form-shell .card,
.election-form-shell .card-primary {
  background: var(--el-surface) !important;
  border: 1px solid var(--el-border) !important;
  border-radius: var(--el-radius) !important;
  box-shadow: var(--el-shadow);
  color: var(--el-text);
}

.election-form-shell .card-header,
.election-form-shell .card-primary .card-header {
  background: var(--el-surface-2) !important;
  border-bottom: 1px solid var(--el-border) !important;
  color: var(--el-text) !important;
  border-radius: var(--el-radius) var(--el-radius) 0 0 !important;
}

.election-form-shell .card-title,
.election-form-shell .card-header h3 {
  color: var(--el-text) !important;
  font-weight: 700;
}

.election-form-shell .card-body,
.election-form-shell label,
.election-form-shell .form-group {
  color: var(--el-text);
}

.election-form-shell .form-control,
.election-form-shell .input-group-text,
.election-form-shell select,
.election-form-shell textarea {
  background: var(--el-bg-elevated);
  border-color: var(--el-border);
  color: var(--el-text);
}

.election-form-shell .form-control:focus {
  border-color: var(--el-accent);
  box-shadow: var(--el-focus);
  background: var(--el-bg-elevated);
  color: var(--el-text);
}

/* Override AdminLTE light cards inside election detail */
.election-shell .timeline-item,
.election-shell .card.bg-light,
.election-panel .card.bg-light {
  background: var(--el-surface-2) !important;
  color: var(--el-text) !important;
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  box-shadow: none;
}

.election-shell .timeline-header,
.election-shell .timeline-body,
.election-shell .timeline-footer,
.election-shell .time {
  color: var(--el-text) !important;
  background: transparent !important;
}

.election-shell .time {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

.election-waiting {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  background:
    linear-gradient(160deg, rgba(13, 122, 111, 0.08), transparent 42%),
    linear-gradient(320deg, rgba(23, 92, 211, 0.07), transparent 40%),
    var(--el-surface);
  border: 1px solid var(--el-border);
  border-radius: calc(var(--el-radius) + 6px);
  box-shadow: var(--el-shadow);
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.1rem, 3vw, 2rem);
  margin: 0.5rem 0 1.5rem;
  animation: el-fade-up 0.45s ease both;
}

.election-waiting-glow {
  position: absolute;
  inset: auto;
  width: 280px;
  height: 280px;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 122, 111, 0.22), transparent 68%);
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
}

.election-waiting-rings {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.election-waiting-rings span {
  position: absolute;
  left: 50%;
  top: 7.5rem;
  width: 9rem;
  height: 9rem;
  border: 1px solid rgba(13, 122, 111, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: el-waiting-ring 4.8s ease-out infinite;
}

.election-waiting-rings span:nth-child(2) {
  animation-delay: 1.2s;
}

.election-waiting-rings span:nth-child(3) {
  animation-delay: 2.4s;
}

.election-waiting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--el-accent-soft);
  color: var(--el-accent);
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.election-waiting-icon {
  position: relative;
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--el-accent), #12998b);
  color: #ccfffa;
  font-size: 2rem;
  box-shadow: 0 12px 28px rgba(13, 122, 111, 0.28);
  animation: el-waiting-pulse 2.8s ease-in-out infinite;
}

.election-waiting-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(13, 122, 111, 0.22);
}

.election-waiting-title {
  margin: 0.15rem 0 0;
  max-width: 28ch;
  color: var(--el-text);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 800;
  line-height: 1.4;
}

.election-waiting-message {
  margin: 0;
  max-width: 38rem;
  color: var(--el-text-muted);
  font-size: clamp(1.05rem, 1.9vw, 1.28rem);
  font-weight: 600;
  line-height: 1.75;
}

.election-waiting-timer-shell {
  width: min(100%, 34rem);
  margin-top: 0.35rem;
  padding: 1rem 1.15rem 1.2rem;
  border-radius: calc(var(--el-radius) + 4px);
  background: var(--el-surface-2);
  border: 1px solid var(--el-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.election-waiting-timer-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  color: var(--el-text-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.election-shell .election-waiting-timer.time {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  min-height: 3.2rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 122, 111, 0.14), rgba(13, 122, 111, 0.05));
  color: var(--el-accent) !important;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem) !important;
  font-weight: 800 !important;
  line-height: 1.35;
  letter-spacing: 0.01em;
  direction: ltr;
}

.election-waiting-timer strong {
  font-weight: 800;
  padding: 0.1rem 0.25rem;
}

.election-waiting-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  width: min(100%, 42rem);
  margin-top: 0.55rem;
}

.election-waiting-fact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: start;
  padding: 0.85rem 0.95rem;
  border-radius: var(--el-radius);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--el-border);
  backdrop-filter: blur(6px);
}

[data-theme="dark"] .election-waiting-fact {
  background: rgba(26, 34, 44, 0.72);
}

.election-waiting-fact-icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--el-accent-soft);
  color: var(--el-accent);
  font-size: 0.95rem;
}

.election-waiting-fact small {
  display: block;
  color: var(--el-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.election-waiting-fact strong {
  display: block;
  color: var(--el-text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

@keyframes el-waiting-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 28px rgba(13, 122, 111, 0.28);
  }
  50% {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 34px rgba(13, 122, 111, 0.34);
  }
}

@keyframes el-waiting-ring {
  0% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.72);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.1);
  }
}

@media (max-width: 576px) {
  .election-waiting-facts {
    grid-template-columns: 1fr;
  }

  .election-waiting-rings span {
    top: 8.5rem;
  }
}

.election-shell .info-box {
  background: var(--el-surface-2) !important;
  color: var(--el-text) !important;
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  box-shadow: none;
  min-height: 90px;
  height: stretch;
}

.election-shell .info-box-content,
.election-shell .info-box-text,
.election-shell .info-box-number,
.election-shell .progress-description {
  color: var(--el-text) !important;
}

.election-shell .info-box.bg-info,
.election-shell .info-box.bg-red,
.election-shell .info-box.bg-blue,
.election-shell .info-box.bg-green,
.election-shell .info-box.bg-primary {
  background: var(--el-surface-2) !important;
}

.election-shell .info-box-icon {
  background: var(--el-accent-soft) !important;
  color: var(--el-accent) !important;
  border-radius: var(--el-radius) 0 0 var(--el-radius);
}

.election-shell .profile-user-img{
  width: 60px !important;
  min-width: 60px !important;
}

.election-shell .info-box-content{
  overflow: hidden;
}


.election-shell .badge.bg-primary,
.election-shell .badge.bg-info {
  background: var(--el-accent) !important;
}

.election-shell .badge.bg-pink,
.election-shell .badge.bg-danger {
  background: var(--el-danger) !important;
}

.election-shell hr {
  border-color: var(--el-border);
  opacity: 1;
}

.election-shell .custom-control-label,
.election-shell .form-check-label,
.election-shell label {
  color: var(--el-text);
}

.election-shell .list-item,
.election-shell .list-item-group {
  color: var(--el-text);
}

/* Reports */
.election-report-shell .card,
.election-report-shell .card-primary {
  background: var(--el-surface) !important;
  border: 1px solid var(--el-border) !important;
  color: var(--el-text);
  border-radius: var(--el-radius);
  box-shadow: var(--el-shadow);
}

.election-report-shell .card-header {
  background: var(--el-surface-2) !important;
  border-bottom: 1px solid var(--el-border) !important;
  color: var(--el-text) !important;
}

.election-report-shell .card-title,
.election-report-shell h3,
.election-report-shell h4,
.election-report-shell p,
.election-report-shell li {
  color: var(--el-text);
}

.election-report-shell .table {
  color: var(--el-text);
}

.election-report-shell .table thead td,
.election-report-shell .table th {
  background: var(--el-bg-muted);
  border-color: var(--el-border);
  font-weight: 700;
}

.election-report-shell .table td {
  border-color: var(--el-border);
  vertical-align: middle;
}

.election-report-shell a {
  color: var(--el-accent);
  font-weight: 600;
}

/* AdminLTE content area when hosting election forms/reports */
.content-wrapper:has(.election-form-shell),
.content-wrapper:has(.election-report-shell) {
  background: var(--el-bg) !important;
}

.content-wrapper:has(.election-form-shell) .content,
.content-wrapper:has(.election-report-shell) .content {
  color: var(--el-text);
}

/* Poll block */
.election-poll {
  padding: 1rem 0;
  border-bottom: 1px dashed var(--el-border);
}

.election-poll:last-child {
  border-bottom: 0;
}

.election-poll h5 {
  color: var(--el-text);
  font-weight: 700;
}

.election-choice {
  background: var(--el-bg-muted);
  border: 1px solid var(--el-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  width: 100%;
}

.election-choice:hover {
  border-color: var(--el-accent);
  background: var(--el-accent-soft);
}

/* iCheck is LTR-oriented; flip marker/text spacing for RTL */
[dir="rtl"] .election-choice[class*="icheck-"] {
  position: relative;
}

[dir="rtl"] .election-choice[class*="icheck-"] > label {
  padding-left: 0 !important;
  padding-right: 29px !important;
  display: inline-block;
  width: 100%;
  text-align: right;
}

[dir="rtl"] .election-choice[class*="icheck-"] > input:first-child + label::before,
[dir="rtl"] .election-choice[class*="icheck-"] > input:first-child + input[type="hidden"] + label::before {
  margin-left: 0 !important;
  left: auto !important;
  right: 0 !important;
}

[dir="rtl"] .election-choice[class*="icheck-"] > input:first-child:checked + label::after,
[dir="rtl"] .election-choice[class*="icheck-"] > input:first-child:checked + input[type="hidden"] + label::after {
  left: auto !important;
  right: 15px !important;
  margin-left: 0 !important;
}

/* Candidate vote checkboxes in RTL */
[dir="rtl"] .election-candidate [class*="icheck-"] > label {
  padding-left: 0 !important;
  padding-right: 29px !important;
}

[dir="rtl"] .election-candidate [class*="icheck-"] > input:first-child + label::before {
  margin-left: 0 !important;
  left: auto !important;
  right: 0 !important;
}

[dir="rtl"] .election-candidate [class*="icheck-"] > input:first-child:checked + label::after {
  left: auto !important;
  right: 15px !important;
}

[dir="rtl"] .form-check-label{
  padding-left: 0 !important;
  padding-right: 1.5rem !important;
}

/* Motion */
@keyframes el-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print: force light */
@media print {
  :root,
  html,
  body,
  [data-theme="dark"] {
    --el-bg: #ffffff !important;
    --el-surface: #ffffff !important;
    --el-text: #000000 !important;
    --el-text-muted: #333333 !important;
    --el-border: #000000 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .theme-toggle,
  .election-nav,
  .election-flow::before {
    display: none !important;
  }

  .election-panel,
  .election-card {
    box-shadow: none !important;
    border: 1px solid #000 !important;
    margin-right: 0 !important;
    break-inside: avoid;
  }
}
