/* Mobile Canvassing App Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

.mobile-header {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}

.logout-link {
  position: absolute;
  right: 20px;
  font-size: 0.75rem;
  color: #999;
  text-decoration: none;
}

.mobile-logo {
  height: 40px;
  width: auto;
}

.mobile-content {
  padding: 20px;
}

/* Precinct List Styles */
.precinct-list {
  list-style: none;
}

.precinct-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.precinct-item:active {
  background-color: #e8e8e8;
}

.precinct-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.precinct-name {
  font-weight: 600;
  font-size: 18px;
  color: #333;
}

.precinct-cities {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.precinct-stats {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stat-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  min-width: 50px;
  text-align: center;
}

.stat-pill.green {
  background-color: #4CAF50;
}

.stat-pill.yellow {
  background-color: #FFC107;
  color: #333;
}

.stat-pill.orange {
  background-color: #FF9800;
}

.stat-pill.black {
  background-color: #333333;
}

.stat-pill.blue {
  background-color: #2196F3;
}

/* Page Title */
.page-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.back-button {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

/* Walking List - Street Selector */
.street-select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-bottom: 16px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}

/* Walking List - Address Groups */
.street-group {
  display: none;
}

.street-group.active {
  display: block;
}

.address-list {
  list-style: none;
}

.address-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.address-item:active {
  background-color: #e8e8e8;
}

.resolve-item {
  flex-direction: column;
  align-items: stretch;
}

.resolve-main-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.resolve-actions {
  margin-top: 10px;
  gap: 8px;
}

.resolve-btn {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  border-radius: 6px;
  background-color: #e0e0e0;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.address-name {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: #333;
}

.address-stats {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Party letters */
.party-letters {
  font-weight: 700;
  font-size: 14px;
  color: #555;
  letter-spacing: 1px;
}

/* Contact status pills */
.stat-pill.status-no-contact {
  background-color: #9e9e9e;
}

.stat-pill.status-literature {
  background-color: #2196F3;
}

.stat-pill.status-contacted {
  background-color: #4CAF50;
}

.stat-pill.status-hot {
  background-color: #FF9800;
}

/* Donor score */
.donor-score {
  color: #8D6E63;
  font-weight: 700;
  font-size: 14px;
}

/* Notes indicator */
.has-notes {
  color: #F57C00;
  font-weight: 700;
  font-size: 16px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

/* Modal header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-address-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.modal-close {
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  color: #666;
  line-height: 1;
}

/* Contact status boxes */
.status-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.status-box {
  flex: 1;
  padding: 12px 4px;
  border-radius: 8px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.status-box.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px #333;
}

.status-box.status-no-contact { background-color: #9e9e9e; }
.status-box.status-literature  { background-color: #2196F3; }
.status-box.status-contacted   { background-color: #4CAF50; }
.status-box.status-hot         { background-color: #FF9800; }

/* Sign toggle */
.sign-row {
  margin-bottom: 12px;
}

.sign-box {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  background-color: #e0e0e0;
  color: #333;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.sign-box.selected {
  background-color: #66BB6A;
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 0 3px #333;
}

/* Contact notes */
.notes-row {
  margin-bottom: 16px;
}

.notes-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.notes-row textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

/* Contact cards */
.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.contact-card:active {
  background-color: #e8e8e8;
}

.contact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.contact-name-block {
  display: flex;
  flex-direction: column;
}

.contact-middle-name {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-top: 1px;
}

.contact-name {
  font-weight: 700;
  font-size: 16px;
  color: #333;
}

.contact-age {
  font-size: 13px;
  color: #888;
}

.contact-details {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  line-height: 1.6;
}

.contact-details span {
  margin-right: 8px;
  white-space: nowrap;
}

.contact-notes-preview {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-top: 4px;
}

/* Expanded card */
.contact-card-expanded {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.contact-card.expanded .contact-card-expanded {
  display: block;
}

.contact-card-expanded label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
  margin-top: 10px;
}

.contact-card-expanded label:first-child {
  margin-top: 0;
}

.contact-card-expanded input[type="text"],
.contact-card-expanded textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.contact-card-expanded textarea {
  resize: vertical;
}

/* Toggle boxes (Contact / Volunteer) */
.toggle-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.toggle-box {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background-color: #e0e0e0;
  color: #333;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.toggle-box.selected {
  background-color: #66BB6A;
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 0 3px #333;
}

.toggle-box.selected.no-contact {
  background-color: #e53935;
}

.toggle-box.merge-box {
  background-color: #5C6BC0;
  color: #fff;
  flex: none;
  padding: 10px 16px;
}

/* Error toast notification */
.error-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background-color: #c62828;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  z-index: 2000;
  max-width: 320px;
  width: calc(100% - 40px);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.error-toast.visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.error-toast-close {
  margin-left: auto;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Add person to household */
.add-person-row {
  display: flex;
  gap: 8px;
  margin: 12px 16px 16px;
  align-items: center;
}

.add-person-row input[type="text"] {
  flex: 1;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.add-person-row button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background-color: #455A64;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.add-person-row button:active {
  background-color: #37474F;
}

/* Admin Launch Page */
.admin-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.admin-button {
  display: block;
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  background-color: #333;
  color: #fff;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.admin-button:active {
  background-color: #555;
}

/* Search Form */
.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-family: inherit;
  outline: none;
}

.search-input:focus {
  border-color: #888;
}

.search-no-results {
  color: #888;
  font-size: 15px;
  margin-top: 8px;
}

.address-name-block {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.search-subtext {
  font-size: 13px;
  color: #888;
}

/* Login Form */
.login-error {
  background-color: #fde8e8;
  border: 1px solid #e53e3e;
  color: #c53030;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
}

.login-field input {
  padding: 12px;
  font-size: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}

.login-field input:focus {
  border-color: #888;
}

.login-button {
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-button:active {
  background-color: #555;
}

/* Canvass Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field > label {
  font-size: 17px;
  font-weight: 700;
  color: #333;
}

.settings-field input {
  padding: 12px;
  font-size: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}

.settings-field input:focus {
  border-color: #888;
}

.settings-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 10px;
  margin-top: 4px;
  max-width: 510px;
}

.settings-submit {
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.settings-submit:active {
  background-color: #555;
}

/* Resolver / Merge Page */
.resolver-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.resolver-table td, .resolver-table th {
  padding: 6px 6px;
  vertical-align: middle;
}

.resolver-val-col {
  width: 44%;
  font-size: 15px;
  color: #333;
  word-break: break-word;
}

.resolver-unresolved-col {
  text-align: right;
}

.resolver-val-col.resolver-same {
  color: #aaa;
}

.resolver-radio-col {
  width: 5%;
  text-align: center;
}

.resolver-radio-col input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.resolver-empty {
  color: #bbb;
  font-style: italic;
}

.resolver-submit-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.resolver-hint {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin: 0;
}

/* Merge bar */
.merge-bar {
  background-color: #ffebee;
  border-bottom: 1px solid #ef9a9a;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.merge-bar-info { flex: 1; min-width: 0; }
.merge-bar-name { font-weight: 700; font-size: 15px; color: #333; }
.merge-bar-sub { font-weight: 400; font-size: 13px; color: #888; margin-top: 2px; }
.merge-bar-actions { display: flex; flex-direction: column; gap: 6px; margin-left: 12px; flex-shrink: 0; }
.merge-bar-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.merge-bar-btn.cancel-btn { background-color: #e0e0e0; color: #333; }
.merge-bar-btn.nomatch-btn { background-color: #e0e0e0; color: #333; text-decoration: none; display: block; text-align: center; }

/* Filter Status Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  padding: 10px 16px;
  margin-bottom: 12px;
}
.filter-bar-status { font-size: 14px; color: #555; }
.filter-bar-status a { font-weight: 700; color: #333; text-decoration: none; }
.filter-bar-actions { display: flex; gap: 12px; }
.filter-bar-actions a { font-size: 14px; font-weight: 700; color: #333; text-decoration: none; }

.filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter-list-item {
  border-bottom: 1px solid #eee;
}

.filter-list-item:last-child {
  border-bottom: none;
}

.filter-list-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

.filter-list-item a:active {
  background-color: #f5f5f5;
}

.filter-check {
  color: #4CAF50;
  font-weight: 700;
}

/* Leaderboard */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}

.leaderboard-section {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.leaderboard-heading {
  background: #333;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  gap: 12px;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-medal {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.leaderboard-name {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.leaderboard-count {
  font-size: 18px;
  font-weight: 700;
  color: #555;
  min-width: 36px;
  text-align: right;
}

.leaderboard-empty {
  padding: 14px 16px;
  font-size: 14px;
  color: #999;
  font-style: italic;
}

/* User Management Page */
.user-section {
  margin-bottom: 20px;
}

.user-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.user-button {
  display: block;
  width: 100%;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}

.user-button:active {
  opacity: 0.8;
}

.user-button.user-self {
  background-color: #aaa;
  color: #fff;
  cursor: default;
}

.user-button.user-admin {
  background-color: #333;
  color: #fff;
}

.user-button.user-canvasser {
  background-color: #2196F3;
  color: #fff;
}

.user-button.user-new {
  background-color: #4CAF50;
  color: #fff;
}

/* User modal rows */
.user-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.user-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.user-toggle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.user-name-row {
  margin-bottom: 14px;
}

.user-name-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.user-name-row input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.user-name-row input[type="text"]:focus {
  border-color: #888;
}

.user-delete-link {
  font-size: 14px;
  color: #c62828;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: inherit;
  padding: 4px 0;
}

/* Sign placement grid */
.sign-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.sign-grid-label {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  padding: 4px 8px;
}

.sign-btn {
  padding: 14px 8px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  text-align: center;
  width: 100%;
}

.sign-btn:active {
  opacity: 0.75;
}

.sign-btn.purple {
  background-color: #7B1FA2;
}

.sign-btn.blue {
  background-color: #1565C0;
}

.sign-btn.red {
  background-color: #C62828;
}

.sign-btn.pink {
  background-color: #C2185B;
}

/* Sign notes modal */
.sign-modal-field {
  margin-bottom: 14px;
}

.sign-modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.sign-modal-field input,
.sign-modal-field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}

.sign-modal-field textarea {
  resize: vertical;
}

/* Modal background tints for create / edit mode */
.sign-modal-create {
  background-color: #c8e6c9;
}

.sign-modal-edit {
  background-color: #fffde7;
}

/* Bottom action row */
.sign-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.sign-submit-btn {
  flex: 1;
  padding: 14px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.sign-submit-btn:active {
  opacity: 0.8;
}

.sign-new-btn {
  padding: 14px 16px;
  background: #fff;
  color: #333;
  border: 2px solid #999;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.sign-new-btn:active {
  background: #eee;
}

.sign-remove-btn {
  padding: 14px 16px;
  background: #C62828;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.sign-remove-btn:active {
  background: #8E1C1C;
}
