/* ================= Map ================= */
#map {
  height: calc(100vh); /* full viewport minus panel height */
  width: calc(100vw);
  position: relative;
  z-index: 1;
}


.panel-top-bar {
  background-color: white;
  height: 20px;
  width: 100%;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001; /* above panel */
}

/* Show only on mobile */
@media screen and (max-width: 768px) {
  .panel-top-bar {
    display: block;
  }
}


/* ================= Top-middle Search Bar ================= */
#pac-card {
  position: absolute;
  top: 5px;                  /* tucked closer to the top */
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: #fff;
  padding: 5px 8px;          /* tighter padding */
  border-radius: 12px;       /* modern pill-style */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 5px;                  /* space between input and dropdown */
  min-width: 200px;
  max-width: 320px;
  width: 90%;
  box-sizing: border-box;
  font-family: 'Quicksand', sans-serif;
}

@media screen and (max-width: 768px) {
  #pac-card {
    position: absolute !important;  /* force top-middle */
    top: 5px !important;            /* tuck closer to top */
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 85% !important;
    max-width: 280px;
    padding: 4px 6px;
    border-radius: 10px;
    margin: 0 !important;           /* remove conflicting margins */
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  }

  #pac-input {
    width: 100%;
    height: 32px;
    font-size: 13px;
    padding: 4px 8px;
  }

  #dropdwn1 {
    width: 100%;
    font-size: 13px;
  }

  #dropdwn1 select {
    width: 100%;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 6px;
  }
}
/* Input field inside search card */
#pac-input {
  width: 100%;
  height: 36px;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
  box-sizing: border-box;
}

#pac-input:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74,144,226,0.5);
}

/* Dropdown container */
#dropdwn1 {
  width: 50%;
  font-size: 14px;
}

#dropdwn1 select {
  width: 100%;
  padding: 5px 10px;
  font-size: 14px;
  border-radius: 8px;         /* matches input pill style */
  border: 1px solid #ccc;
  box-sizing: border-box;
  background-color: #fff;
  appearance: none;            /* remove default arrow on some browsers */
  cursor: pointer;
}

/* Dropdown arrow tweak */
#dropdwn1 select::-ms-expand { display: none; }  /* IE */
#dropdwn1 select::after { content: '▼'; }        /* optional custom arrow */

/* ================= Mobile adjustments ================= */
@media screen and (max-width: 768px) {
  #pac-card {
    top: 5px;
    min-width: 180px;
    max-width: 90%;
  }

  #pac-input, #dropdwn1 select {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* ==========================
   Responsive Media Queries
========================== */

/* Tablet & smaller */
@media screen and (max-width: 992px) {
    #pac-card {
        margin-left: 55vw;
        margin-bottom: 68vh;   /* push higher on mobile */
        width: 70vw;
        display: block;
        position: static;
        background-color: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.3);
        border-radius: 15px;
        margin-top: 50px;
        font-size: 10px;
    }
    #pac-input {
        width: 70vw;
        height: 45px;
        font-size: 10px;
    }
    #title { font-size: 13px; }
}


@media screen and (min-width: 769px) {
    #title {
        font-size: 15px;
        font-weight: 600;
    }
}


#pac-input {
  width: 300px;
  height: 40px;
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  outline: none;
}

#pac-input:focus {
  border-color: #4a90e2;
}

/* ================= Bottom Panel ================= */
#panel {
  display: flex;
  flex-direction: column !important;
  gap: 3px !important;   /* force the gap */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 250px; /* panel height */
  background: linear-gradient(to bottom, #ffffff 0%, #e0e7ff 100%); /* gradient from white to light blue */
  box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
  overflow-y: auto; /* scrollable */
  z-index: 10000;
  padding: 10px;
}

/* Panel item pills */
.panelcontainer {
  display: flex;
  align-items: center;
  gap: 12px;               /* space between image and text */
  padding: 12px 16px;
  border-radius: 16px;      /* pill shape */
  background-color: #f0f4ff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border: 1px solid rgba(79, 96, 255, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  width: 100%;              /* full width of panel */
  box-sizing: border-box;   /* include padding in width */
}

.panelcontainer:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border-color: rgba(79, 96, 255, 0.4);
}

.panelcontainer.active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border-color: rgba(79, 96, 255, 1);
}


/* Image inside pill */
.imgListnew {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Info inside pill */
.paneldiv2 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #1f2937;
  flex-grow: 1;
  overflow: hidden;
}

.nameonlistnew {
  font-weight: 500;
  font-size: 0.95em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listtypeanddistance {
  color: #4b5563;
  font-size: 0.7em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= Toggle Button ================= */
/* Panel toggle button base style */
#togglePanelBtn {
  position: absolute;      /* position relative to panel */
  top: 75px;               /* distance from top of panel */
  right: 10px;             /* distance from right edge of panel */
  padding: 6px 10px;
  background: #4f60ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  z-index: 10003;          /* above panel content */
}

/* Mobile: move to top-left of panel */
@media screen and (max-width: 768px) {
  #togglePanelBtn {
    top: 15px;
    left: 240px;
    right: auto;           /* remove right */
  }
}


/* ================= Responsive ================= */
@media screen and (max-width: 768px) {
  #pac-input { width: 250px; font-size: 1.2em;}
  #panel { max-height: 250px; padding: 5px;}
  #map { height: calc(100vh); } /* adjust for smaller panel */

  .panelcontainer {
    padding: 8px 12px;
    gap: 8px;
  }

  .imgListnew {
    width: 40px;
    height: 40px;
  }

  .nameonlistnew { font-size: 0.9em; }
  .listtypeanddistance { font-size: 0.6em; }
}



/* Desktop landscape: move panel to left side */
@media screen and (min-width: 768px) {
  #panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 18vw;           /* adjust width as needed */
    height: 100vh;          /* full height */
    max-height: none;       /* remove bottom panel limit */
    overflow-y: auto;       /* keep scrollable */
    box-shadow: 2px 0 12px rgba(0,0,0,0.25);
    background: linear-gradient(to bottom, #ffffff 0%, #e0e7ff 100%);
    padding: 20px;
    flex-direction: column;
    gap: 3px; !important
    z-index: 10000;
    border-radius: 0 12px 12px 0; /* rounded right corners */
  }

  /* Adjust map to not go under panel */
  #map {
    height: calc(100vh)
  }
}