body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

button {
    color: black;
  } 

#toggleDrag {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 14px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    top: 80px;
    left: 5px;
    height: 44px;
}

#satnavButton {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    bottom: 10px;
    left: 10px;
    height: 44px;
}

#find-me {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    height: 44px;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

/* Small modal for current street (above Find Me button) */
.street-modal {
  position: fixed;           /* we’ll anchor it via JS */
  display: none;             /* hidden by default */
  z-index: 9999;
  pointer-events: none;      /* so clicks go through to the map/buttons */
}

.street-modal-inner {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.3;
  color: #111;
  pointer-events: auto;      /* you *can* click inside if needed later */
}

#streetLabel {
  font-weight: 600;
  margin-right: 4px;
  color: #666;
}

#streetName {
  font-weight: 500;
}

#streetViewButton {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    bottom: 10px;
    right: 10px;
    height: 44px;
}

/*#openRunTextBtn {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5;
    top: 80px;
    right: 10px;
    height: 44px;
    display: none;
}*/

/* Removes Google default label styling */
.gm-style .gm-style-iw {
    display: none !important;
}

/* CSS for the blue dot */
.blue-dot {
    width: 16px; /* Adjust the size of the dot */
    height: 16px;
    background-color: blue;
    border-radius: 50%;
    border: 2px solid white; /* Optional: Add a white border for contrast */
}

.modal {
    display: none;
    position: fixed;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 110px);
    background: white;
    border-radius: 5px;
    padding: 5px 5px 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 8000;
    /*min-height: 50px;*/
}

.modal-content {
    position: relative;
    padding: 2px 0px 2px 0px;
}

.modal-content button {
    background-color: white;
    border: none;
}

/* FULLSCREEN OVERLAY */
.whygo-modal {
    display: none;  /* stays hidden by default */
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.5);
    z-index: 10000;

    align-items: center;
    justify-content: center;
}

/* MODAL CARD */
.whygo-modal-content {
    font-family: Arial, sans-serif;
    background: #fff;

    width: 90%;
    max-width: 520px;
    max-height: 80vh;

    overflow-y: auto;

    border-radius: 14px;
    padding: 12px 20px 20px 20px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    animation: modalFadeIn 0.2s ease;
}

/* nice entrance */
@keyframes modalFadeIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#whyGoTitle {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

#whyGoText {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* button */
#closeWhyGoModalBtn {
    width: 100%;
    margin-top: 15px;
    padding: 10px;

    border: none;
    border-radius: 8px;

    background: #000;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.modal-run {
    display: none;
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 110px);
    background: white;
    border-radius: 5px;
    padding: 5px 5px 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 7000;
    /*min-height: 50px;*/
}

.modal-run-content {
    position: relative;
    padding: 2px 0px 2px 0px;
    display:flex;
    align-items:center; 
    justify-content:space-between;
}

.modal-run-content button {
    background-color: white;
    border: none;
}

/* -------------------------Save Run Modal-------------------------------- */
#saveRunModal {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 110px);
  background-color: transparent;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Modal Content */
#saveRunModalContent {
  background-color: #fff;
  padding: 20px 30px;
  border-radius: 5px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-family: Arial, sans-serif;
}

#saveRunModalContent h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: #333;
}

/* Form Elements */
#saveRunModalContent label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-weight: 500;
}

#saveRunModalContent input,
#saveRunModalContent select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Button Container */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Buttons */
.modal-buttons button {
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#confirmSaveRunBtn {
  background-color: #007bff;
  color: white;
}

#confirmSaveRunBtn:hover {
  background-color: #0056b3;
}

.modal-buttons button:last-child {
  background-color: #e0e0e0;
  color: #333;
}

.modal-buttons button:last-child:hover {
  background-color: #c2c2c2;
}

#folderDropdownWrapper {
    position: relative;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
}

#selectedFolderDisplay {
    border: 1px solid #ccc;
    padding: 8px 12px;
    background-color: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    /*min-height: 36px;*/
    user-select: none;
    transition: background 0.2s;
}

#selectedFolderDisplay:hover {
    background-color: #f0f0f0;
}

#folderTreeMenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 6px 0;
}

.folder-item {
    padding: 6px 12px;
    margin-left: 0;
    transition: background 0.2s;
}

.folder-item:hover {
    background-color: #f0f0f0;
}

.folder-item::before {
    margin-right: 8px;
}

.folder-item.selected {
    background-color: #d0e7ff;
    font-weight: bold;
}

.folder-item.sublevel {
    margin-left: 20px;
}

/*-----------------------------------Markers----------------------------------------------------*/

#markerName {
    font-family: 'Arial', sans-serif; 
    font-size: 24px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 0px; 
    text-align: center;
}

#markerAddress {
    font-family: 'Arial', sans-serif;
    font-size: 16px; 
    color: #555; 
    text-align: center; 
}

#runNameDisplay {
    font-family: 'Arial', sans-serif; 
    font-size: 16px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 0px; 
    text-align: center;
}

#modalContent h2,
#modalContent p {
    margin-top: 0px;
    margin-bottom: 0px;
}

#modalContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#selectMarkerBtn {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-top: 5px;
    /*font-size: 24px;*/
  }  

#topBar {
    position: absolute;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background-color: transparent;
    z-index: 10;
}

#searchContainer {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#searchBar {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px; /* For the clear button */
    font-size: 16px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    outline: none;
    transition: all 0.3s ease;
}

#searchBar:focus {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#clearSearch {
    position: absolute;
    right: 65px; /* move it left so it's inside the input */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    display: none;
    color: #888;
    z-index: 2;
}

/* Search Results Container Positioned Below the Search Bar */
#searchResults {
    position: absolute;
    top: calc(100% - 9px); /*gap from search bar*/
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    /*border: 1px solid #ccc;
    border-top: none;*/
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-family: 'Arial', sans-serif;
  }
  
  /* Individual Result Item */
  .resultItem {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 1px solid #eee;
  }
  
  .resultItem:last-child {
    border-bottom: none;
  }
  
  .resultItem:hover {
    background-color: #007BFF;
    color: #fff;
  }

  .resultItem:hover .resultAddress {
    color: #fff;
}

  .resultAddress {
    color: #777;
}
  
  /* Optional: Message for no results */
  #searchResults.empty {
    padding: 10px;
    text-align: center;
    color: #777;
  }

  /* Street result entries in search — styled differently */
.resultItem.streetResult {
    font-style: italic;
    color: #777;
}

.resultItem.streetResult:hover {
    background-color: #007BFF;
    color: #fff;
  }

  #toggle-markers, #toggle-toolbars {
    padding: 10px 15px;
    margin: 0 5px;
    border: none;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    height: 44px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

 /*--------------------------------------------------------------------------------------*/
 
 #toolbar-right {
    position: absolute;
    top: 80px;
    right: 0px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px; /* space between buttons */
    background: transparent;
    padding: 8px 5px;
    border-radius: 10px;
}

#toolbar-right button {
    display: flex;              
    align-items: center;          
    justify-content: center;      
    padding: 10px 7px;                
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 18px;              
    border-radius: 5px;
    position: relative;
    line-height: 1;               
}

#toolbar-bottom {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-width: 100vw;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#toolbar-bottom button {
    padding: 10px 15px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    position: relative; 
}

@media (max-width: 600px) {
    #toolbar-bottom {
        left: 0;       
        right: 0;  
        transform: none;        
        margin: auto;
        gap: 5px; /* smaller space between buttons */
        padding: 6px 8px; /* smaller toolbar padding */
    }

    #toolbar-bottom button {
        padding: 10px 12px; /* smaller button padding */
        font-size: 18px; /* smaller text size */
    }
}

#clear-button,
#clear-line-ab-button {
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    pointer-events: auto;
}

#toolbar-lines {
    display: none;
}

#toolbar-lines button.active,
#toolbar-lines button.selected {
    background: navy !important;
    color: white !important;
    border-color: navy !important;
}

/* Highlight selected button (NAVY BLUE) */
.selected {
    background: navy;
    color: white;
    border-color: navy;
}

#distance-display {
    color: red;
    font-size: 13px !important;
}

#distance-display-2 {
    color: purple;
    font-size: 13px !important;
}

/* ------------------------------------------------------------------------------------ */

/* Make checkbox rows use the same "button face" font */
#pin-filter-menu {
  font-family: Arial, sans-serif;
  font-size: 14px; 
}

#pin-filter-menu label,
#pin-filter-menu input[type="checkbox"] {
  font: inherit;   /* inherit the container’s font family & size */
  color: black;    /* matches your global button color */
}

#pin-filter-menu {
  display: none;
  position: absolute;
  z-index: 9000;
  background: white;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  overflow: hidden;
  width: 200px;
}

#pin-filter-menu label {
  display: flex;                 /* lays out checkbox + text on one row */
  align-items: center;
  gap: 10px;                     /* space between checkbox and text */
  width: 100%;
  padding: 10px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  line-height: 1.2;
  user-select: none;
}

/* hover like buttons */
#pin-filter-menu label:hover {
  background-color: #f0f0f0;
}

/* remove the last divider */
#pin-filter-menu label:last-of-type {
  border-bottom: none;
}

/* checkbox spacing + optional accent color (supported in modern browsers) */
#pin-filter-menu input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;                     /* let gap handle spacing */
  accent-color: #2b7cff;         /* optional: theme color for the tick */
}

/*------------------------------------------------------------------------------------------------------*/

#toolbar-menu {
    display: none;
    position: absolute;
    z-index: 9999;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 200px;
}

#toolbar-menu button {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 10px 15px;
    width: 100%;
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    text-align: left;
}

#toolbar-menu button:hover {
    background-color: #f0f0f0;
}

#runInfoModal {
  user-select: none; /* Disable text selection */
  -webkit-user-select: none; /* For Safari */
  -ms-user-select: none; /* For IE/Edge */
}

#runTextTitle {
    cursor: pointer;
}

#runTextTitle::-webkit-scrollbar {
            display: none;
        }

#runTextInput {
  overflow: auto;                /* make it the scroller */
  max-height: calc(100% - 56px); /* leave room for your sticky header; tweak 56px */
}
