/* css/style.css */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

.toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 40;
  background: rgba(255,255,255,0.9);
  padding: 8px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 80%;
}

.toolbar .toolbar-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar button, .toolbar select, .toolbar input {
  margin: 0;
  padding: 3px 6px;
  font-size: 12px;
}

.toolbar label.basemap-label {
  margin-right: 4px;
  font-weight: bold;
}

.auth-button {
  background-color: #0078D7;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}

.auth-button:hover {
  background-color: #005a9e;
}

.auth-section-upper-right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
}

#routeTip {
  font-style: italic;
  color: #555;
}

.autocomplete-container {
  position: relative;
  width: 200px;
}

#searchInput {
  width: 100%;
  padding: 3px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.suggestions-list li {
  padding: 5px;
  cursor: pointer;
}

.suggestions-list li:hover {
  background: #f0f0f0;
}

.google-attribution {
  font-size: 10px;
  margin-top: 2px;
  color: #555;
}

.marker {
  background-color: #0078D7;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #fff;
  color: #fff;
  text-align: center;
  line-height: 18px;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}

.waypoint-marker {
  background-color: #0078D7;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #fff;
  cursor: pointer;
  user-select: none;
}

.place-marker {
  background-color: #FF5733;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #fff;
  cursor: pointer;
  user-select: none;
}

.route-handle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  pointer-events: auto;
  cursor: default !important;
}

.route-dot-handle {
  width: 12px;
  height: 12px;
  background: white;
  border: 2px solid #0078D7;
  border-radius: 50%;
  cursor: grab;
  pointer-events: auto;
}

.route-dot-handle.grabbing {
  cursor: grabbing !important;
}

.miles-display {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 30;
  background: rgba(255,255,255,0.9);
  padding: 5px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  display: none;


  /* make height relative to viewport, scroll when content exceeds */
  max-height: 60vh;   /* e.g. 60% of viewport height */
  overflow-y: auto;

  /* keep the bottom edge fixed so it grows up */
  transform-origin: bottom left;
}

.miles-display thead {
  position: sticky;
  top: 0;
  background: #fff;
}

.floating-dialog {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: #fff;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 10px;
  display: none;
  max-width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
/* Make the sign-in dialogs wider than the default */
#authModal,
#emailAuthModal {
  min-width: 380px;   /* wider base */
  max-width: 90vw;    /* prevent overflow on small screens */
}

/* Override for auth modals: fixed so they don't affect layout */
#authModal,
#emailAuthModal {
  position: fixed;      /* anchor to viewport */
  top: auto;
  left: auto;
  display: none;        /* shown & positioned by JS */
  z-index: 2000;        /* above toolbars */
  min-width: 200px;     /* wider base for comfortable UI */
  max-width: 90vw;      /* never exceed viewport width */
}
.floating-dialog h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.floating-dialog ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.floating-dialog ul li {
  margin: 4px 0;
  padding: 2px 4px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.floating-dialog ul li:hover {
  background: #f0f0f0;
}

.floating-dialog button {
  margin-top: 8px;
  padding: 3px 6px;
  font-size: 12px;
}

.delete-route, .delete-place {
  background: transparent;
  border: none;
  color: red;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
}

.streetview-marker {
  position: relative;
  background-color: #FFFF00;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: grab;
}

.streetview-marker:after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #FFFF00 transparent transparent transparent;
}

.photo-marker {
  background-color: #FFD700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
}

.photo-popup img {
  max-width: 200px;
  max-height: 200px;
}

.miles-display table {
  width: 100%;
  border-collapse: collapse;
}

.miles-display th, .miles-display td {
  padding: 6px;
  text-align: left;
}

.miles-display th {
  border-bottom: 2px solid #333;
}

.miles-display tr:not(:last-child) td {
  border-bottom: 1px solid #ccc;
}

.miles-display tr.total {
  font-weight: bold;
}

.edit-place-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-place-form label {
  font-size: 12px;
}

.edit-place-form input,
.edit-place-form select,
.edit-place-form textarea {
  font-size: 12px;
  padding: 3px;
}

.edit-place-form textarea {
  resize: vertical;
  height: 60px;
}

