/* ==================== SAMARA TRANSPORT TRACKER ==================== */
.tr-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tr-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tr-search-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 10px 36px 10px 36px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.tr-search-input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tr-search-ico {
  position: absolute;
  left: 12px;
  font-size: 14px;
  opacity: 0.72;
  pointer-events: none;
}

.tr-search-clear {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  max-height: 310px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tr-search-group-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 8px 2px;
}

.tr-search-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.tr-search-item:hover,
.tr-search-item:active {
  background: var(--bg-soft);
}

.tr-pills-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tr-pills-row::-webkit-scrollbar {
  display: none;
}

.tr-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
}

.tr-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

.tr-map-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1422;
  height: 340px;
  min-height: 300px;
}

.tr-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Dark theme filter when OSM tiles used in dark mode without CARTO DarkMatter */
.tr-map-card[data-tile-filter="osm-dark"] .maplibregl-canvas {
  filter: invert(90%) hue-rotate(180deg) brightness(0.95) contrast(0.92);
}

.tr-map-float-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 48px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.tr-status-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(11, 15, 23, 0.84);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(8px);
}

.tr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tr-dot--live {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}

.tr-dot--warn {
  background: #f59e0b;
}

.tr-dot--muted {
  background: #94a3b8;
}

.tr-map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tr-map-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(11, 15, 23, 0.86);
  color: #f8fafc;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.tr-map-btn:active {
  transform: scale(0.95);
}

.tr-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.16), rgba(11, 15, 23, 0.94));
  color: #cbd5e1;
}

.tr-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
}

.tr-route-chip.is-selected {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.tr-badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 6px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
}

.tr-type-1 { background: #2563eb; }
.tr-type-2 { background: #7c3aed; }
.tr-type-3 { background: #dc2626; }
.tr-type-4 { background: #059669; }
.tr-type-5 { background: #4f46e5; }
.tr-type-6 { background: #0284c7; }

.tr-veh-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tr-veh-marker.is-archive {
  opacity: 0.68;
  border-style: dashed;
}

.tr-detail-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tr-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tr-fav-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.tr-fav-btn.is-fav {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
}

.tr-routes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tr-veh-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tr-veh-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.tr-fav-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tr-alert-box {
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.42;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: var(--text);
}

.tr-tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
