/* Civic Tabs Navigation */
.civic-tabs {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid color-mix(in srgb, var(--text-inverse) 12%, transparent);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.civic-tabs::-webkit-scrollbar {
  display: none;
}

.civic-tab {
  flex: 1;
  min-width: 100px;
  padding: 1rem 0.5rem;
  background: color-mix(in srgb, var(--text-inverse) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-inverse) 32%, transparent);
  border-radius: 12px;
  color: var(--text-inverse);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-snap-align: start;
}

.civic-tab .tab-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.civic-tab .tab-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.civic-tab:hover {
  background: color-mix(in srgb, var(--text-inverse) 26%, transparent);
  border-color: var(--text-inverse);
}

.civic-tab.active {
  background: var(--bg-white);
  border-color: var(--bg-white);
  color: var(--primary);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--text-inverse) 32%, transparent);
  transform: translateY(-4px);
}

.civic-tab.active .tab-icon,
.civic-tab.active .tab-label {
  text-shadow: none;
}

.civic-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.civic-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767px) {
  .civic-tab {
    min-width: 100px;
    padding: 0.5rem;
  }

  .civic-tab .tab-icon {
    font-size: 1.25rem;
  }

  .civic-tab .tab-label {
    font-size: 0.75rem;
  }
}

#home-dashboard {
  width: 100%;
  min-height: 320px;
  display: block;
}

.wdp-dashboard-shell {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 18px 22px;
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
  color: var(--text-dark);
}

@media (max-width: 640px) {
  .wdp-dashboard-shell {
    padding: 12px 12px 18px;
    border-radius: 12px;
  }
}

.dashboard-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-tab-bar .tab-btn {
  flex: 1;
  min-width: 108px;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dashboard-tab-bar .tab-btn:hover {
  background: var(--border-color);
  border-color: var(--border);
  color: var(--text-dark);
}

.dashboard-tab-bar .tab-btn.active {
  background: var(--accent-orange);
  color: var(--text-inverse);
  border-color: var(--accent-orange);
  box-shadow: var(--shadow-md);
}

.dashboard-content {
  min-height: 360px;
}

.wdp-dashboard-shell .reps-tab .rep-finder-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.wdp-dashboard-shell .reps-tab .rep-finder-input {
  max-width: 100%;
  padding: 0;
}

.wdp-dashboard-shell .reps-tab .location-input-header {
  text-align: left;
  margin-bottom: 1.25rem;
}

.wdp-dashboard-shell .reps-tab .location-input-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
}

.wdp-dashboard-shell .reps-tab .location-input-header p {
  margin-top: 0.35rem;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.55;
}

.wdp-dashboard-shell .reps-tab .form-input,
.wdp-dashboard-shell .reps-tab .form-select {
  background: var(--card-bg);
  color: var(--text-dark);
  border-color: var(--border-color);
}

.wdp-dashboard-shell .reps-tab .wdp-reps-empty-msg {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
  .wdp-dashboard-shell .reps-tab .form-input,
  .wdp-dashboard-shell .reps-tab .form-select {
    background: var(--bg-white) !important;
    color: var(--chat-bg) !important;
    border-color: var(--neutral-200) !important;
  }

  .wdp-dashboard-shell .reps-tab .rep-card {
    background: var(--bg-white) !important;
    border-color: var(--neutral-200) !important;
  }

  .wdp-dashboard-shell .reps-tab .rep-card:hover {
    border-color: var(--accent-purple) !important;
  }

  .wdp-dashboard-shell .reps-tab .rep-name,
  .wdp-dashboard-shell .reps-tab .representatives-display .rep-info h3 {
    color: var(--neutral-800) !important;
  }

  .wdp-dashboard-shell .reps-tab .rep-title,
  .wdp-dashboard-shell .reps-tab .rep-district,
  .wdp-dashboard-shell .reps-tab .representatives-display .rep-title-line,
  .wdp-dashboard-shell .reps-tab .representatives-display .district {
    color: var(--neutral-500) !important;
  }

  .wdp-dashboard-shell .reps-tab .rep-party,
  .wdp-dashboard-shell .reps-tab .representatives-display .party {
    color: var(--accent-purple) !important;
  }

  .wdp-dashboard-shell .reps-tab .search-type-selector {
    background: var(--neutral-50) !important;
    border-color: var(--neutral-200) !important;
  }

  .wdp-dashboard-shell .reps-tab .search-type-btn {
    color: var(--neutral-500) !important;
  }

  .wdp-dashboard-shell .reps-tab .search-type-btn:hover:not(.active) {
    background: var(--neutral-100) !important;
  }

  .wdp-dashboard-shell .reps-tab .search-type-btn.active {
    background: var(--accent-orange) !important;
    color: var(--text-inverse) !important;
  }

  .wdp-dashboard-shell .reps-tab .full-address-section {
    background: var(--neutral-50) !important;
  }

  .wdp-dashboard-shell .reps-tab .full-address-disclosure {
    background: var(--finder-info-surface) !important;
    border-color: color-mix(in srgb, var(--accent-blue) 35%, var(--neutral-200)) !important;
  }
}
