/* Custom styles supplementing Tailwind CDN */

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #1e3a5f 100%);
}

/* Letter preview styling */
.letter-preview {
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* Counter animation */
.counter-value {
  transition: transform 0.3s ease;
}

.counter-value.bump {
  transform: scale(1.2);
}

/* Riding dropdown */
.riding-dropdown {
  max-height: 200px;
  overflow-y: auto;
}

.riding-option:hover {
  background-color: #e5e7eb;
}

.riding-option.selected {
  background-color: #dbeafe;
}

/* Postal code input uppercase */
.postal-input {
  text-transform: uppercase;
}

/* Pulse animation for live counter */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse-dot {
  animation: pulse-subtle 2s ease-in-out infinite;
}

/* Party colors */
.party-liberal { border-left-color: #d71920; }
.party-conservative { border-left-color: #1a4782; }
.party-ndp { border-left-color: #f58220; }
.party-bloc { border-left-color: #33b2cc; }
.party-green { border-left-color: #3d9b35; }
.party-independent { border-left-color: #888888; }

/* Leaderboard bar chart */
.leaderboard-bar {
  transition: width 0.5s ease;
  min-width: 2px;
}

/* Loading spinner */
.spinner {
  border: 3px solid #e5e7eb;
  border-top: 3px solid #2d5a87;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast notification */
.toast {
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Step indicator */
.step-indicator {
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background-color: #e5e7eb;
  color: #9ca3af;
  transition: background-color 0.3s, color 0.3s;
}

.step-label {
  margin-top: 6px;
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s, font-weight 0.3s;
}

.step-item.active .step-circle {
  background-color: #2563eb;
  color: #fff;
}

.step-item.active .step-label {
  color: #1e3a5f;
  font-weight: 700;
}

.step-item.completed .step-circle {
  background-color: #16a34a;
  color: #fff;
  cursor: pointer;
}

.step-item.completed .step-circle:hover {
  background-color: #15803d;
}

.step-item.completed .step-label {
  color: #15803d;
  font-weight: 600;
}

.step-connector {
  flex: 1;
  height: 3px;
  background-color: #e5e7eb;
  min-width: 40px;
  max-width: 120px;
  margin: 0 8px;
  margin-bottom: 24px;
  transition: background-color 0.3s;
}

.step-connector.completed {
  background-color: #16a34a;
}

/* Step panel transitions */
.step-panel {
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile-friendly touch targets */
@media (max-width: 640px) {
  .riding-option {
    padding: 12px 16px;
  }

  .step-circle {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .step-label {
    font-size: 11px;
  }

  .step-connector {
    min-width: 24px;
    margin: 0 4px;
    margin-bottom: 20px;
  }
}
