body {
  margin: 0;
  padding: 0;
  font-family: 'Georgia', serif;
  background-color: #f5f5f5;
}

form {
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  background: #fff;
  border-top: 4px solid #0073aa;
}

h2 {
  text-align: center;
  font-size: 1.8em;
  margin-bottom: 20px;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

input[type='text'] {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.locked .custom-dropdown,
.locked #confirmVoteBtn {
  pointer-events: none;
  opacity: 0.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 5px;
}

button[type='submit'] {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 30px;
}

#confirmVoteBtn:disabled {
  background-color: #ccc; /* Muted gray */
  color: #666; /* Dimmed text */
  cursor: not-allowed; /* Prevents hover pointer */
  opacity: 0.6; /* Slight transparency */
  border: 1px solid #999; /* Subtle border */
  box-shadow: none; /* Removes any active glow */
  transition: none;
}

button[type='submit']:hover {
  background-color: #005a87;
}

#diagnosticPanel {
  font-size: 0.9em;
  background-color: #fefefe;
  border-left: 4px solid #0073aa;
  padding: 10px;
  margin-top: 10px;
}

#normalizedPreview {
  font-family: monospace;
  color: #0073aa;
}

.confirmation {
  text-align: center;
  font-size: 1.2em;
  color: green;
  margin-bottom: 20px;
}

.entry-block {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.entry-block img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}

.entry-block label {
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

.overlay {
  background: #fff3cd;
  color: #856404;
  padding: 8px 12px;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  font-size: 0.9em;
  margin-top: 10px;
}

.self-vote-block {
  color: #dc3545;
  font-weight: bold;
  padding: 6px 10px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-top: 5px;
}

.hidden {
  display: none;
}

.custom-dropdown {
  display: block;
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-top: 5px;
}

.dropdown-toggle {
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
}

.dropdown-options {
  position: absolute; /* ✅ Required for dropdown placement */
  top: 100%; /* ✅ Places it below the toggle */
  left: 0;
  width: 100%;
  background: #fff; /* ✅ Ensures it's visible */
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: opacity 0.2s ease-in-out;
}

.dropdown-options {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.custom-dropdown .dropdown-toggle {
  color: #333 !important;
}

.custom-dropdown.open .dropdown-options {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.dropdown-option {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background-color: #f0f0f0;
}

.dropdown-option.available {
  background-color: #d4edda;
  color: #155724;
  font-weight: bold;
}

.dropdown-option.selected {
  background-color: #cce5ff;
  font-weight: bold;
}

.custom-dropdown.disabled {
  opacity: 0.6;
  pointer-events: none;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #721c24;
  font-weight: bold;
  cursor: not-allowed;
}

.dropdown-options {
  transition: opacity 0.2s ease-in-out;
}

.dropdown-replacement {
  padding: 10px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  font-weight: bold;
  color: #721c24;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 999999; /* above everything */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #28a745;
  border-radius: 50%;
  width: 40px; /* equal width/height */
  height: 40px;
  animation: spin 1s linear infinite;
  margin: auto;
  box-sizing: border-box; /* ensures borders don’t distort */
}

select#voter_name {
  width: 100%;
  max-width: 400px;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: border-color 0.3s ease;
}

select#voter_name:focus {
  border-color: #0073aa;
  outline: none;
  background-color: #fff;
}

@media screen and (max-width: 600px) {
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: none;
  }

  .entry-block {
    display: block;
  }
}

.fullscreen-container {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: black;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-image {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  cursor: zoom-out;
  position: relative; /* key: positioning context */
}

.fullscreen-close {
  position: absolute; /* now relative to .fullscreen-image */
  top: 10px;
  right: 10px;
  /*  position: fixed;*/
  width: 50px;
  height: 50px;
  border-radius: 50%;
  /* black background: rgba(0,0,0,0.7);*/
  background: rgba(255, 0, 0, 0.8); /* red */
  color: white;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100000;
}

.image-wrapper {
  position: relative; /* needed so absolute button is positioned relative to wrapper */
  cursor: zoom-in;
}

.fullscreen-message {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: #fff;
  font-family: sans-serif;
  font-size: 16px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4); /* light transparent black */
  border-radius: 6px;
}

/* When image goes fullscreen */
.image-wrapper.fullscreen-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999; /* higher than header/menu */
  background: black;
}

.entry-image.fullscreen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-out;
}

.fullscreen-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

body.no-scroll {
  overflow: hidden;
}

.padlock-status {
  font-size: 3em;
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
  color: #dc3545; /* red for unlocked */
}

.padlock-status.locked {
  color: #28a745; /* green for locked */
  transform: rotate(-10deg);
}

.padlock-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4em;
  padding: 12px 20px;
  background-color: #ffc107; /* Yellow */
  color: #212529;
  border: 2px solid #ffc107;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

.padlock-button:hover {
  background-color: #e0a800;
  transform: scale(1.03);
}

.padlock-button.locked {
  background-color: #28a745; /* Green */
  border-color: #28a745;
  color: white;
}

.padlock-button.locked::before {
  content: '🔒';
}

.padlock-button::before {
  content: '🔓';
}

.padlock-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voting-reminder {
    background: #eef7ff;
    border-left: 4px solid #0073aa;
    padding: 10px 14px;
    margin: 15px 0 25px;
    font-size: 1.05em;
    border-radius: 4px;
    color: #003f5e;
}

.voting-reminder p {
    margin: 4px 0;      /* reduce paragraph spacing */
    line-height: 1.3;   /* tighter line spacing */
}

.voting-reminder ul {
    margin: 4px 0 4px 18px;  /* reduce top/bottom spacing */
    padding: 0;
}

.voting-reminder li {
    margin: 2px 0;      /* small gap between bullet items */
    line-height: 1.3;
}

.eut-bg-wrapper {
  pointer-events: none !important;
  position: static !important;
  height: auto !important;
  z-index: 0 !important;
}
