body {
    margin: 0;
    padding: 0;
    overflow: auto;
    background-color: #1a1a1a;
    color: #f0f0f0;
}

#container {
    display: flex;
    height: 100%;
}

#namePanel {
    display: none;
}

#routeTitle {
    margin-bottom: 0px;
    line-height: 1;
}

.route-header {
    margin-bottom: 8px;
}

.route-header svg {
    color: #aaa;
}

.route-header svg:hover {
    cursor: pointer;
    color: #fff;
}

.panel {
    background-color: #111111;
    padding: 10px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 0.9em;
}

#mapContainer {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

#mapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

#loadingOverlay {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: calc(100% - 40px);
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#loadingSpinner {
    border: 5px solid #333;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#controlsContainer {
    display: none;
    position: absolute;
    bottom: 20px;
    right: 20px;
    column-gap: 10px;
    align-items: flex-end;
}

#infoBoxContainer {
    display: none;
    position: absolute;
    bottom: 100px;
    right: 20px;
    flex-direction: column;
    row-gap: 20px;
    width: 200px;
}

#mapSelection {
    display: none;
    column-gap: 10px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
}

.map-dropdown {
    width: 300px;
}

#loadMapButton {
    width: 100px;
}

#max-selection-container {
    display: flex;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-height: 100%;
}

#mapVisualSelection {
    column-gap: 20px;
    flex-wrap: wrap;
    display: flex;
    flex: 1 1 auto;
    row-gap: 20px;
    max-width: 1312px;
    width: 100%;
    justify-content: center;
}
#mapVisualSelection .image {
    position:relative;
    overflow: hidden;
    border-radius: 16px;
    width:313px;
    height:174px;
}
#mapVisualSelection .image:hover {
    cursor: pointer;
}
#mapVisualSelection .image img {
    width:100%;
    vertical-align:top;
}
#mapVisualSelection .image:after {
    content:'\A';
    position:absolute;
    width:100%; height:100%;
    top:0; left:0;
    background:rgba(0,0,0,0.3);
    opacity:1;
    transition: all 0.2s;
    -webkit-transition: all 0.2s;
}
#mapVisualSelection .image:hover:after {
    opacity:0;
}

.route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;;
}

.control-group h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #4CAF50;
}

select, button, input[type="text"] {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #555;
    padding: 8px 8px !important;
    width: 100%;
    height: 40px;
    border-radius: 4px;
    padding-left: 15px;
}

button {
    background-color: #4CAF50 !important;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#routeInfoPanel {
    display: none; /* Initially hidden, shown by updateUIDisplay */
    flex-direction: column;
}

.panel h3 {
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 5px;
    color: #4CAF50; /* Match other headings */
    text-align: center;
    /* border-bottom: 1px solid #555; */
}

#routeInfoPanel div {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

#mapInfo {
    font-size: 0.9em;
}

#coordsInfo.panel:empty {
    display: none;
}

#mapInfo.panel:empty {
    display: none;
}

#mapInfo div {
    margin-bottom: 5px;
}

.info-label {
    font-weight: bold;
    color: #4CAF50;
}
#zoomControls {
    display: flex;
    column-gap: 10px;
    width: 200px;
    justify-content: space-between;
}

#zoomControls button {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

#coordsInfo {
    font-size: 0.9em;
    position: absolute;
    bottom: 20px;
    left: 50%;
    display: flex;
    flex-direction: column;
    transform: translateX(-50%);
    text-align: center;
    min-width: 200px;
    row-gap: 5px;
    padding-left: 15px;
    padding-right: 15px;
}

.panel-heading {
    font-weight: 500;
}

.panel-subtext {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #aaa;
}

#panel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    padding: 10px;
    column-gap: 10px;
}

#pointListContainer {
    display: none;
    padding-right: 5px;
    flex-direction: column;
    height: fit-content;
    min-width: fit-content;
    max-height: 100%;
    overflow-y: auto; /* Hide overflow */
    overflow-x: hidden; /* Hide overflow */
    
    /* For Chrome, Edge, and Safari */
    &::-webkit-scrollbar {
        width: 8px;  /* Width of the scrollbar */
    }
    
    &::-webkit-scrollbar-track {
        background: transparent;  /* Makes the track transparent */
    }
    
    &::-webkit-scrollbar-thumb {
        background: rgba(128, 128, 128, 0.5);  /* Semi-transparent thumb */
        border-radius: 4px;  /* Rounded corners for the thumb */
    }
    
    &::-webkit-scrollbar-button {
        display: none;  /* Hides the scrollbar buttons */
    }
    
    /* For Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.5) transparent;
}

#exportUrlPanel:has(#exportUrlField:placeholder-shown) {
    display: none;
}

#exportUrlPanel {
    height: fit-content;
    display: flex;
    flex-direction: column;
    row-gap: 4px;
}

#exportControls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    column-gap: 10px;
}

#pointList {
    margin: 0px;
    padding-right: 5px;
    list-style: none;
    counter-reset: item;
    padding-left: 27px;
    width: fit-content;
    white-space: nowrap;
    border-radius: 8px;
    overflow-y: auto; /* Enable vertical scrolling */
    flex: 1; /* Take remaining height */
    max-height: calc(100% - 30px); /* Account for the heading */
}

#pointList li.hovered {
    background-color: #3f3f3f; /* A slightly different background */
    border-color: #4CAF50;    /* Highlight border */
}

#pointList li:hover {
    background-color: #3f3f3f; /* A slightly different background */
    border-color: #4CAF50;    /* Highlight border */
}

#pointList li.selected {
    background-color: #4a5d4b; /* A slightly different background */
    border-color: #4CAF50;    /* Highlight border */
}

