/* Election Ballot Ticker Styles */

:root {
  --ballot-bg: #f8f9fa;
  --ballot-dark-bg: #1a202c;
  --ballot-border: #e2e8f0;
  --ballot-accent: #2c5282;
}

.election-ballot-ticker {
  background: antiquewhite;
  border-bottom: 2px solid var(--ballot-border);
  height: 60px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: sticky;
  top: 70px;
  /* Fixed: Matching navbar height (70px) to remove the gap */
  z-index: 999;
  font-family: "Khand", sans-serif;
}

body.dark .election-ballot-ticker {
  background: var(--ballot-dark-bg);
  border-color: #2d3748;
  color: #fff;
}

.ballot-label {
  background: var(--ballot-accent);
  color: white;
  font-weight: 700;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  z-index: 20;
  font-size: 22px;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.ballot-marquee-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.ballot-marquee-content {
  display: flex;
  white-space: nowrap;
  height: 100%;
  align-items: center;
  width: max-content;
  /* Seamless loop animation */
  animation: marquee-scroll-rtl 40s linear infinite;
}

.marquee-set {
  display: flex;
  align-items: center;
}

.ballot-marquee-content:hover {
  animation-play-state: paused;
}

.ballot-party-item {
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 15px;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark .ballot-party-item {
  border-right-color: rgba(255, 255, 255, 0.1);
}

.party-logo {
  width: 45px;
  height: 45px;
  object-fit: cover;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  /* Made circular as requested */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.party-info {
  display: flex;
  flex-direction: column;
}

.party-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.vote-stats {
  display: flex;
  gap: 10px;
  font-size: 16px;
  color: #4a5568;
}

body.dark .vote-stats {
  color: #a0aec0;
}

.vote-count {
  color: #c53030;
  font-weight: 700;
}

.position-badge {
  color: #2b6cb0;
  font-weight: 600;
}

.won-badge {
  background: #c6f6d5;
  color: #22543d;
  font-size: 14px;
  padding: 0 8px;
  border-radius: 4px;
  font-weight: 700;
}

.lead-badge {
  background: #feebc8;
  color: #744210;
  font-size: 14px;
  padding: 0 8px;
  border-radius: 4px;
  font-weight: 700;
}

/* 4-Set Seamless Loop Animation */
@keyframes marquee-scroll-rtl {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-25%);
  }
}

.vote-count.count-updated {
  animation: vote-update-pulse 1s ease;
  text-shadow: 0 0 10px rgba(197, 48, 48, 0.5);
}

@keyframes vote-update-pulse {
  0% {
    transform: scale(1);
    color: #c53030;
  }

  50% {
    transform: scale(1.2);
    color: #e53e3e;
  }

  100% {
    transform: scale(1);
    color: #c53030;
  }
}

@media (max-width: 768px) {
  .election-ballot-ticker {
    height: 55px;
    top: 60px;
    /* Adjust for mobile navbar height if different */
  }

  .ballot-label {
    font-size: 18px;
    padding: 0 12px;
  }

  .party-name {
    font-size: 16px;
  }

  .vote-stats {
    font-size: 14px;
  }

  .party-logo {
    width: 35px;
    height: 35px;
  }
}
