/* ===== Base / Global ===== */
html, body {
  height: 100%;
  margin: 0;
  background: #CEAD2C;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; /* smaller base */
}

/* Force font everywhere */
* { font-family: 'JetBrains Mono', monospace !important; }

#map {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 1;
}

#loader {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}

.spinner {
  border: 4px solid #f3f3f3; border-top: 4px solid #2563eb;
  border-radius: 50%; width: 28px; height: 28px;
  animation: spin 1s linear infinite;
}
@keyframes spin { 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} }

/* ===== Sidebar wrapper ===== */
.sidebar-wrapper {
  position: absolute;
  top: 12px; bottom: 15px; right: 12px;
  left: calc(((100% - 40px) / 4) * 2 + 28px);
  width: calc(((100% - 40px) / 4) * 2);
  z-index: 1500;
}

.places-control {
  height: 100%; width: 100%;
  display: grid; grid-template-rows: 1fr auto;
  background: #000; color: #fff;
  box-shadow: -2px 0 6px rgba(0,0,0,0.2);
  font-size: 14px; font-weight: 500; line-height: 20px;
  overflow: hidden;
}

#placesList {
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px 10px; overflow-y: auto; margin-top: 18px;
}

/* WEB (desktop/default) specs:
   - checkbox: 22.5 x 22.5
   - places font size: 20px (medium)
*/
.places-control label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 20px; font-weight: 500; line-height: 26px;
  padding: 3px 5px; border-radius: 4px;
}

.places-control input[type="checkbox"] {
  appearance: none; width: 22.5px; height: 22.5px; flex-shrink: 0;
  border: 2px solid #fff; background: #000; margin-right: 6px; position: relative;
}
.places-control input[type="checkbox"]:checked { background: #fff; border-color: #fff; }
.places-control input[type="checkbox"]:checked::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 6px; height: 12px; transform: translate(-50%,-55%) rotate(45deg);
  border: solid #000; border-width: 0 3px 3px 0;
}

/* ===== Footer default ===== */
.panel-footer {
  background: #000; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-sizing: border-box; padding: 12px;
  min-height: 70px;
  border-top: 1px dashed #fff;
  transition: all 0.35s ease-in-out;
}

/* WEB: compute route font size 18px (medium) */
#computeBtn {
  background: #509277; color: #fff;
  font-weight: 500; font-size: 18px; text-transform: uppercase;
  height: 36px; line-height: 36px;
  border: none; border-radius: 20px; cursor: pointer;
  width: 100%; padding: 0;
  transition: background .3s ease-in-out;
}
#computeBtn:hover { background: #458068; }
#computeBtn:disabled { background: #999; cursor: not-allowed; }

/* Hidden initially */
.footer-links { display: none; opacity: 0; transition: opacity .35s ease-in-out; }

/* ===== Footer after compute ===== */
.panel-footer.computed {
  display: grid;
  gap: clamp(10px, 3vw, 30px);
  align-items: stretch; /* let items fill their columns */
  width: 100%;
  padding: 12px;
  min-height: 90px;
}

/* Equal halves on desktop */
@media (min-width: 901px) {
  .panel-footer.computed { grid-template-columns: 1fr 1fr; }
}

.panel-footer.computed #computeBtn {
  height: 36px !important; line-height: 36px !important; font-size: 18px !important;
  border-radius: 20px;
  width: 100%;
  justify-self: stretch;
  box-sizing: border-box;
}

.panel-footer.computed .footer-links {
  display: flex; flex-direction: column; gap: 16px;
  align-items: flex-start; justify-content: flex-start;
  max-width: none; /* allow full 50% column */
  opacity: 1;
}