/* --- Theme colors --- */
.toolbar-section.route-controls button {
  background-color: #0078D7;
  color: white;
}

.toolbar-section.places-controls button {
  background-color: #28a745;
  color: white;
}

.toolbar-section.photos-controls button {
  background-color: #FFD700;
  color: black;
}

/* Street View icon button */
.streetview-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
}

.streetview-button svg {
  width: 20px;
  height: 20px;
  fill: #555;
}

.streetview-marker {
  width: 20px;
  height: 20px;
  cursor: grab;
}

.streetview-marker svg {
  width: 20px;
  height: 20px;
  fill: #555;
}

.streetview-marker.active svg {
  fill: #0078D7;
}

/* Share-route icon button */
.share-route {
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  font-size: 1.1em;
  color: inherit;
}

.share-route:hover {
  color: #0078D7;
}

.place-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

#addGroupBtn {
  display: block;
  margin-bottom: 8px;
  padding: 2px 6px;
  font-size: 12px;
}

#groupsList li:hover {
  background: #f0f0f0;
}

/* Highlight folder on drag-over */
#groupsList li.drag-over {
  background-color: #e0f7fa; /* Light cyan */
}

/* Make place items draggable */
#placesList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
  cursor: grab;
}

#placesList li.dragging {
  opacity: 0.4;
}

/* Smaller, tighter place-list items */
#placesList li {
  padding: 2px 4px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}

#placesList li button {
  font-size: 10px;
  margin-left: 4px;
}

/* Ensure all li-buttons (zoom/edit/delete) are small and inline */
#placesList li > button {
  padding: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
}

#placesList li.selected {
  background-color: #e0e0e0;
  font-weight: bold;
}

@media (pointer: coarse) {
  /* On touch devices: make targets bigger */
  .marker, .waypoint-marker, .place-marker {
    width: 30px;
    height: 30px;
  }
  /* Switch hover tooltips off */
  .toolbar button:hover { /* no-op */ }
}

/* Two-column layout for the My Places dialog */
#placesDialogContent {
  display: grid;
  grid-template-columns: max-content max-content; /* both columns size to their content */
  gap: 12px;
  height: 60vh;                 /* give children a real height to size against */
  max-height: 60vh;
  overflow: hidden;             /* children manage their own scroll */
}

.places-column {
  /* Make the left column size to its content width but scroll vertically */
  display: flex;                 /* so the list can flex and scroll */
  flex-direction: column;
  min-width: max-content;        /* avoid extra right-side whitespace */
  min-height: 0;                 /* allow flex child to shrink */
  height: 100%;                  /* establish height for the flex child */
  overflow: hidden;              /* vertical scroll will be on the list below */
  border-right: 1px solid #ddd;
  padding-right: 8px;
}

.groups-column {
  min-width: 260px;              /* keep controls readable */
  width: max-content;            /* shrink-to-fit content (no extra white space) */
  max-width: 45vw;               /* safety on very narrow screens */
  height: 100%;
  overflow-y: auto;              /* this column scrolls independently */
  overflow-x: hidden;            /* avoid horizontal scrollbars from badges */
}

/* Make the Places list itself scroll vertically, not the whole column */
#savedPlacesDialog #placesList {
  display: block;
  max-height: none;              /* inherit from container */
  overflow-y: auto;              /* scrolls independently */
  flex: 1;                       /* fill the flex column height */
  min-height: 0;                 /* allow shrinking inside the column */
  width: max-content;            /* match content width (no extra whitespace) */
}

/* Place rows: left text + right actions */
#savedPlacesDialog #placesList li {
  display: grid;
  grid-template-columns: 1fr auto; /* text grows | actions hug right */
  align-items: center;              /* vertical centering for icons */
  column-gap: 8px;
}
#savedPlacesDialog #placesList li .place-name {
  white-space: nowrap;              /* do NOT wrap the left line */
  overflow: hidden;
  text-overflow: ellipsis;
}
#savedPlacesDialog #placesList li .place-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;        /* icons right-justified */
  align-items: center;               /* icons vertically centered */
}

