/* basic layout */
html,body { height:100%; margin:0; font-family:Arial,Helvetica,sans-serif; background:#101010; color:#fff; }
#map { width:100%; height: calc(100% - 56px); }

/* controls bar */
#controls {
  height:56px;
  display:flex;
  gap:8px;
  align-items:center;
  padding:8px;
  background:#161616;
  box-shadow:0 2px 8px rgba(0,0,0,0.5);
  z-index:1000;
}
#search {
  flex:1;
  padding:8px 12px;
  border-radius:6px;
  border:none;
  background:#222;
  color:#fff;
  outline:none;
}
#randomize {
  padding:8px 14px;
  border-radius:6px;
  border:none;
  background:#2c82f8;
  color:#fff;
  cursor:pointer;
}
#randomize:hover { background:#176de0; }

/* dropdown */
.dropdown-search {
  position:absolute;
  top:64px;
  left:12px;
  width:260px;
  max-height:240px;
  overflow:auto;
  background:#222;
  border-radius:8px;
  box-shadow:0 6px 18px rgba(0,0,0,0.6);
  display:none;
  z-index:2000;
}
.dropdown-search div { padding:8px 10px; color:#fff; cursor:pointer; }
.dropdown-search div:hover { background:#333 }

/* popup card (dark interior with white border) */
.leaflet-popup-content-wrapper {
  background:#1e1e1e;
  border-radius:12px;
  padding:10px;
  border:3px solid #fff; /* white border around popup */
  max-width: 620px;
  color:#fff;
}
.leaflet-popup-tip { background:#1e1e1e; border-top:3px solid #fff; }

/* make popup text white */
.leaflet-popup-content { color:#fff; margin:0 !important; text-align:center; }

/* popup image bigger but responsive */
.popup-image {
  display:block;
  width:300px;
  max-width:600px;    /* absolute cap */
  max-height:70vh;    /* don't overflow viewport vertically */
  height:auto;
  border-radius:10px;
  margin:8px auto 0;
  object-fit:contain;
  box-shadow:0 6px 20px rgba(0,0,0,0.6);
  border:2px solid rgba(255,255,255,0.85);
}

/* small-screen tweaks */
@media (max-width:600px) {
  .popup-image { max-width:92vw; max-height:50vh; }
  .leaflet-popup-content-wrapper { max-width:92vw; }
  #search { font-size:14px; }
  #randomize{ padding:7px 10px; }
}
