/* Ballot voting experience (search, sort, ranks, toasts, animations) */

.vote-ballot-hint {
  text-align: center;
  color: #6b4a55;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 40rem;
  margin: 0.5rem auto 0.25rem;
  padding: 0 1rem;
}

.public-hero .ballot-register-cta {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.public-hero .ballot-register-cta .button-set a.button-theme-main {
  background-color: var(--secondary-color) !important;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.public-hero .ballot-register-cta .button-set a.button-theme-main:hover {
  color: var(--secondary-color) !important;
}

.public-hero .ballot-register-cta + .hero-left-side {
  margin-top: 0.5rem;
}

.vote-stage {
  position: relative;
}

.vote-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 188, 201, 0.55);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(255, 120, 150, 0.08);
}

.vote-search {
  flex: 1 1 220px;
  position: relative;
}

.vote-search input {
  width: 100%;
  border: 1px solid #f0c9d4;
  border-radius: 999px;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vote-search input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 188, 201, 0.25);
}

.vote-search i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #c48a98;
  pointer-events: none;
}

.vote-sort {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.vote-sort-btn {
  border: 1px solid #f0c9d4;
  background: #fff;
  color: #5a3a44;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.vote-sort-btn.is-active,
.vote-sort-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #3a1f28;
}

.blog-posts.vote-experience-ballot {
  padding: 0.5rem 0 5rem !important;
}

/* Ballot cards: no theme fade/hover overlays — tap burst effects only */
.vote-experience-ballot .candidate-card,
.vote-experience-ballot .vote-card,
.vote-experience-ballot .vote-card .thumb {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transition: none !important;
}

.vote-experience-ballot .vote-card .thumb > img:not(.badge-icon):not(.float-coin) {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transition: none !important;
  height: auto !important;
}

.vote-experience-ballot .vote-card .thumb:before,
.vote-experience-ballot .vote-card .thumb:after {
  display: none !important;
  content: none !important;
}

.vote-experience-ballot .wow {
  visibility: visible !important;
  animation: none !important;
  opacity: 1 !important;
}

.candidate-card {
  padding-top: 0.75rem !important;
  padding-bottom: 1.1rem !important;
}

.candidate-card.is-hidden {
  display: none !important;
}

.vote-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(255, 188, 201, 0.45);
  box-shadow: 0 12px 30px rgba(80, 40, 55, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.vote-card .thumb {
  position: relative;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  background: #f7eef1;
}

.vote-burst-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}

.vote-count-wrap .vote-burst-layer {
  overflow: visible;
  z-index: 4;
}

.vote-card .thumb > img:not(.badge-icon):not(.float-coin) {
  width: 100%;
  height: auto !important;
  display: block;
}

.rank-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 5;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  background: rgba(40, 18, 28, 0.72);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.rank-badge.rank-1 {
  background: linear-gradient(135deg, #f6d365, #dda441);
  color: #3a2a08;
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #d7d7d7, #9e9e9e);
  color: #222;
}

.rank-badge.rank-3 {
  background: linear-gradient(135deg, #e0a57d, #b8734a);
  color: #fff;
}

.vote-card .badge-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 4;
  width: 12% !important;
  max-width: 58px;
  height: auto !important;
  min-width: 34px;
}

.vote-card .content {
  padding: 0.95rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.candidate-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2f1a22;
  line-height: 1.25;
  text-align: left;
}

.candidate-group-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #8a5a68;
  line-height: 1.3;
}

.vote-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: space-between;
}

.vote-count-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 4.5rem;
  overflow: visible;
}

.vote-count-wrap .icon {
  width: 22px;
  height: auto;
  transform-origin: center;
}