/* Groups column rows: name/checkbox on left, actions on right */
#savedPlacesDialog .groups-column #groupsList {
  width: 100%;
}
#savedPlacesDialog .groups-column #groupsList li {
  display: grid !important;                /* override generic flex rule below */
  grid-template-columns: max-content auto; /* name grows to content | icons hug right */
  align-items: center;                      /* vertical alignment */
  column-gap: 6px;
  white-space: nowrap;                      /* keep each row on a single line */
}
#savedPlacesDialog .groups-column #groupsList li .group-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;         /* right-justify */
  flex-wrap: nowrap;                 /* icons never wrap */
  white-space: nowrap;               /* icons stay on one line */
}

/* Put long shared-with badges on their own line so they don't widen/wrap the row */
#savedPlacesDialog .groups-column #groupsList li .shared-with-container {
  grid-column: 1 / -1;               /* span full width on a second row */
  justify-self: end;                  /* align to the right under the icons */
  margin-top: 4px;
  white-space: normal;                /* badges may wrap within this line */
}
/* Compact 2-column rows: name | actions */
#savedPlacesDialog #placesList { width: max-content; }
#savedPlacesDialog #placesList li {
  display: grid;
  grid-template-columns: 1fr 56px;  /* text grows | icons fixed */
  align-items: center;
  column-gap: 6px;
}
#savedPlacesDialog #placesList li .place-name {
  white-space: nowrap;
}

#addGroupBtn {
  display: block;
  margin-bottom: 8px;
  padding: 2px 6px;
  font-size: 12px;
}

/* Generic style for groups list items (kept for other dialogs),+   but in the Saved Places dialog we override to grid above. */
#groupsList li {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: center;
  padding: 4px;
  cursor: pointer;
  flex-wrap: wrap;          /* wrap badges/buttons if we ever hit the viewport limit */
}
#groupsList li .folder-icon {
  margin-right: 6px;
  font-size: 1.1em;
}

#groupsList li.drag-over {
  background-color: #e0f7fa;
}

/* Tighter, smaller place-list items */
#placesList li {
  padding: 2px 4px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}

#placesList li.dragging {
  opacity: 0.4;
}

#placesList li > button {
  padding: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  margin-left: 4px;
}

/* Styles for shared (read-only) groups */
.shared-group {
  opacity: 0.6;
  cursor: default;
}

.shared-group .delete-group,
.shared-group .share-group,
.shared-group .place-actions button {
  display: none;
}

/* Prevent drag-over highlighting for shared groups */
#groupsList li.shared-group.drag-over {
  background-color: inherit; /* Override the drag-over highlight */
}

/* Disable dragging in read-only mode */
#placesList.drag-disabled li {
  cursor: default;
  pointer-events: none;
}

#placesList.drag-disabled li button {
  pointer-events: auto; /* Allow clicking zoom if desired */
}

/* Mobile (pointer:coarse) tweaks */
@media (pointer: coarse) {
  .marker, .waypoint-marker, .place-marker {
    width: 30px;
    height: 30px;
  }
  /* Disable hover effects on mobile */
  button:hover { /* no-op */ }
}

.save-stops {
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  font-size: 1.1em;
  color: inherit;
}


/* Share-group icon next to each folder */
.share-group {
  background: transparent;
  border: none;
  color: #0078D7;
  font-size: 12px;
  margin-left: 6px;
  cursor: pointer;
  font-size: 10px;
  margin-left: 6px;
}

.share-group:hover {
  color: #0078D7;
}

/* Make the red "delete group" ✕ visible */
.delete-group {
  background: transparent;
  border: none;
  color: red;
  cursor: pointer;
  font-size: 10px;
  margin-left: 6px;
}

/* Style for the "Remove" button on shared groups */
.remove-shared-group {
  background: transparent;
  border: none;
  color: #666; /* Gray to distinguish from the red delete button */
  cursor: pointer;
  font-size: 10px;
  margin-left: 6px;
}

.remove-shared-group:hover {
  color: #333; /* Darker gray on hover */
}

/* Container for sharedWith badges and buttons */
.shared-with-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  flex-wrap: wrap;
}

