/* Duplet Font */
@font-face {
  font-family: "Duplet";
  src: url("/fonts/Duplet/Duplet-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Duplet";
  src: url("/fonts/Duplet/Duplet-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Duplet";
  src: url("/fonts/Duplet/Duplet-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: "Duplet";
  src: url("/fonts/Duplet/Duplet-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
}

/* Base overrides for vote page */
body {
  font-family: "Duplet", system-ui, sans-serif;
  margin: 0;
  background: #f5f5f5;
  color: #1a1a1a;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Hero */
.vote-hero {
  padding: 3rem 0 1.5rem;
}

.vote-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
  color: #A953F6;
}

.vote-hero h1 a {
  color: inherit;
  text-decoration: none;
}

.vote-hero-sub {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}

/* Card */
.vote-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Question title */
.vote-question {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
}

/* Subheaders */
.vote-subheader {
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 0.5rem;
}

/* Floating label input */
.vote-input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.vote-input-wrapper {
  position: relative;
}

.vote-input {
  width: 100%;
  padding: 1rem 0.875rem;
  border: 2px solid #A953F6;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
  color: #1a1a1a;
}

.vote-input:focus {
  border-color: #8a3dd4;
}

.vote-input::placeholder {
  color: #999;
  font-weight: 400;
}

/* Ranking header */
.vote-ranking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.vote-ranking-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Ranking list */
.vote-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Individual option row */
.vote-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0;
  background: #ebebeb;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vote-option:hover {
  background: #e2e2e2;
}

.vote-option--selected {
  background: #f0e6fc;
  box-shadow: inset 0 0 0 2px #A953F6;
}

.vote-option--selected .vote-option-text {
  font-weight: 700;
}

/* Custom radio */
.vote-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  outline: none;
  transition: border-color 0.15s;
}

.vote-option input[type="radio"]:checked {
  border-color: #A953F6;
  background: #A953F6;
}

.vote-option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

/* Option text */
.vote-option-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #444;
}

.vote-option--selected .vote-option-text {
  color: #1a1a1a;
}

/* Vote count */
.vote-option-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: #999;
  white-space: nowrap;
  min-width: 2rem;
  text-align: right;
}

.vote-option--selected .vote-option-count {
  color: #666;
}

/* Submit button (hidden, form submits via JS on desktop) */
.vote-submit-btn {
  display: none;
}

/* Mobile submit button — full-width below the input, touch-friendly */
.vote-submit-mobile {
  display: none;
}

@media (max-width: 600px) {
  button.vote-submit-mobile {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.875rem;
    background: #A953F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
  }

  button.vote-submit-mobile:hover {
    background: #8a3dd4;
  }

  button.vote-submit-mobile:active {
    background: #7a2ec4;
  }
}

/* Similarity modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  transition: background 0.2s ease;
}

.modal-overlay--visible {
  background: rgba(0, 0, 0, 0.4);
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-overlay--visible .modal-card {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #1a1a1a;
}

.modal-subheader {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  margin: 0 0 1rem;
}

.modal-existing {
  background: #f3f3f3;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1.25rem;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
}

.modal-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-btn--vote {
  background: #A953F6;
  color: #fff;
}

.modal-btn--vote:hover {
  background: #9340e0;
}

.modal-btn--new {
  background: #ebebeb;
  color: #444;
}

.modal-btn--new:hover {
  background: #ddd;
}

/* Pagination */
.vote-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
}

.page-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 6px;
  background: #ebebeb;
  color: #444;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.page-btn:hover:not(:disabled) {
  background: #ddd;
}

.page-btn--active {
  background: #A953F6;
  color: #fff;
}

.page-btn--active:hover {
  background: #9340e0;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-prev,
.page-next {
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  text-align: center;
}