.vote-count-wrap .icon.is-icon-bump {
  animation: vote-icon-bump 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes vote-icon-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.vote-count {
  font-size: 1.05rem;
  font-weight: 800;
  color: #3a1f28;
  display: inline-block;
  transform-origin: center;
  min-width: 1.25rem;
}

.vote-experience-ballot .vote-count-wrap .vote-burst-layer .float-coin {
  width: 28px;
  height: 28px;
}

.vote-experience-ballot .vote-count-wrap .vote-burst-layer .float-coin.is-gold {
  width: 34px;
  height: 34px;
}

.vote-experience-ballot .vote-count-wrap .vote-burst-layer .plus-one {
  font-size: 1rem;
}

.vote-count.is-bump {
  animation: vote-count-bump 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes vote-count-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); color: #d46a86; }
  100% { transform: scale(1); }
}

.vote-btn {
  flex: 1;
  min-height: 2.7rem;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 8px 18px rgba(255, 120, 150, 0.18);
}

.vote-btn:active {
  transform: scale(0.97);
}

.vote-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.vote-btn-silver {
  background: linear-gradient(135deg, #f4f6f8, #d7dde3);
  color: #2f3a44;
}

.vote-btn-gold {
  background: linear-gradient(135deg, #ffe7a3, #f0c14b);
  color: #4a3508;
  box-shadow: 0 8px 18px rgba(240, 193, 75, 0.28);
}

.vote-btn:hover {
  filter: brightness(0.98);
}

.float-coin {
  position: absolute;
  width: 42px;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
  z-index: 20;
  left: var(--x, 50%);
  top: var(--y, 45%);
  margin-left: 0;
  margin-top: 0;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
  animation: vote-float-coin 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
  --dx: 0px;
  --dy: -110px;
  --rot: 12deg;
  --scale: 1;
}

.float-coin.is-gold {
  width: 52px;
  height: 52px;
  animation-duration: 1.15s;
}

@keyframes vote-float-coin {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.85) rotate(var(--rot));
  }
}

.vote-ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 188, 201, 0.9);
  pointer-events: none;
  z-index: 12;
  transform-origin: center center;
  animation: vote-ripple-out 0.55s ease-out forwards;
}

.vote-ripple.is-gold {
  border-color: rgba(240, 193, 75, 0.95);
}

@keyframes vote-ripple-out {
  0% { transform: scale(0.5); opacity: 0.85; }
  100% { transform: scale(3); opacity: 0; }
}

.vote-card .thumb .float-coin.is-thumb-tap {
  width: 30px;
  height: 30px;
  z-index: 8;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  animation: vote-float-coin-thumb 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  animation-delay: 0ms !important;
  --lift: -88px;
}

.vote-card .thumb .float-coin.is-thumb-tap.is-gold {
  width: 32px;
  height: 32px;
}

@keyframes vote-float-coin-thumb {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.65);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  72% {
    opacity: 0.9;
    transform: translate(-50%, calc(-50% - 48px)) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + var(--lift))) scale(0.82);
  }
}

.plus-one {
  position: absolute;
  z-index: 21;
  left: var(--x, 50%);
  top: var(--y, 40%);
  font-size: 1.35rem;
  font-weight: 800;
  color: #d46a86;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  animation: vote-plus-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.plus-one.is-gold {
  color: #c9a227;
}

@keyframes vote-plus-rise {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(0.95); }
}

.candidates-skeleton {
  display: none;
  gap: 1rem;
  margin-bottom: 1rem;
}

.candidates-skeleton.is-on {
  display: flex;
  flex-wrap: wrap;
}

.skel-card {
  flex: 1 1 280px;
  height: 380px;
  border-radius: 18px;
  background: linear-gradient(90deg, #f3e0e6 25%, #fceef2 40%, #f3e0e6 55%);
  background-size: 400% 100%;
  animation: vote-skel 1.15s ease infinite;
}

@keyframes vote-skel {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.vote-empty {
  display: none;
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 1.1rem;
  color: #8a5a68;
}

.vote-empty.is-on {
  display: block;
}

@media (max-width: 768px) {
  .vote-toolbar {
    top: 0.35rem;
  }

  .vote-btn {
    min-height: 3rem;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-coin,
  .plus-one,
  .vote-ripple,
  .vote-count.is-bump,
  .skel-card {
    animation: none !important;
    transition: none !important;
  }
}