/* Style for sharedWith badges */
.shared-with-badge {
  background-color: #e0e0e0;
  color: #333;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}

/* Style for unshare buttons */
.unshare-user {
  background: transparent;
  border: none;
  color: #ff4444; /* Same red as delete button */
  cursor: pointer;
  font-size: 10px;
  padding: 0 4px;
}

.unshare-user:hover {
  color: #cc0000;
}

/* Style for Unshare All button */
.unshare-all {
  background: transparent;
  border: none;
  color: #ff4444;
  cursor: pointer;
  font-size: 10px;
  padding: 0 4px;
}

.unshare-all:hover {
  color: #cc0000;
  text-decoration: underline;
}

/* Add to style.css */

/* Places dialog: let it grow with content (override .floating-dialog's 300px cap) */
#savedPlacesDialog {
  width: auto;        /* expand to fit content */
  max-width: 96vw;    /* but don't exceed viewport */
  min-width: 600px;   /* keep a sensible minimum */
  max-height: 80vh;   /* fix height context so inner lists can scroll */
  overflow: hidden;   /* prevent outer dialog from stealing the scroll */
  
}

/* Style the unshare button differently */
.unshare-user {
  color: #ff9800; /* Orange color to differentiate from delete (red) */
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  margin-left: 5px;
}

/* Ensure shared-with-container doesn't require horizontal scrolling */
.shared-with-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.shared-with-badge {
  background-color: #e0e0e0;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 12px;
}

/* RIDB Campsites toggle button 
.toolbar-section.ridb-controls button {
  background-color: #1E90FF;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12px;
}
*/

.mapboxgl-ctrl.route-info ul#stopsList li {
  /* one stop per line, no wrapping */
  /* ensure only your manual “1.” appears */
  list-style: none;
  white-space: nowrap;
}
/* Group checkboxes styling */
#groupSelectControls {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}


#groupsList li input[type="checkbox"] {
  margin-right: 6px;
}
.mapboxgl-ctrl.route-info {
  position: fixed;
  top: 100px;
  right: 10px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: auto;
  resize: both;           /* always show a two-way resize handle */
  box-sizing: border-box; /* include borders/padding in the size so the handle remains clickable */
  min-width: 200px;
  min-height: 120px;     /* enough for ~10 stops + header */
  max-width: 80vw;
  max-height: 80vh;
  background: rgba(255,255,255,0.95);
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: default;
  padding: 0;
}

.mapboxgl-ctrl.route-info .route-info-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Optional: make drag handle clearer */
.mapboxgl-ctrl.route-info:before {
  content: '⇕';
  font-size: 10px;
  color: #999;
  display: block;
  text-align: center;
  margin-bottom: 4px;
  cursor: move;
}
.mapboxgl-ctrl.route-info ul#stopsList {
  flex: 1;          /* fills remaining space */
  min-height: 0;    /* allow flex‐shrink */
  overflow-y: auto; /* always scrollable */
  list-style: none;
  padding-left: 0;
  margin-left: 0;

}

#routeInfoTitle {
  font-size: 14px;
  font-weight: bold;
  padding: 8px;
  background: #f7f7f7;
  cursor: move;
  user-select: none;
}
.streetview-button {
  display: flex;
  align-items: center;
  gap: 4px;
}

.streetview-label {
  font-size: 12px;
  color: #333;
  padding-left: 2px;
}

.streetview-hint {
  font-size: 12px;
  color: #444;
  margin-top: 4px;
  margin-left: 6px;
  font-style: italic;
}

/* Fade-in animation keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Watermark logo container with animation */
#watermark-logo {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  opacity: 0; /* start hidden */
  animation: fadeIn 2s ease-out 0.5s forwards;
  pointer-events: none; /* don't block map clicks */
}

#watermark-logo img {
  max-width: 160px;
  opacity: 0.5; /* subtle transparency */
}
.route-select-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 16px 20px;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  font-family: sans-serif;
  text-align: center;
  max-width: 300px;
}

.route-select-modal h4 {
  margin-top: 0;
  font-size: 16px;
}

.route-select-modal select {
  width: 100%;
  margin: 10px 0;
  padding: 6px;
  font-size: 14px;
}