#pointList li {
    display: flex;
    align-items: center;
    counter-increment: item;
    position: relative;
    justify-content: space-between;
    column-gap: 20px;
    text-align: left;
    padding: 5px 10px;
    margin-left: 5px;
    margin-bottom: 3px; /* Space between items */
    background-color: #333;
    border-radius: 8px;
    cursor: grab; /* Indicate draggable */
    font-size: 0.9em;
    user-select: none; /* Prevent text selection during drag */
    transition: background-color 0.2s ease;
}

#pointList li:first-child:before, #pointList li:last-child:before {
    background-color: #434343;
}

#pointList li::before {
    content: counter(item);
    position: absolute;
    left: -19px;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center; /* Center number horizontally */
    align-items: center; /* Center number vertically */
    width: 25px;
    height: 25px;
    line-height: 1.5em;
    background-color: #333;
    border-radius: 50%; /* Optional - makes it circular */
    font-size: 12px;
    font-weight: bold;
  }

#pointList li:last-child {
    margin-bottom: 0;
}

#pointList li.placeholder {
    font-style: italic;
    color: #888;
    cursor: default;
}

/* Style for the item being dragged */
#pointList li.dragging {
    opacity: 0.5;
    background-color: #555;
}

/* Style for potential drop target */
#pointList li.drag-over {
    border-top: 2px solid dodgerblue; /* Highlight where it will drop */
    /* background-color: #404040; */ /* Optional: background highlight */
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    width: 10px;
    height: 10px;
    background: #ccc !important;
    border-radius: 50%; /* Circular thumb */
    cursor: pointer; /* Pointer cursor on hover */
    margin-top: -3px;
}

input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #ccc !important;
    border-radius: 50%;
    cursor: pointer;
    border: none; /* Remove default border */
}

/* Style for the slider track */
input[type="range"] {
    height: 4px; /* Specific height for the track */
    cursor: pointer;
    background: #333; /* Dark grey track */
    border-radius: 2px; /* Rounded track */
    width: 80px; /* Make slider take full width of container */
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 80px;
    height: 4px;
    cursor: pointer;
    background: #333;
    border-radius: 2px;
}

input[type="range"]::-moz-range-track {
    width: 80px;
    height: 4px;
    cursor: pointer;
    background: #333;
    border-radius: 2px;
}

#routeBuilderLink {
    display: flex;
    justify-content: space-between;
}

#routeBuilderLink h3 {
    margin-bottom: 0px;
}

/* Container for the tabs */
#path-versions-bar, #bottom-bar {
    background: #111;
}

/* --- Tab Scrolling Styles --- */

/* Wrapper to contain the scrolling tabs and the gradient */
#tabs-scroll-wrapper {
    position: relative; /* Needed for absolute positioning of the overlay */
    flex: 1 1 auto; /* Allow wrapper to grow and shrink */
    min-width: 0; /* Prevent flex item from overflowing its container */
    overflow: hidden; /* Hide anything extending beyond the wrapper */
  }
  
  /* The actual container for the tabs */
  #tabs-container {
    display: flex;
    gap: 0.5rem; /* Equivalent to gap-2 */
    overflow-x: auto; /* Enable horizontal scrolling */
    white-space: nowrap; /* Prevent tabs from wrapping to the next line */
    padding-bottom: 1rem; /* Add padding to push scrollbar out of view */
    margin-bottom: -1rem; /* Counteract padding to maintain layout */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
  }
  
  /* Hide scrollbar for WebKit browsers (Chrome, Safari) */
  #tabs-container::-webkit-scrollbar {
    display: none;
  }
  
  /* Ensure individual tabs don't shrink */
  #tabs-container .path-version-tab {
      flex-shrink: 0;
  }
  
  /* Base styles for gradient overlays */
  .scroll-gradient-overlay-left,
  .scroll-gradient-overlay-right {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0; /* Extend slightly below to cover potential scrollbar space */
      width: 16px; /* Adjust width as needed */
      pointer-events: none; /* Allow clicks to pass through */
      opacity: 0; /* Hidden by default */
      transition: opacity 0.2s ease-in-out; /* Smooth fade */
      z-index: 10; /* Ensure it's above the tabs */
  }  
  
  /* Class to show the RIGHT gradient when overflow is active and not scrolled to end */
  #tabs-scroll-wrapper.has-scroll-right .scroll-gradient-overlay-right {
      opacity: 1;
  }
  
  /* Class to show the LEFT gradient when overflow is active and scrolled from start */
  #tabs-scroll-wrapper.has-scroll-left .scroll-gradient-overlay-left {
      opacity: 1;
  }

/* Left Gradient Overlay */
.scroll-gradient-overlay-left {
    left: 0;
    background: linear-gradient(to right, rgb(17, 17, 17), rgba(17, 17, 17, 0));
}

/* Right Gradient Overlay */
.scroll-gradient-overlay-right {
    right: 0;
    background: linear-gradient(to left, rgb(17, 17, 17), rgba(17, 17, 17, 0));
}

input[type="text"]#routeTitleEditField {
    border: 0px;
    padding: 0px !important;
    line-height: 1;
    background-color: #111;
    font-size: 18px;
    font-weight: 500;
    width: 300px;
}

#overlay-container {
    position: relative;
}

.overlay-modal  {
    position: absolute;
    top: 0;
    right: 0;
}

#pointNoteEdit.overlay-modal, #routeDescriptionEdit.overlay-modal  {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
}

input[type="text"].overlay-field {
    border: 0px;
    padding: 0px 0px 0px 5px !important;
    line-height: 1;
    background-color: #111;
    font-size: 14px;
    letter-spacing: 0.35px;
    height: auto;
}

#exportUrlPanel input[type="text"].overlay-field {
    font-size: 12px;
}