/* ============================================================
   PUBBER — App-specific styles
   ============================================================ */

/* ---- Radius pill selector ---- */
.radius-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radius-pill {
  padding: 9px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.radius-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.radius-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
}

/* ---- Pub list header ---- */
.pub-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pub-count-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pub-list-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-selected-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.select-all-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.select-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.selection-banner {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

/* ---- Pub list ---- */
.pub-list {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-input);
  margin-bottom: 16px;
}

.pub-item {
  display: flex;
  align-items: flex-start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}

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

.pub-item:hover {
  background: var(--bg-card);
}

.pub-item.selected {
  background: var(--bg-card);
  box-shadow: inset 3px 0 0 var(--accent);
}

.pub-checkbox-area {
  display: flex;
  align-items: flex-start;
  padding-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}

.pub-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.pub-info {
  flex: 1;
  min-width: 0;
}

.pub-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.pub-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.pub-type-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.type-pub {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid rgba(251,191,36,0.25);
}

.type-bar {
  background: rgba(99,102,241,0.1);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.2);
}

.pub-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pub-distance {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.pub-rating {
  font-size: 12px;
  color: var(--text-secondary);
}

.pub-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.no-pubs {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ---- Map dot markers ---- */
.start-marker-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.pub-dot-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(150,150,150,0.7);
  border: 1.5px solid rgba(255,255,255,0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: all 0.15s;
}

.pub-dot-selected {
  background: var(--accent, #fbbf24) !important;
  border-color: white !important;
  width: 14px !important;
  height: 14px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35) !important;
}

.numbered-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.numbered-marker-pub {
  background: #1a1d24;
  color: #fbbf24;
}

.numbered-marker-start {
  background: #fbbf24;
  color: #1a1d24;
  font-size: 10px;
}

/* ---- Sticky crawl footer ---- */
.crawl-footer {
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  padding: 14px 20px 18px;
  padding-bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px));
}

.crawl-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.crawl-footer-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.options-toggle-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  font-family: inherit;
}

.options-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.crawl-options-panel {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.plan-footer-btn {
  width: 100%;
  padding: 17px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.plan-footer-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.3);
}

.plan-footer-btn:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---- Crawl options ---- */
.option-row {
  margin-bottom: 14px;
}

.option-row:last-child {
  margin-bottom: 0;
}

.option-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.option-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-sidebar);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.option-select:focus {
  border-color: var(--accent);
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  display: none;
}

.toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  background: var(--bg-input);
  border-radius: 12px;
  transition: background 0.25s;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: #1a1a1a;
}

.toggle-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- Route results ---- */
.route-summary {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.summary-stat {
  text-align: center;
  flex: 1;
}

.summary-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 3px;
  letter-spacing: -0.5px;
}

.summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.summary-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ---- Crawl progress ---- */
.crawl-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  border: 1.5px solid var(--border);
}

.crawl-progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.crawl-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.crawl-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---- Step list ---- */
.step-list-container {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.step-list-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.step-list-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 38px;
  bottom: -10px;
  width: 2px;
  background: var(--border);
}

.step-item:last-child {
  padding-bottom: 0;
}

.step-item:first-child {
  padding-top: 0;
}

.step-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
  z-index: 1;
  transition: all 0.25s;
}

.step-marker-pub {
  background: var(--accent);
  color: #1a1a1a;
}

.step-marker-pub.visited {
  background: #22c55e;
  color: white;
  font-size: 14px;
}

.step-marker-start {
  background: var(--bg-sidebar);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.step-content {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.step-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  transition: color 0.25s;
}

.step-item.visited .step-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.step-leg {
  font-size: 12px;
  color: var(--text-muted);
}

.step-visit-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 1px;
}

.step-visit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.step-visit-btn.visited {
  border-color: #22c55e;
  background: #22c55e;
  color: white;
}

/* ---- Route action buttons ---- */
.route-action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.route-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 13px 14px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.route-action-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.route-action-btn.secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.route-action-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-input);
  box-shadow: none;
  transform: none;
}

/* ---- Palette grid ---- */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.palette-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.palette-btn:hover {
  border-color: var(--accent);
}

.palette-btn.active {
  border-color: var(--accent);
  background: var(--bg-card);
}

.palette-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.palette-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  text-align: left;
}

/* ---- Save Crawl modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-sidebar);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
}

.modal-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a1a;
}

.modal-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #1a1a1a;
}

/* ---- Saved crawls view ---- */
.saved-crawls-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-crawl-item {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.saved-crawl-item:hover {
  border-color: var(--accent);
}

.saved-crawl-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.saved-crawl-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.saved-crawl-meta span { display: flex; align-items: center; gap: 3px; }

.saved-crawl-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.saved-crawl-btn {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.saved-crawl-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.saved-crawl-btn.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.saved-crawl-completed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 12px;
  padding: 2px 8px;
  margin-bottom: 4px;
}

.empty-saved {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.empty-saved-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ---- Page sections (settings / about / saved) ---- */
.page-section {
  padding: 4px 0;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.setting-section {
  margin-bottom: 20px;
}

.setting-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.about-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.about-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.about-version {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Saved crawl top row ---- */
.saved-crawl-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.saved-crawl-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.saved-crawl-badge.completed {
  color: #22c55e;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
}

/* ---- Saved crawl progress bar ---- */
.saved-crawl-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.saved-crawl-progress-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.saved-crawl-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* ---- Toast notification ---- */
.pubber-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-sidebar);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  pointer-events: none;
}

.pubber-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile */
@media (max-width: 600px) {
  .radius-pills { gap: 6px; }
  .radius-pill { padding: 8px 12px; font-size: 12px; }
  .pub-list { max-height: 260px; }
  .route-action-row { flex-direction: column; }
  .route-action-btn { min-width: 0; }
  .palette-grid { grid-template-columns: 1fr; }
}
