/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}
#whatsappButton{
    display: none;
}
#debugging{
    display: none;
    flex-direction: column;
    width: 81%;
    gap: 3px;
    z-index: 92;
    position: relative;
    top: 32%;
    left: 4%;
    color: #fff;
    padding: 1px;
}
#debugging li {
    display: flex;
    flex-direction: row;
}

#debugging li span{color: red; margin-left: 0px; padding: 1px;}


#nav {
    display: block;

}
#address_image{width: 90% !important; height: 45% !important;}
  .dialog-box {
        display: flex;
        flex-direction: column;
        position: absolute;
        min-height: fit-content;
        width: 90%;
        font-size: 20px;
        margin: 0 auto;
        top: 40%;
        left: 5%;
        background: #fff;
        padding: 20px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        border-radius: 20px;
}

.dialog-box h1 {
    color: #333;
    background-color: green;
    padding: 10px;
    border: none;
}
#searchContainer {
    margin: 0 auto;
    top: 58%;
    left: 5%;
    width: 85%;
    height: auto;
    list-style: none;
    font-size: 17px;
    background-color: #fff;
    margin-top: 20px;
}

#map{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0%;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 30;
}

#instructionsContainer{
    display: none;
    flex-direction: row;
    margin: 0 auto;
    padding: 0px;
    width: 99vw;
    position: absolute;
    height: 15vh;
    min-height: fit-content;
    top: 1vh;
    left: 0;
    right: 0;
    background-color: green;
    z-index: 50;
    border-radius: 10px;
}
#instructionsContainer #turning-distance{
    margin: 0 auto;
    padding: 3px;
    position: absolute;
    left: 10px;
    top: 52px;
    font-size: 20px;
    color: #fff;
}
#instructions {
    position: absolute;
    width: 80%;
    height: 100%;
    top: 1%;
    left: 17%;
    right: 5%;
    padding: 10px 10px;
    border-radius: 2%;
    text-align: center;
    overflow-y: scroll;
    font-family: sans-serif;
    color: #fff;
    transform: scale(1.1);
    font-size: 23px;
}

#info{
    display: flex;
    flex-direction: row;
    width: 100%;
}

#instructions-icon {
    width: 50%;
    height: 40%;
    margin-left: 0px;
    margin-top: 6px;
    flex-basis: max-content;
}

#arrived {
    margin: 0 auto;
    position: absolute;
    bottom: 10%;
    z-index: 40;
    width: 100%;
    background-color: #f8f9fa;
    border-radius: 10px;
    top: 25%;
    bottom: 0;
    display: none;
    text-align: center;
    color: #000;
}

#arrived p{
    font-weight: 600;
    margin: 6px 20px;
    display: block;
}

#arrived img{
    width: 25%;
    height: 11vh;
    margin: 0 auto;
    padding: 2px;
    margin-top: 8px;
    object-fit: fill;
}

#travelInfo {
    margin: 0 auto;
    position: absolute;
    bottom: 0vh;
    height: 13vh;
    z-index: 40;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    width: 100vw;
    background-color: #008000;
    color: #fff;
    font-size: 25px;
    display: none;
}

#travelInfo .travelInfo {
position: absolute;
top: 15px;
left: 10px;
width: 25%;
color: #fff;
}
.mapboxgl-ctrl-attrib.mapboxgl-compact {display: none !important;}
.mapboxgl-ctrl-bottom-right {bottom: 65% !important;}
#travelInfo #exit{
    width: 60px;
    height: 40px;
    position: absolute;
    top: 22%;
    right: 4%;
    transform: scale(1.3);
    border: none;
    border-radius: 25%;
    background-color: #c33b50;
    color: #fff;
    font-size: 17px;
    padding: 1px 6px;
    text-align: center;
    font-style: normal;
    font-family: monospace;
    font-weight: 600;
    display: block;
    z-index: 99999;
}
    #travelInfo #travelTime, #arr-dis {
        padding-top: 5px;
        color: #fff;
        font-size: 20px;
        padding-left: 0px;
        font-size: 22px;
    }

