:root { --left-width: 75%; --right-width: 25%; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'AmericanGrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden; background: #000; color: #111;
}

/* Horizontal split by default */
.container.split { position: fixed; inset: 0; display: flex; flex-direction: row; }
#map-container { width: var(--left-width); height: 100%; position: relative; }
#pano-container { width: var(--right-width); height: 100%; position: relative; overflow: hidden; background: #000; }
#map, gmp-map-3d, #pano { width: 100%; height: 100%; display: block; }

/* Toggle 2D/3D visibility */
#map-container:not(.view-3d) gmp-map-3d { display: none; }
#map-container.view-3d #map { display: none; }

/* Hide pano panel when requested */
.split.pano-hidden #pano-container { width: 0; }
.split.pano-hidden #map-container { width: 100%; }

/* Controls: single vertical column on right */
/* Controls: single vertical column on right side */
.controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 50;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Button base styling */
.control-btn {
  background: #fff;
  color: #003478;
  border: 2px solid #003478;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  text-align: right; /* Default right alignment */
}

/* Hover effect */
.control-btn:hover {
  background: #003478;
  color: #fff;
}

/* Center-align Reset View button text */
.control-btn--center {
  text-align: center;
}

/* POI Popup Navigation */
.poi-popup-nav {
  margin-top: 15px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.poi-popup-nav button {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #007bff;
}

.poi-popup-nav button:hover {
  text-decoration: underline;
}

/* Pano placeholder */
.placeholder {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; color: #fff; z-index: 10; pointer-events: none; width: 100%; padding: 20px;
}
.placeholder h1 { font-size: 36px; font-weight: 800; margin-bottom: 10px; letter-spacing: 1px; }
.placeholder p  { font-size: 16px; opacity: .9; }

/* POI info window styling */
.gm-style-iw-d { overflow: visible !important; max-width: none !important; }
.gm-style-iw-c {
  padding: 0 !important; border-radius: 12px !important; background-color: transparent !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.3) !important; max-width: none !important; overflow: visible !important;
}
.gm-style-iw-t::after { display: none !important; }

/* Hide the default InfoWindow close button */
.gm-ui-hover-effect { display: none !important; }

/* POI popup */
.poi-popup {
  width: 405px; background: #fff; color: #333; border-radius: 12px; overflow: hidden;
  animation: popupFadeIn .2s ease-out;
}

@keyframes popupFadeIn { from { opacity: 0; transform: scale(.95);} to { opacity: 1; transform: scale(1);} }
.poi-popup-img { width: 100%; height: 275px; object-fit: cover; display: block; }
.poi-popup-content { padding: 20px; }
.poi-popup-name {
  font-size: 13px; font-weight: 700; color: #066FEF; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 8px 0;
}
.poi-popup h3 { font-size: 20px; font-weight: 700; margin: 0 0 10px 0; color: #000; line-height: 1.3; }
.poi-popup p  { font-size: 16px; color: #666; line-height: 1.6; margin: 0; }

/* Unified close button for 2D/3D popups */
.poi-popup-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
  z-index: 10;
}

.poi-popup-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* 3D popup tail (small diamond below the card) */
.poi-popup--3d .poi-popup-tail {
  position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg); background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* === Street View Legend === */
.sv-legend {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 12px;
  color: #222;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.2) blur(2px);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 6px 8px;
  margin: 8px;
  user-select: none;
  z-index: 10;
}

.sv-legend__inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sv-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.sv-dot {
  width: 14px;
  height: 14px;
  display: inline-block;
  border-radius: 50%;
  background: var(--fill);
  border: 2px solid var(--stroke);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* 3D legend overlay position (upper-left) */
.sv-legend--overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 9999;      /* above canvas and popups */
  pointer-events: auto;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .sv-legend {
    color: #eee;
    background: rgba(24, 24, 24, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* Responsive: stack vertically on small screens */
@media (max-width: 900px) {
  :root { --left-width: 100%; --right-width: 100%; }
  .container.split { flex-direction: column; }
  #map-container { width: 100%; height: 60%; }
  #pano-container { width: 100%; height: 40%; }
  .split.pano-hidden #pano-container { height: 0; }
}