:root {
    --directions-inputBg: #e6e6e6; 
    --direction-inputTxt: black; 
    --switch-direction: #e6e6e6; 
}

.dark-mode {
    --directions-inputBg: white; 
    --direction-inputTxt: black; 
    --switch-direction: black; 
}


.driving_directions_mainLG {
    background-color: var(--cat-bg); 
    color: var(--darkText-light); 
    z-index: 9000; 
    position: absolute; 
    left: -350px; 
    width: 350px; 
    height: 100%; 
    overflow-y: auto;
}

/* Fieldset styling */
fieldset {
    position: relative;
    margin-right: 1rem;
    border: 0.75px solid var(--searchBar-outline);
    border-radius: 15px;
    padding: 0.5rem;
    background-color: var(--searchBar-bg); /* Match input background */
    margin: 0; /* Override default fieldset margins */
}

.fieldSet_main {
    position: relative; 
    margin-right: 2rem; 
    border: 0.75px solid var(--searchBar-outline); 
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem 0.4rem 0.5rem; 
    margin-bottom: 0.65rem;
    color: var(--direction-inputTxt); 
    background: var(--directions-inputBg); 
}

.fieldSet_legend {
    font-family: 'Poppins'; 
    font-size: 1rem; 
    font-weight: 500; 
    color: var(--darkText-light); 
    padding: 0 0.25rem; 
}

.fieldSet_input {
    width: 100%;
    padding-right: 1.875rem; 
    border: none; 
    outline: none; 
    background: transparent;
    font-family: 'Poppins'; 
    font-size: 0.975rem; 
    
}

/* Space between fieldsets */
fieldset + fieldset {
    margin-top: 0.5rem;
}

/* Legend styling */
legend {
    font-family: 'Poppins';
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--darkText-light);
    padding: 0 0.25rem; /* Small padding to "break" the border */
}

/* Input styling */
#start-point, #destination {
    background-color: transparent; /* Fieldset handles background */
    font-family: 'Inter';
    color: var(--direction-inputTxt) !important;
    padding: 0rem 1.875rem 0rem 1.425rem; /* Adjusted padding */
    border: none;
    outline: none;
    font-size: 0.975rem;
    width: 100%;
    box-sizing: border-box;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none;
}

/* Autofill styling */
.driving_directions_mainLG #start-point:-webkit-autofill,
.driving_directions_mainLG #destination:-webkit-autofill {
    -webkit-text-fill-color: var(--darkText-light) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--searchBar-bg) inset !important;
    background-color: transparent !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 0.975rem !important;
    font-weight: 500 !important;
    border: none !important;
    padding-top: 0.275rem !important;
    padding-right: 1.875rem !important;
    padding-bottom: 0.15rem !important;
    padding-left: 0.425rem !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

#start-point:-webkit-autofill::placeholder,
#destination:-webkit-autofill::placeholder {
    color: var(--direction-inputTxt) !important;
    opacity: 1 !important;
    font-family: 'Inter'; 
}


#start-point:invalid, #destination:invalid {
    border: none;
    color: var(--direction-inputTxt) !important;
    box-shadow: none;
}

 #destination::placeholder {
    color: var(--direction-inputTxt);
    opacity: 1;
}

#start-point::placeholder {
    color: var(--direction-inputTxt); 
    opacity: 1; 
}

#start-point:focus, #destination:focus {
    caret-color: var(--direction-inputTxt); /* Or set a specific color like #ffffff or var(--some-bright-color) */
}

/* Button styling */
#start-action, #dest-action {
    top: 1.145rem;
}

#clearDirections, #printDirections {
    border: none;
    font-size: 0.925rem;
    font-weight: 600;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.725rem;
    padding-bottom: 0.65rem;
    background: var(--all-buttons);
    color: #ffffff;
    border-radius: 0.5rem;
    opacity: 1;
    transition: opacity 0.28s ease-in-out;
    cursor: pointer;
    line-height: 1;/* Moved from inline */
    font-family: 'Inter'; 
}

#clearDirections:hover, #printDirections:hover {
    opacity: 0.7;
}

#switchDirections {
    display: inline-block;
    width: 25px;
    height: 25px;
    vertical-align: middle;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#switchDirections svg {
    width: 100%;
    height: 100%;
    fill: var(--darkText-light); /* Match text color */
}

.driving_directions_mainLG .directions svg {
    width: 24px;
    height: 24px;
}

#directions  {
    position: relative; 
}

.directions-loading {
    position: absolute;
    top: 0;
    left: 0;
    margin-top: 17rem; 
    width: 100%;
    height: 100%; 
    display: none; 
    justify-content: center;
    background: var(--cat-bg);
    z-index: 10; 
  }

  .directionsButton {
    display: flex; 
    justify-content: center; 
    position: relative;
  }

  #clearDirections {
    margin-top: 1.25rem; 
  }

  #printDirections {
    margin-top: 1.25rem; 
    
  }

 @media (max-width: 768px) {
    .driving_directions_mainLG {
      width: 350px; 
    }

    .directionsButton {
        justify-content: center; 
        margin-left: 0; 
    }

    #clearDirections {
        margin-right: 0rem; 
    }

    #printDirections {
        display: none; 
    }
  }
  
  @media (min-width: 769px) {
    .driving_directions_mainLG {
      width: 350px; 
    }

    #clearDirections {
        margin-right: 0.5rem; 
    }
  }

  @media (max-width: 768px) {
    .driving_directions_mainLG.is-open {
      top: 325px !important; /* Override any default top */

    }

    
}