#travelInfo .border-top{
    width: 17%;
    border-top: 1px solid;
    background-color: #9e9e9e;
    position: absolute;
    top: 9px;
    left: 40%;
    height: 2px;
}
#tripInfo{
    width: 90%;
    display: flex;
    flex-direction: column;
    position: relative;
    left: 7%;
    padding: 6px 19px;
}

#tTimeandBtn{
    display: flex;
    padding: 0px;
}

#remdisAndArrTime{
    width: 70%;
}

.truckMarker{
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,191,255,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0,191,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,191,255,0); }
}


#accuracy {
    top: 42%;
    background-color: red;
    color: #fff;
    height: 40px;

}

#heading{
    position: absolute;
    top: 50%;
    left: 5vw;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgb(0 0 0 / 48%);
    color: #fff;
    display: none;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    z-index: 30;
}
#heading-d{
    color: #fff;
    font-size: 25px;
    display: block;
    margin-top: 30px;
}
#heading-text{
    font-size: 15px;
    display: block;
    z-index: 90;
    margin-top: -3px;
    color: #000;
    font-family: fantasy;
}

.deviation-warning {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 165, 0, 0.8);
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 95;
    display: none;
}
#recalculatingMessage {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    display: none;
    z-index: 110;
}

#locationServices {
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    display: none;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.status-initializing {
    background-color: #FFA500; /* Orange */
    display: block;
}

.status-success {
    background-color: #4CAF50; /* Green */
    display: block;
}

.status-warning {
    background-color: #FFC107; /* Amber */
    display: block;
}

.status-error {
    background-color: #F44336; /* Red */
    display: block;
}
#debugging{
    width: 70%;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 90;
    position: relative;
    top: 35%;
    left: 10%;
    color: #fff;
    padding: 10px;
}
footer{
    position: absolute;
    bottom: 12%;
    max-height: 200px;
}
#remainingDis,#remainingTime,#deviation,#currentInstruction,#mainjs,#maxAttempt{
    display: block;
    position: absolute;
    top:40%;
    color:red;
    font-size: 20px;
    padding: 20px;
    left: 20%;
    margin: 10px;
}
.navigation-status-bar {
    position: fixed;
    top: 30vh; /* 30% from top */
    right: 5vw; /* 5% from right */
    display: none;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.status-icon, .speed-display {
    width: 5vw; /* 5% of viewport width */
    height: 5vw; /* Square icons */
    min-width: 50px; /* Minimum size for mobile */
    min-height: 50px;
    max-width: 80px; /* Maximum size for large screens */
    max-height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.status-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.status-icon:active {
    transform: scale(0.95);
}

/* GPS Status Icon */
.gps-status {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 3px solid #fff;
    position: relative;
}

.gps-status.lost {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.gps-icon {
    width: 60%;
    height: 60%;
    fill: white;
}

/* Voice Status Icon */
.voice-status {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: 3px solid #fff;
    position: relative;
}

.voice-status.muted {
    background: linear-gradient(135deg, #757575, #424242);
}

.voice-icon {
    width: 60%;
    height: 60%;
    fill: white;
}

/* Mute indicator */
.voice-status.muted::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 3px;
    background: #f44336;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 2px;
}

/* Speed Display */
.speed-display {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    border: 3px solid #fff;
    flex-direction: column;
    padding: 8px;
    box-sizing: border-box;
}

.speed {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.speed-unit {
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Status indicator dot */
.status-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-dot.online {
    background: #4CAF50;
    animation: pulse-green 2s infinite;
}

.status-dot.offline {
    background: #f44336;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

/* Main container */
#navContainer {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin: 10px;
    padding: 16px;
    margin: 10px auto;
    overflow: hidden;
    position: absolute;
    z-index: 100;
}

#navForm {
    width: 94%;
    transform: scale(1.1);
}

/* Navigation container - mobile first */
#nav-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

/* Nav icons section - 10% width */
#nav-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 10%;
    min-width: 40px;
    position: relative;
    margin-right: -17px;
}

#nav-icons-dot {
   width: 40px;
    height: 34px;
    fill: #6c757d;
    margin-bottom: -12px;
}

#strongGroup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin: 1px 0;
}

#strongGroup strong {
    font-size: 14px;
    color: #6c757d;
    line-height: 1;
}

