/* ==========================================================================
   FoodSkout - Live Community Pulse Animation Styles
   ========================================================================== */

.pulse-section {
  position: relative;
  padding: 2.5rem 0 3.5rem;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.pulse-card-wrapper {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  overflow: hidden;
}

#pulseCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Header Row */
.pulse-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.pulse-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.pulse-live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseRadar 2s infinite;
}

@keyframes pulseRadar {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.pulse-meta-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-alt);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pulse-stat-item {
  display: flex;
  flex-direction: column;
}

.pulse-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark-heading);
  line-height: 1.2;
}

.pulse-stat-lbl {
  font-size: 0.75rem;
  color: var(--muted-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Grid of options */
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

@media (max-width: 992px) {
  .pulse-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pulse-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .pulse-card-wrapper {
    padding: 1.25rem 0.85rem;
  }
  .pulse-option-card {
    padding: 0.75rem 0.65rem;
  }
  .pulse-opt-desc {
    display: none;
  }
  .pulse-opt-title {
    font-size: 0.88rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }
  .pulse-opt-pct {
    font-size: 1.15rem;
  }
  .pulse-opt-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
  }
  .pulse-vote-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
  .pulse-header {
    margin-bottom: 1rem;
    gap: 0.65rem;
  }
  .pulse-meta-stats {
    gap: 0.75rem;
    padding: 0.5rem 0.85rem;
  }
  .pulse-stat-val {
    font-size: 1.05rem;
  }
}

/* Interactive Option Card */
.pulse-option-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pulse-option-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06);
}

.pulse-option-card.card-sprung {
  animation: cardBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardBounce {
  0% { transform: scale(1); }
  35% { transform: scale(0.95); }
  65% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse-opt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pulse-opt-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

.pulse-opt-pct {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark-heading);
}

.pulse-opt-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-heading);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.pulse-opt-desc {
  font-size: 0.82rem;
  color: var(--muted-text);
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

/* Progress bar container */
.pulse-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.pulse-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* Vote Action Button */
.pulse-vote-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--body-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pulse-option-card:hover .pulse-vote-btn {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

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

/* Real-Time Live Activity Ticker Toast */
.pulse-toast-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--muted-text);
  position: relative;
  z-index: 2;
}

.pulse-ticker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pulse-ticker-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

.pulse-ticker-text {
  font-weight: 500;
  color: var(--body-text);
}

.pulse-hint {
  font-size: 0.82rem;
  color: var(--muted-text);
}
