/* ============================================================
   Search Map — Scoped styles for the inline search/browse map.
   ============================================================ */

/* Wrapper */
.search-map-inline {
  position: relative;
  width: 100%;
}

.search-map-inline .map-container {
  width: 100%;
  height: 615px;
}

/* ---- Popup ---- */
.search-map-inline .maplibregl-popup-close-button {
  display: none;
}

.search-map-inline .maplibregl-popup-content {
  border-radius: 5px;
  padding: 0 !important;
  overflow-y: auto;
  background-color: #d84627;
  width: 300px;
  min-height: 30px;
  max-height: 200px;
  border: 1px solid white;
  color: white;
  font-size: 13px;
  overflow: auto;
  line-height: 110%;
}

.search-map-inline .maplibregl-popup-content::-webkit-scrollbar { width: 8px; }
.search-map-inline .maplibregl-popup-content::-webkit-scrollbar-thumb { background-color: white; border-radius: 4px; }
.search-map-inline .maplibregl-popup-content::-webkit-scrollbar-track { background: #d84627; }
.search-map-inline .maplibregl-popup-content::-webkit-scrollbar-button { display: none; }

/* ---- Cluster markers ---- */
.search-map-inline .clusterMarker {
  background-color: #d84627;
  border-radius: 20px;
  text-align: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid white;
  color: white;
  font-size: 13px;
  padding: 2px;
  cursor: pointer;
}

/* ---- Marker / Trackhead ---- */
.search-map-inline .marker:hover { z-index: 999999; }

.search-map-inline .trackhead {
  transition-duration: 300ms;
  border-radius: 25px 28px 33px 0;
  background-color: #d84627;
  width: 33px;
  height: 34px;
  transform: rotateY(0deg) rotate(-45deg) translate(50%, -50%) !important;
  border: 3px solid white;
  color: white;
  font-size: 13px;
  overflow: hidden;
  padding: 2px;
  line-height: 90%;
  cursor: pointer;
}

.search-map-inline .trackhead:hover {
  width: 200px;
  border-radius: 7px 7px 7px 0;
  height: unset;
  min-height: 61px;
  transform: rotateY(0deg) rotate(0deg) translate(50%, -50%) !important;
  line-height: 110%;
  z-index: 9999999;
  overflow: unset;
}

.search-map-inline .trackhead:before {
  content: '';
  padding: 35px;
  left: -40px;
  bottom: 0px;
  display: block;
  float: left;
  position: absolute;
}

/* ---- Journey summary in trackhead ---- */
.search-map-inline .journeySummaryTableSummaryTab,
.search-map-inline .trackhead:hover .journeyTitle {
  padding: 5px;
  font-weight: bold;
}

.search-map-inline .journeyClass {
  width: 0px;
  height: 0px;
  float: left;
}
.search-map-inline .trackhead:hover .journeyClass,
.search-map-inline .journeySummaryTableSummaryTab .journeyClass {
  transition-duration: 300ms;
  width: 30px;
  height: 30px;
  padding: 5px;
}

.search-map-inline .journeyImage {
  transition-delay: 5000ms;
  transition-duration: 2000ms;
  width: 0px;
  height: 0px;
  visibility: hidden;
  display: none;
  padding: 0;
  float: right;
  margin: -2px;
  border-radius: 0 4px 4px 0;
  padding-left: 5px;
}
.search-map-inline .journeySummaryTableSummaryTab .journeyImage,
.search-map-inline .trackhead:hover .journeyImage {
  display: block;
  visibility: unset;
  width: 65px;
  height: 65px;
  background-size: cover;
}

.search-map-inline .journeyTime {
  font-size: 0px;
  padding: 5px 5px 5px 0px;
}
.search-map-inline .journeySummaryTableSummaryTab .journeyTime,
.search-map-inline .trackhead:hover .journeyTime {
  transition-delay: 200ms;
  transition-duration: 200ms;
  font-size: 11px;
}

/* ---- Journey summary table (popup) ---- */
.search-map-inline .journeySummaryTable {
  max-width: 300px;
  background-color: #d84627;
}

.search-map-inline .jstRow {
  transition-duration: 300ms;
  display: grid;
  grid-template-columns: 80% 20%;
  grid-template-rows: auto;
  grid-template-areas: "title distance";
  gap: 5px;
  padding: 5px 5px 5px 15px;
  cursor: pointer;
}
.search-map-inline .jstRow:hover { background-color: #dd5436; }
.search-map-inline .jstTitle { grid-area: title; }
.search-map-inline .jstDistance { grid-area: distance; }
.search-map-inline .jstRow:hover .jstImages { display: flex; }

.search-map-inline .journeySummaryTableSummaryTab {
  transition-duration: 500ms;
  width: 200px !important;
  border-radius: 7px 7px 7px 0;
  height: 70px;
  max-height: 0px;
  min-height: 0px;
  line-height: 110%;
  z-index: -1;
  border: 3px solid white;
  color: white;
  font-size: 13px;
  overflow: unset;
  background-color: #d84627;
  position: fixed;
  top: 10px;
  left: 0px;
}
.search-map-inline .journeySummaryTableSummaryTab:hover { top: -70px; }

/* ---- Search form overlay ---- */
.search-map-inline .search-form-overlay {
  display: block;
  overflow: hidden;
  max-height: 43px;
  background-color: #d84627;
  max-width: 130px;
  padding: 10px;
  position: absolute;
  top: 2px;
  left: 50px;
  z-index: 1000;
  color: white;
  transition: max-height 200ms, max-width 200ms;
  animation: searchMapPulse 1.5s infinite ease-in-out;
}

@keyframes searchMapPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.search-map-inline .search-form-overlay:hover {
  max-height: 300px;
  max-width: 175px;
  transition: max-height 200ms, max-width 200ms;
  animation: unset;
}

.search-map-inline .search-form-overlay::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 3px;
  width: 92%;
  height: 29px;
  border-right: 1px dotted #ffffff;
  border-bottom: 1px dotted #ffffff;
  box-sizing: border-box;
  transition-duration: 500ms;
  transition-delay: 150ms;
}
.search-map-inline .search-form-overlay:hover::after {
  width: 0%;
  height: 0px;
}

.search-map-inline .search-form-overlay select,
.search-map-inline .search-form-overlay input[type="text"] {
  width: 100%;
  padding: 3px;
  margin: 3px 0;
}

.search-map-inline .search-form-clear {
  background-color: #d84627;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.search-map-inline .search-form-clear:hover { background-color: #bf3e20; }
.search-map-inline .search-form-clear:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: translateY(1px);
}

/* ---- Results sidebar ---- */
.search-map-inline .results-sidebar {
  display: block;
  overflow: hidden;
  max-height: 40px;
  max-width: 134px;
  padding: 10px;
  position: absolute;
  background-color: #4cacff;
  top: 52px;
  left: 50px;
  z-index: 1000;
  transition: max-height 200ms, max-width 200ms;
}
.search-map-inline .results-sidebar:hover {
  max-height: calc(100% - 80px);
  max-width: 300px;
  overflow: auto;
  transition: max-height 200ms, max-width 200ms;
  animation: unset;
}

/* ---- Loading spinner ---- */
@keyframes searchMapPulseLoading {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); }
}

.search-map-inline .search-map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -25px;
  margin-left: -25px;
  width: 50px;
  height: 50px;
  z-index: 9999;
  display: none;
  animation: searchMapPulseLoading 1.5s infinite ease-in-out;
}

.search-map-inline .search-map-loading-dot {
  width: 50px;
  height: 50px;
  background-color: #d84627;
  border-radius: 50%;
  opacity: 0.8;
}

/* ---- Touch modal (reuses walk-map pattern) ---- */
.search-map-inline .walk-map-modal {
  display: none;
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}
.search-map-inline .walk-map-modal-content {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px;
  box-shadow: 0 0 30px 30px rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  text-align: center;
  font-size: larger;
  color: white;
  user-select: none;
}
