/* =============================================================
   VOTE PAGE — Interactive animations & country grid
   ============================================================= */

/* ─── Page Layout ────────────────────────────────────────────── */
.vote-page {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

/* ─── Header / Hero ──────────────────────────────────────────── */
.vote-header {
  padding: 28px 0 0;
  text-align: center;
  position: relative;
}

.vote-header .logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.vote-header .logo-wrap img {
  height: auto;
  width: min(260px, 72vw);
  filter: drop-shadow(0 0 18px rgba(255,215,0,0.45));
  transition: filter 0.3s;
}
.vote-header .logo-wrap img:hover {
  filter: drop-shadow(0 0 30px rgba(255,215,0,0.75));
}

/* ─── Trophy Section ─────────────────────────────────────────── */
.trophy-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  /* Extra bottom margin to account for the tall portrait trophy */
  margin-bottom: 24px;
  animation: float 5s ease-in-out infinite;
}

.trophy-wrap picture {
  display: contents; /* transparent to layout — the img is the actual box */
}

.trophy-wrap img {
  width: min(180px, 36vw);
  height: auto;
  /* Transparent PNG — gold glow on the image content, not a box */
  filter: drop-shadow(0 0 30px rgba(255,215,0,0.7))
          drop-shadow(0 4px 16px rgba(0,0,0,0.5));
  transition: filter 0.4s;
}
.trophy-wrap img:hover {
  filter: drop-shadow(0 0 55px rgba(255,215,0,1))
          drop-shadow(0 8px 24px rgba(0,0,0,0.6));
}

/* Glowing base beneath the trophy (ellipse at bottom of the image) */
.trophy-ring {
  position: absolute;
  bottom: 8%;     /* sits at the base of the trophy */
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,215,0,0.35) 0%, transparent 75%);
  filter: blur(8px);
  animation: base-glow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes base-glow {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scaleX(1); }
  50%       { opacity: 0.35; transform: translateX(-50%) scaleX(1.2); }
}

/* ─── Hero Text ──────────────────────────────────────────────── */
.hero-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-bright) 50%, var(--gold) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite, fadeUp 0.7s ease 0.1s both;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 40px;
  animation: fadeUp 0.7s ease 0.2s both;
}

/* ─── Progress Steps Indicator ───────────────────────────────── */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  animation: fadeUp 0.7s ease 0.3s both;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  background: var(--black-3);
  transition: var(--transition);
  z-index: 1;
}

.step-item.active .step-circle {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(201,168,76,0.4);
  background: rgba(201,168,76,0.08);
}

.step-item.done .step-circle {
  border-color: var(--success);
  color: var(--success);
  background: rgba(46,213,115,0.1);
}

.step-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--gold); }

.step-connector {
  width: 60px;
  height: 2px;
  background: rgba(201,168,76,0.2);
  margin: 0 4px;
  margin-bottom: 24px;
  border-radius: 1px;
  transition: background 0.4s;
}

.step-connector.done { background: var(--gold-dark); }

/* ─── Vote Form Card ──────────────────────────────────────────── */
.vote-card {
  background: rgba(17,18,19,0.85);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 600px;
  margin: 0 auto 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.6s ease 0.3s both;
}

.vote-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.vote-card .card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .vote-card { padding: 24px 20px; }
}

/* WhatsApp input with dial code prefix */
.phone-input-wrap {
  display: flex;
  gap: 0;
  border: 1px solid rgba(37,211,102,0.2);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  background: var(--black-4);
}

.phone-input-wrap:focus-within {
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37,211,102,0.12);
}

.phone-input-wrap.error { border-color: var(--error); }

.dial-prefix {
  padding: 14px 14px;
  font-size: 0.9rem;
  color: var(--gold);
  background: rgba(37,211,102,0.07);
  border-right: 1px solid rgba(37,211,102,0.2);
  white-space: nowrap;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.phone-input-wrap .form-input {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 12px;
}
.phone-input-wrap .form-input:focus { box-shadow: none; background: transparent; }

/* ─── Country Picker Section ─────────────────────────────────── */
.country-section {
  padding: 0 0 60px;
  animation: fadeUp 0.6s ease 0.5s both;
}

.country-section-header {
  text-align: center;
  margin-bottom: 32px;
}

.country-section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.country-section-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Search bar */
.country-search-wrap {
  max-width: 400px;
  margin: 0 auto 28px;
  position: relative;
}

.country-search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dark);
  pointer-events: none;
}