.route-select-modal button {
  background: #0078d4;
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}

.route-select-modal button:hover {
  background: #005a9e;
}
/* --- My Photos dialog layout --- */
#savedPhotosDialog {
  min-width: 640px;
  max-width: 90vw;
}

#photosDialogContent.two-column {
  display: grid;
  grid-template-columns: 1fr 240px; /* list | groups */
  gap: 8px;
  align-items: start;
  max-height: 60vh;
}

#savedPhotosList,
#photoGroupsList {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 56vh;
}

.photos-column { /* left side */
  min-width: 320px;
}

.groups-column { /* right side */
  border-left: 1px solid #ddd;
  padding-left: 8px;
}

#photoGroupSelectControls button {
  margin-right: 6px;
}

/* --- Photo groups list items & action buttons --- */
#photoGroupsList li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  cursor: pointer;
}
#photoGroupsList li.drag-over { background-color: #e0f7fa; }
#photoGroupsList li .place-count { margin-left: auto; opacity: .7; }
#photoGroupsList li > button {
  padding: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
}

/* Route-association icon next to each photo group */
.route-group {
  color: #444;
}
.route-group:hover { text-decoration: underline; }



/* === Photo hover popup === */
.mapboxgl-popup.photo-hover-popup .mapboxgl-popup-content {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 12px;
}

.photo-preview {
  max-width: 240px;
  max-height: 180px;
  overflow: hidden;
  border-radius: 12px;
  outline: 2px solid rgba(0,0,0,0.08);
  background: #fff;
}

.photo-preview img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.photo-preview.missing {
  font: 12px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 8px 10px;
  color: #333;
  background: #fff;
}
/* ===== Photo hover preview ===== */
#photoHover {
  position: fixed;
  pointer-events: none;      /* don’t steal the mouse */
  display: none;             /* only visible during hover */
  z-index: 9999;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  background: #000;
  transition: opacity 120ms ease;
  opacity: 0;
}

#photoHover.visible {
  display: block;
  opacity: 1;
}

#photoHover img {
  display: block;
  max-width: 300px;          /* adjust if you want larger thumbs */
  max-height: 220px;
  object-fit: cover;
}

#photoHover .addr {
  margin-top: -28px;         /* pulls the caption over the image bottom */
  background: rgba(0,0,0,0.55);
  color: #fff;
  font: 500 12px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  padding: 6px 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  backdrop-filter: blur(2px);
  white-space: nowrap;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* (Optional) If you use Mapbox popups elsewhere and want photo-friendly sizing */
.mapboxgl-popup-content img.popup-photo {
  display: block;
  max-width: 320px;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
}
/* ===== My Routes dialog: layout & close button ===== */
.floating-dialog {
  position: relative; /* anchor for absolute close button */
}
.floating-dialog#savedRoutesDialog {
  /* Wider so long route names fit; still respect viewport */
  width: min(250px, 96vw);
  max-width: 96vw;
  padding-right: 8px; /* pull icons closer to right edge */
}
.floating-dialog .dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  color: #000; /* black X */
  z-index: 10001; /* make sure it sits above content */
  
}
.floating-dialog .dialog-close:hover { opacity: 0.85; }

/* Hard override in case other rules interfere */
#savedRoutesDialog #closeSavedRoutesBtn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  color: #000 !important;
  display: inline-block !important;
  z-index: 10002 !important;
}
/* ===== My Routes list items: right-justified, vertically centered icons ===== */
#savedRoutesList li.route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 6px;
}
#savedRoutesList li.route-item .route-name {
  /* Show full name; allow wrapping if needed */
  white-space: normal;
  word-break: break-word;
  flex: 1 1 auto;
  /* Modern font + emphasis */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: 600;
}
#savedRoutesList li.route-item .route-actions {
  margin-left: auto;          /* push actions to the far right */
  display: flex;
  align-items: center;        /* vertical alignment */
  gap: 6px;                   /* a bit tighter */
  padding-right: 0;           /* no extra right padding */
}
#savedRoutesList li.route-item .route-actions button {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Remove extra right padding on the list so icons sit closer to edge */
#savedRoutesList {
  padding-right: 4px;
}