#geo {
    height: 14px;
    width: 20px;
    margin-left: 1px;
    margin-top: 5px;
}

/* Input group section - 90% width */
#navInputGroup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 90%;
}

/* Input containers */
#org, #dest {
    position: relative;
    width: 100%;
}

/* Input styling */
#origin, #destination {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background-color: #ced4dabd;
    transition: all 0.3s ease;
    outline: none;
}

#origin:focus, #destination:focus {
    border-color: #0d6efd;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

#origin::placeholder, #destination::placeholder {
    color: #6c757d;
    font-size: 14px;
}

/* Search container */
#searchContainer {
    list-style: none;
    background: #ffffff;
    border-radius: 8px;
    margin: 30px 0;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.3);
    display: none;
}

#searchContainer:not(:empty) {
    display: block;
    border: 1px solid #e9ecef;
}

/* Transport mode selection */
#directions-profile {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#car-group, #bicycle-group, #walking-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

#car-group:hover, #bicycle-group:hover, #walking-group:hover {
    background-color: #e9ecef;
}

#car-group input, #bicycle-group input, #walking-group input {
    margin: 0;
    transform: scale(1.2);
}

#car-group svg, #bicycle-group svg, #walking-group svg {
    fill: #6c757d;
    transition: color 0.3s ease;
}

#car-group input:checked ~ svg,
#bicycle-group input:checked ~ svg,
#walking-group input:checked ~ svg {
    fill: #0d6efd;
}

/* Start button */
#start {
    margin: 0 auto;
    width: 40%;
    padding: 7px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    display: none;
    position: relative;
    z-index: 101;
}

#start:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#start:active {
    transform: translateY(0);
}
/*
/* Search Dropdown Container */
.search-dropdown {
    margin: 0 auto;
    position: relative;
    width: 100%;
    height: 50px;
    padding: 8px;
    border: 1.5px solid #ccc;
    margin-left: 3px;
    z-index: 3000;
    display: flex;
    flex-direction: row;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Mobile-first responsive width */
.search-dropdown {
    max-height: 100%; /* or set a specific height */
  overflow-y: auto;
  padding-right: 10px; /* space for scrollbar if needed */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */

}

/* Individual result item */
.search-dropdown li {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  padding-left: 20px;
}
.search-dropdown ul::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.search-dropdown li:hover,
.search-dropdown li:focus {
  background-color: #f8f9fa;
}

/* Icon or badge container */
.search-icon,
.search-letter-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.search-icon img {
  width: 20px;
  height: 20px;
  filter: invert(30%) sepia(15%) saturate(500%) hue-rotate(190deg);
}

/* Letter badge style */
.search-letter-badge {
  background-color: #007bff;
  color: white;
  font-size: 16px;
  font-weight: 600;
    height: 27px;
    width: 24px;
}

/* Text wrapper */
.search-text {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 16px;
  color: #333;
  overflow: hidden;
}

/* Result text */
.search-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 83%;
}

/* Direction icon */
.search-arrow {
    width: 30px;
    height: 30px;
  opacity: 0.6;
  flex-shrink: 0;
}

#instructionsText{
    color: #fff;
    padding: 3px;
    height: fit-content;
    margin-left: 20px;
    font-size: 17px;
    font-family: sans-serif;
    font-weight: 800;
    width: 73%;
    padding-top: 10px;
}



/* For touch devices */
@media (hover: none) and (pointer: coarse) {
  .search-dropdown li {
    padding: 14px 16px; /* Larger tap target on mobile */
  }
}

