* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Full-screen dark layout */
html, body {
  height: 100vh;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  background-color: #000000;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

/* Header bar at top */
.map-header {
  background-color: #000000;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  z-index: 1000;
}

.map-header h1 {
  font-size: 1.3rem;
  font-weight: bold;
}

/* Filters / controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 30px;
}

.filters {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.induction { background-color: #4285F4; }
.dot.auracast  { background-color: #E91E63; }
.dot.quiet     { background-color: #34A853; }

.back-link {
  color: #ff4444;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
}

/* Map takes full remaining height under header */
#map {
  width: 100%;
  flex: 1;
}

/* --- Google Maps InfoWindow Dark Overrides --- */
.gm-style-iw-c {
  background-color: #202124 !important;
  max-width: 320px !important;
  width: 320px !important;
  padding: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
}

.gm-style-iw-d {
  overflow: hidden !important;
  padding: 0 !important;
  max-height: none !important;
}

.gm-style-iw-tc::after {
  background: #202124 !important;
}

.gm-ui-hover-effect {
  filter: invert(1) !important;
  top: 10px !important;
  right: 10px !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  border-radius: 50% !important;
  padding: 4px !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* --- Custom Dark Popup Card --- */
.dark-popup {
  background-color: #202124;
  color: #ffffff;
  /* Less top padding so title is closer to the X */
  padding: 12px 16px 16px;
  width: 100%;
  font-family: inherit;
}

.dark-popup h3 {
  margin: 0 0 6px 0;
  font-size: 1.5rem; /* Larger venue titles */
  font-weight: 700;
  padding-right: 32px; /* Space for the close button */
}

.dark-popup p.rating {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: #bdc1c6;
  line-height: 1.4;
}

/* Buttons row */
.popup-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.popup-btn {
  background-color: #3c4043;
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  cursor: pointer;
  flex: 1;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.popup-btn:hover {
  background-color: #5f6368;
}

/* Photo grid: hero + thumbnails, Gemini-style */
.photo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 70px 70px;
  gap: 4px;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #333;
}

.photo-main {
  grid-row: 1 / span 2;
}

/* Open in Google Maps button */
.open-map-btn {
  display: block;
  width: 100%;
  background-color: #1a73e8;
  color: #ffffff;
  text-align: center;
  padding: 10px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.open-map-btn:hover {
  background-color: #1557b0;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
  .map-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
  }

  .header-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
  }

  .filters {
    flex-wrap: wrap;
    gap: 12px;
  }

  .gm-style-iw-c {
    max-width: 90vw !important;
    width: 90vw !important;
  }
}