/* ===== Nearby map page ===== */

.nearby-geo-prompt {
  position: absolute;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(4px);
}

.nearby-geo-prompt.hidden {
  display: none;
}

.nearby-geo-prompt-card {
  width: 100%;
  max-width: 340px;
  padding: 20px 18px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.nearby-geo-prompt-title {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 700;
}

.nearby-geo-prompt-text {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.nearby-geo-allow {
  margin-bottom: 10px;
}

.nearby-geo-skip {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nearby-geo-hint {
  margin: 12px 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--muted);
}

.map-search-bar {
  flex-shrink: 0;
  padding: 0 12px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 500;
}

.map-search-inner {
  position: relative;
}

.map-search-bar input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
  font-size: 0.9375rem;
}

.map-search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}

.nearby-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}

.nearby-suggestion-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

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

.nearby-suggestion-item:hover {
  background: var(--surface-2);
}

.map-stop-icon {
  background: transparent;
  border: none;
}

.nearby-stop-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.nearby-stop-marker.is-bus {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.45);
}

.nearby-stop-marker.is-tram {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.45);
}

.nearby-stop-marker.is-nearest.is-tram {
  box-shadow: 0 3px 12px rgba(147, 51, 234, 0.55);
}

.nearby-user-icon {
  background: transparent;
  border: none;
}

.nearby-user-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.55);
}

.nearby-stop-marker.is-nearest {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-width: 3px;
}

.nearby-stop-marker.is-nearest.is-bus {
  box-shadow: 0 3px 12px rgba(234, 88, 12, 0.55);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: 14px 16px 16px;
  font-size: 0.875rem;
  line-height: 1.4;
  min-width: 200px;
}

.leaflet-popup-tip {
  background: var(--surface);
}

.nearby-popup {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nearby-popup-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.35;
  color: var(--text);
}

.nearby-popup-id {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.nearby-popup-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
}

.nearby-popup-routes-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.nearby-popup-routes-scroll .nearby-route-badge {
  flex: 0 0 auto;
}

.nearby-route-badge-more {
  color: var(--muted) !important;
  background: var(--surface-2) !important;
  border: 1px dashed var(--border) !important;
}

.nearby-route-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nearby-route-badge.is-bus {
  color: var(--primary);
  background: var(--primary-weak);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

.nearby-route-badge.is-tram {
  color: #9333ea;
  background: color-mix(in srgb, #9333ea 12%, transparent);
  border: 1px solid color-mix(in srgb, #9333ea 30%, transparent);
}

.nearby-stop-marker.is-metro {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45);
}

.nearby-stop-marker.is-rail {
  background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.45);
}

.nearby-stop-marker.is-ferry {
  background: linear-gradient(180deg, #38bdf8 0%, #0369a1 100%);
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.45);
}

.nearby-stop-marker.is-funicular {
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.45);
}

.nearby-stop-marker.is-trolleybus {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.45);
}

