/* ============================================================
   Component: VoteOverlay — estilos
   ------------------------------------------------------------
   Overlay full-screen ativado por Alpine.store('vote').isActive.
   Identidade visual segue paywall-mock (mesmas dimensões de
   painel, mesmo close button) mas com paleta amarelo-sol pra
   diferenciar — é convite ("você decide!"), não barreira.

   Z-index 100: acima de tudo. Trap do scroll feito via JS
   (body.overflow:hidden em open()).
   ============================================================ */

.vote-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-4);

  background: color-mix(in srgb, var(--color-ink) 70%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.vote-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Botão fechar — canto superior direito */
.vote-overlay__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: color-mix(in srgb, var(--color-cream) 90%, transparent);
  color: var(--color-ink);

  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;

  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-ink) 25%, transparent);
}

.vote-overlay__close:hover,
.vote-overlay__close:focus-visible {
  transform: scale(1.05);
}

/* ============================================================
   Painel central
   ============================================================ */
.vote-overlay__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;

  padding: var(--space-6) var(--space-5);
  border-radius: 28px;

  background:
    linear-gradient(180deg, #fff6d8 0%, #ffe8a8 100%);

  box-shadow:
    0 24px 48px color-mix(in srgb, var(--color-ink) 35%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--color-sun) 50%, transparent);

  text-align: center;

  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 250ms ease;
}

.vote-overlay.is-active .vote-overlay__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Bolha topo: emoji 🗳️ grande pulsando */
.vote-overlay__bubble {
  width: 110px;
  height: 110px;
  margin: 0 auto var(--space-3);

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-cream);
  border-radius: 50%;

  box-shadow:
    inset 0 -4px 10px color-mix(in srgb, var(--color-sun) 60%, transparent),
    0 6px 14px color-mix(in srgb, var(--color-sun) 50%, transparent);
}

.vote-overlay__bubble-emoji {
  font-size: 4rem;
  line-height: 1;
  animation: vote-bubble-bob 2.4s ease-in-out infinite;
}

.vote-overlay__bubble-emoji img.emoji,
.vote-overlay__bubble-emoji img.fluent-emoji {
  width: 4rem;
  height: 4rem;
  vertical-align: middle;
}

@keyframes vote-bubble-bob {
  0%, 100% { transform: translateY(0)    rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}

.vote-overlay__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 700;
  color: var(--color-ink);
}

.vote-overlay__subtitle {
  margin: var(--space-2) 0 var(--space-5);
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  color: var(--color-ink-soft);
  line-height: 1.45;
}

/* ============================================================
   Lista de candidatos
   ============================================================ */
.vote-overlay__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.vote-overlay__candidate {
  display: flex;
  align-items: center;
  gap: var(--space-3);

  width: 100%;
  padding: var(--space-3);

  background: var(--color-cream);
  border: 3px solid transparent;
  border-radius: 18px;
  cursor: pointer;

  text-align: left;
  font-family: inherit;
  color: var(--color-ink);

  box-shadow: 0 3px 8px color-mix(in srgb, var(--color-ink) 12%, transparent);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.vote-overlay__candidate:hover,
.vote-overlay__candidate:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-sun) 70%, transparent);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--color-sun) 50%, transparent);
}

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

/* Estado "voto atual" — borda amarela cheia + badge */
.vote-overlay__candidate.is-current {
  border-color: var(--color-sun);
  background: color-mix(in srgb, var(--color-sun) 18%, var(--color-cream));
}

.vote-overlay__candidate-emoji {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.vote-overlay__candidate-emoji img.emoji,
.vote-overlay__candidate-emoji img.fluent-emoji {
  width: 2rem;
  height: 2rem;
}

.vote-overlay__candidate-info {
  flex: 1;
  min-width: 0;
}

.vote-overlay__candidate-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}

.vote-overlay__candidate-teaser {
  display: block;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  line-height: 1.3;
}

.vote-overlay__candidate-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--color-sun);
  color: var(--color-ink);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 10px;
}

.vote-overlay__hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  line-height: 1.4;
}

/* ============================================================
   Fase "thanks" — animação após registrar voto
   ============================================================ */
.vote-overlay__thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);

  padding: var(--space-3) 0;
}

.vote-overlay__thanks-check {
  font-size: 4.5rem;
  line-height: 1;
  animation: vote-thanks-pop 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vote-thanks-pop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0);      opacity: 1; }
}

.vote-overlay__thanks-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-ink);
}

.vote-overlay__thanks-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
  line-height: 1.45;
  max-width: 320px;
}

.vote-overlay__thanks-voted {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  background: color-mix(in srgb, var(--color-sun) 30%, var(--color-cream));
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ============================================================
   Botões secundários (trocar voto, fechar)
   ============================================================ */
.vote-overlay__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 10px 18px;

  background: transparent;
  color: var(--color-ink-soft);

  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;

  transition: background 140ms ease, color 140ms ease;
}

.vote-overlay__action:hover,
.vote-overlay__action:focus-visible {
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
  color: var(--color-ink);
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .vote-overlay__bubble-emoji,
  .vote-overlay__thanks-check {
    animation: none;
  }
}