.country-search {
  width: 100%;
  background: var(--black-3);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 50px;
  color: var(--white);
  padding: 12px 20px 12px 46px;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.country-search::placeholder { color: var(--text-dim); }
.country-search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

/* Confederation filter pills */
.conf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.conf-pill {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.conf-pill:hover,
.conf-pill.active {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Country grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

@media (max-width: 480px) {
  .country-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* Country card */
.country-card {
  background: var(--black-3);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 20px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Shimmer overlay */
.country-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,215,0,0.04) 50%, transparent 60%);
  background-size: 200% 200%;
  transition: background-position 0.6s;
  pointer-events: none;
}

.country-card:hover::before { background-position: right bottom; }

.country-card:hover {
  border-color: rgba(201,168,76,0.4);
  background: var(--black-4);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.15);
}

.country-card:active { transform: translateY(-1px) scale(0.97); }

.country-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.07);
  box-shadow: var(--shadow-gold), var(--shadow-card);
  transform: translateY(-4px);
  animation: select-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.country-card.hidden { display: none; }

@keyframes select-bounce {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-8px) scale(1.04); }
  70%  { transform: translateY(-2px) scale(0.98); }
  100% { transform: translateY(-4px) scale(1); }
}

/* Selected checkmark badge */
.country-card .selected-badge {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition);
}

.country-card.selected .selected-badge {
  opacity: 1;
  transform: scale(1);
  animation: badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badge-pop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

.selected-badge svg { width: 12px; height: 12px; color: var(--black); }

.country-flag {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
  transition: transform 0.25s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.country-card:hover .country-flag,
.country-card.selected .country-flag { transform: scale(1.15); }

.country-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--off-white);
  line-height: 1.3;
  display: block;
}

.country-conf {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 3px;
  display: block;
}

.country-card.selected .country-name { color: var(--gold-bright); }
.country-card.selected .country-conf { color: var(--gold-dark); }

/* No results message */
.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: none;
}
.no-results.visible { display: block; }

/* ─── Submit Section ──────────────────────────────────────────── */
.submit-section {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: linear-gradient(to top, var(--black) 60%, transparent);
  padding: 24px 0 32px;
  text-align: center;
}

.submit-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.selected-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: var(--gold);
  opacity: 0;
  transform: translateY(8px);
  transition: var(--transition);
  pointer-events: none;
}

.selected-preview.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.selected-preview .prev-flag { font-size: 1.3rem; }
.selected-preview .prev-name { font-weight: 600; }

.btn-submit-vote {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  background-size: 200% auto;
  color: var(--black);
  border: none;
  border-radius: 50px;
  padding: 18px 60px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 260px;
  box-shadow: 0 6px 30px rgba(201,168,76,0.45);
}

.btn-submit-vote:hover:not(:disabled) {
  background-position: right center;
  box-shadow: 0 12px 50px rgba(255,215,0,0.65);
  transform: translateY(-3px);
}

.btn-submit-vote:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-submit-vote.loading .btn-text { opacity: 0; }
.btn-submit-vote.loading::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 3px solid rgba(0,0,0,0.3);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Vote confirmation overlay ──────────────────────────────── */
.vote-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,1,1,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

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

.confirm-box {
  background: var(--black-3);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-gold), var(--shadow-lift);
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vote-confirm-overlay.active .confirm-box {
  transform: scale(1);
}

.confirm-box .confirm-flag { font-size: 4.5rem; margin-bottom: 16px; display: block; }
.confirm-box h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.confirm-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

.confirm-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* ─── Already voted message ──────────────────────────────────── */
.already-voted-banner {
  max-width: 600px;
  margin: 0 auto 40px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  text-align: center;
}

.already-voted-banner .big-flag { font-size: 3.5rem; margin-bottom: 10px; }
.already-voted-banner h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.already-voted-banner p { color: var(--text-muted); font-size: 0.9rem; }