.nearby-route-badge.is-metro {
  color: #dc2626;
  background: color-mix(in srgb, #dc2626 12%, transparent);
  border: 1px solid color-mix(in srgb, #dc2626 30%, transparent);
}

.nearby-route-badge.is-rail {
  color: #0891b2;
  background: color-mix(in srgb, #0891b2 12%, transparent);
  border: 1px solid color-mix(in srgb, #0891b2 30%, transparent);
}

.nearby-route-badge.is-ferry {
  color: #0369a1;
  background: color-mix(in srgb, #0369a1 12%, transparent);
  border: 1px solid color-mix(in srgb, #0369a1 30%, transparent);
}

.nearby-route-badge.is-funicular {
  color: #ca8a04;
  background: color-mix(in srgb, #ca8a04 12%, transparent);
  border: 1px solid color-mix(in srgb, #ca8a04 30%, transparent);
}

.nearby-route-badge.is-trolleybus {
  color: #059669;
  background: color-mix(in srgb, #059669 12%, transparent);
  border: 1px solid color-mix(in srgb, #059669 30%, transparent);
}

.nearby-popup-dist {
  margin: 0 0 14px;
  padding-bottom: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
}

.nearby-area-routes {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  bottom: auto;
  z-index: 450;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.nearby-area-routes-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 2px;
}

.nearby-area-routes-more {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.map-loading.is-light {
  inset: auto;
  top: auto;
  left: auto;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  flex-direction: row;
  gap: 8px;
  font-size: 0.8125rem;
  box-shadow: var(--shadow);
}

.map-loading.is-light span {
  min-width: 11rem;
  text-align: left;
}

.map-loading.is-light .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.map-subtitle.has-zoom-hint {
  color: var(--primary);
  font-weight: 500;
}

/* Leaflet varsayılan mavi link rengini ezmesin */
.leaflet-popup-content a.nearby-popup-btn,
.leaflet-popup-content a.nearby-popup-btn:link,
.leaflet-popup-content a.nearby-popup-btn:visited,
.leaflet-popup-content a.nearby-popup-btn:hover,
.leaflet-popup-content a.nearby-popup-btn:active {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff !important;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-popup-content a.nearby-popup-btn:hover {
  filter: brightness(1.08);
  color: #ffffff !important;
}

/* ===== stop.html (varış listesi) ===== */

.stop-page-header {
  margin-bottom: 4px;
}

.stop-page-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.25;
}

.stop-page-id {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stop-page-type {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

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

.arrival-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s;
}

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

.arrival-row:hover {
  background: var(--surface-2);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: var(--radius-xs);
}

.arrival-row-btn {
  display: flex;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
}

.arrival-row-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.route-badge {
  flex-shrink: 0;
  min-width: 44px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.02em;
}

.arrival-main {
  flex: 1;
  min-width: 0;
}

.arrival-headsign {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stops-pill {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, #16a34a 14%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 35%, transparent);
  text-align: center;
  min-width: 72px;
}

.arrival-eta-pill {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, #16a34a 14%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 35%, transparent);
  font-size: 0.8125rem;
  font-weight: 800;
  color: #16a34a;
  white-space: nowrap;
}

.stops-pill-num {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #16a34a;
  line-height: 1.1;
}

.stops-pill-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #15803d;
  margin-top: 2px;
}

.stop-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.stop-refresh-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.arrival-distance-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.schedule-pill {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 6px 2px 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: color-mix(in srgb, #2563eb 10%, transparent);
  border: 1px solid color-mix(in srgb, #2563eb 28%, transparent);
  white-space: nowrap;
}

.arrival-schedule-times {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.arrival-schedule-note {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.stop-schedule-section {
  margin-top: 20px;
}

.stop-schedule-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stop-schedule-list .arrival-row-scheduled {
  cursor: default;
}

.nearby-schedule-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.nearby-schedule-label {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.nearby-schedule-line {
  margin: 0 0 6px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text);
}

.nearby-stop-card-empty-hint {
  margin-bottom: 0;
  padding-bottom: 4px;
}

.nearby-arrival-chip-dist {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.nearby-arrival-chip-eta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #16a34a 12%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 28%, transparent);
}

.nearby-arrival-chip.is-upcoming {
  cursor: default;
  background: #eef0f3;
  border-color: #d8dde4;
  color: #6b7280;
  box-shadow: none;
}

.nearby-arrival-chip.is-upcoming .nearby-route-badge,
.nearby-arrival-chip.is-upcoming .is-bus,
.nearby-arrival-chip.is-upcoming .is-tram {
  opacity: 0.72;
  filter: grayscale(0.35);
}

.nearby-arrival-chip.is-upcoming .nearby-arrival-chip-stops {
  color: #6b7280;
  font-weight: 500;
}

.arrival-row.is-upcoming {
  background: #eef0f3;
  border-color: #d8dde4;
  color: #6b7280;
  cursor: default;
}

.arrival-row.is-upcoming:hover {
  background: #eef0f3;
  border-color: #d8dde4;
  transform: none;
}

.arrival-row.is-upcoming .route-badge {
  opacity: 0.72;
  filter: grayscale(0.35);
}

.arrival-row.is-upcoming .arrival-headsign {
  color: #6b7280;
}

.stops-pill.is-upcoming-pill {
  background: #dfe3e8;
  color: #6b7280;
}

.stops-pill.is-upcoming-pill .stops-pill-num {
  color: #4b5563;
}

.stops-pill.is-upcoming-pill .stops-pill-label {
  color: #6b7280;
  font-size: 0.6875rem;
}

.bus-chip-dist {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