/* Links: font + underline + icon spacing */
.panel-footer.computed .footer-links a {
  color: #fff; font-size: 20px; font-weight: 500; text-transform: uppercase;
  display: inline-flex; align-items: center;
  gap: 16px;                /* text–icon gap */
  line-height: 1.3; text-decoration: none;
}
.panel-footer.computed .footer-links a span {
  display: inline-block;
  border-bottom: 1px solid #fff; /* underline closer to text */
  padding-bottom: 0;
  line-height: 1.05;
}
.panel-footer.computed .footer-links a:hover span { border-bottom-color: #00BFFF; }

/* Icons fixed 20x20 */
.panel-footer.computed .footer-links a[id="gmapLink"]::after,
.panel-footer.computed .footer-links a[id="copyLink"]::after {
  content: ""; width: 20px; height: 20px;
  background-size: contain; background-repeat: no-repeat; display: inline-block;
}
.panel-footer.computed .footer-links a[id="gmapLink"]::after { background-image: url('Arrow.svg'); }
.panel-footer.computed .footer-links a[id="copyLink"]::after { background-image: url('Vector.svg'); }

/* ===== Responsive gaps ===== */
@media (max-width: 1200px) { .panel-footer.computed { gap: clamp(8px, 3vw, 20px); } }
@media (max-width: 800px)  { .panel-footer.computed { gap: clamp(6px, 3vw, 14px); } }

/* ===== STACKED (≤900px): center-aligned ===== */
@media (max-width: 900px) {
  .panel-footer.computed { --stack-max: 340px; }
  .panel-footer.computed {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    text-align: center !important;
  }
  .panel-footer.computed #computeBtn,
  .panel-footer.computed .footer-links {
    width: 100%; max-width: var(--stack-max); margin-inline: auto;
  }
  .panel-footer.computed .footer-links {
    align-items: center !important; justify-content: center !important;
  }
}

/* ===== Tiny mobile bottom-sheet: ≤600px =====
   - checkbox: 18 x 18
   - places font size: 16px (medium)
   - compute route font size: 14px (medium)
   - link font size: 16px (medium)
   - icons: 20 x 20
*/
@media (max-width: 600px) {
  .sidebar-wrapper {
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: 45vh; margin: 0;
  }

  .places-control { grid-template-rows: 1fr auto; font-size: 13px; }
  .places-control label { font-size: 16px; font-weight: 500; line-height: 22px; }
  .places-control input[type="checkbox"] { width: 18px; height: 18px; }

  .panel-footer { min-height: 60px !important; }
  .panel-footer.computed { --stack-max: 280px; }

  /* compute route text */
  #computeBtn,
  .panel-footer.computed #computeBtn { font-size: 14px !important; }

  /* link text + keep 16px gap on mobile */
  .panel-footer.computed .footer-links a { font-size: 16px; gap: 16px; }
}

/* ===== Safety: avoid overflow on long link text ===== */
.panel-footer.computed .footer-links { min-width: 0; }
.panel-footer.computed .footer-links a span { overflow-wrap: anywhere; }

/* ===== Debug Overlay Grid ===== */
.debug-grid {
  pointer-events: none; position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; z-index: 9999;
}
.debug-grid div { background: rgba(128,0,128,0.4); }

/* Ahmedabad only — bilingual city label (Google Maps locality style) */
.map-city-label {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  line-height: 1.02;
  z-index: 2;
}

.map-city-label__en,
.map-city-label__gu {
  font-family: Roboto, Arial, sans-serif !important;
  font-weight: 700;
  color: rgba(30, 30, 30, 0.92);
  paint-order: stroke fill;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.map-city-label__gu {
  margin-top: 0.08em;
}

/* Venue name labels (collision-aware overlay layer) */
.venue-labels-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1000000;
}

.venue-marker-label,
.venue-label-overlay {
  position: absolute;
  color: #000;
  white-space: nowrap;
  line-height: 1.2;
  transition: transform 0.15s ease, font-size 0.15s ease;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 4px #fff;
}

.venue-label-overlay--hover {
  transform: scale(1.12);
  transform-origin: center top;
  z-index: 1000001;
}

/* Hide Google UI controls */
.gm-style .gm-control-active { display: none !important; }
.gm-style-cc { right: 12px !important; }
.gm-style, .gm-style div, .gm-style span, .gm-style label { font-family: 'JetBrains Mono', monospace !important; }