/* Tablet styles (768px and up) */
@media (max-width: 768px) {
    #debugging{
        display: flex;
    }
    #nav {
        margin: 0;
        padding: 0;
        position: absolute;
        height: 100%;
        width: 100%;
        display: block;
    }
    .search-dropdown {
        width: 320px;
    }
    #navContainer {
        padding: 20px 10px;
        max-width: 100vw;
        width: 100%;
        margin-top: 0px;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    
    }
    
    #nav-container {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    #navInputGroup {
        gap: 16px;
    }
    
    #origin, #destination {
        padding: 9px 13px;
        font-size: 16px;
    }
    
    #directions-profile {
        gap: 12px;
        padding: 0px 10px;
        margin: -16px -8px;
    
    #car-group, #bicycle-group, #walking-group {
        padding: 16px;
    }
    
    #start {
        padding: 16px;
        font-size: 18px;
        max-width: 200px;
        margin: 20px auto 0;
    }

    #instructionsText{
        color: #fff;
        padding: 3px;
        height: fit-content;
        margin-left: 20px;
        font-size: 17px;
        font-family: sans-serif;
        font-weight: 800;
        width: 73%;
        padding-top: 10px;
    }


    .navigation-status-bar {
        right: 3vw;
    }
    
    .status-icon, .speed-display {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
    }
    
    #speed {
       font-size: 1.4em;
        margin-top: -2px;
    }
    
    .speed-unit {
        font-size: 0.5em;
        margin-top: -5px;
    }


    #details {
    margin: 0 auto;
    position: absolute;
    z-index: 50;
    top: 25%;
    bottom: 50%;
    left: 0;
    right: 0;
    height: 99px;
    width: 260px;
    color: #000;
    display: block;
    font-size: 40px;
    }
}
#wakeLock,#wakeLockIsNotAvailable{
    position: absolute;
    bottom: 40%;
    height: 30px;
    left: 20%;
    z-index: 45;
}
#event {
    display: block;
    position: absolute;
    bottom: 100%;
    left: 20%;
    z-index: 53;
    height: 30px;

}

    path.leaflet-interactive.animate {
        stroke-dasharray: 1920;
        stroke-dashoffset: 1920;
        animation: dash 20s linear 3s forwards;
    }

    @keyframes dash {
        to {
            stroke-dashoffset: 0;
        }
    }

    ad h2 {
        font-size: 2rem;
    }

    .ad button {
        font-size: 1.2rem;
        padding: 12px 24px;
    }
}

@media only screen and (max-width: 208px){
    #instructions {
        position: absolute;
        width: 84%;
        height: 100%;
        top: 1%;
        left: 17%;
        right: 5%;
        padding: 10px 9px;
        border-radius: 2%;
        text-align: center;
        overflow-y: scroll;
        font-family: sans-serif;
        color: #fff;
        z-index: 40;
        transform: scale(1.1);
        font-size: 23px;
    }
}

@media (max-width: 400px) {
    #travelInfo #exit {
        width: 60px;
        height: 36px;
        position: absolute;
        top: 22%;
        right: 11%;
    }
}

@media (max-width: 400px) {

    #tripInfo {padding: 5px;padding-left: 13px;}
    #travelInfo #exit {
        width: 60px;
        height: 30px;
        position: absolute;
        font-size: 17px;
        top: 17%;
        right: 5%;
    }
    #travelInfo #travelTime, #arr-dis {
        padding-top: 0px;
        color: #fff;
        padding-left: 1px;
        font-size: 18px;
        margin-top: 0px;
    }
    #remdisAndArrTime {padding-left: 0px;}
}
/* Desktop styles (1024px and up) */
@media (min-width: 1024px) {
    #navContainer {
        margin: 30px auto;
        padding: 30px;
        max-width: 800px;
    }
    
    #navInputGroup {
        flex-direction: row;
        gap: 16px;
    }
    
    #org, #dest {
        flex: 1;
    }
    
    #directions-profile {
        gap: 20px;
        padding: 20px;
    }
    
    #start:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
    }
}

/* Large desktop styles (1200px and up) */
@media (min-width: 1200px) {
    #navContainer {
        max-width: 900px;
        padding: 12px;
        margin-left: 30px;
    }
    
    #origin, #destination {
        padding: 6px 12px;
        font-size: 17px;
    }
}
