html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, sans-serif;
  background: #eef3f7;
}

#map {
  width: 100%;
  height: 100%;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 400px;
  max-height: calc(100vh - 20px);
  /* overflow: hidden; */
  z-index: 1100; /* Ensure sidebar is above map but below popups */
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  padding: 10px 0px 0px 20px;
  display: none; /* Hidden by default, shown in fullscreen */
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.sidebar-subtitle {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 5px;
}

.fullscreen-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  font-size: 18px;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
  opacity: 0.5;
}

.minimize-btn {
  position: absolute;
  top: 20px;
  right: 70px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  font-size: 18px;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
  opacity: 0.5;
}

.maximized {
  display: block;
  pointer-events: auto;
  transform: translateY(0);
}

.visible {
  display: block;
}

.map-controls {
  position: absolute;
  top: 0px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 1100;
}

.map-controls .icon-btn {
  background: rgba(0, 0, 0, 0.05);
}

.map-controls .icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.zoom-controls {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
}

.zoom-controls .icon-btn {
  background: rgba(0, 0, 0, 0.05);
}

.zoom-controls .icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
  .minimize-btn {
    top: 10px;
    display: none; /* Hide minimize button on mobile until displayed in fullscreen mode via JS */
  }

  .fullscreen-btn {
    top: 10px;
    right: 0px;
  }

  .map-controls {
    top: 10px;
    right: 10px;
  }

  .btn {
    padding: 12px;
    font-size: 14px;
  }

  .sidebar {
    max-height: calc(100vh - 5px);
    width: calc(100vw - 32px);
    right: 5px;
    bottom: 10px;
  }

  .location-list {
    max-height: 500px !important; /* Reduce max height for mobile */
  }

  /* 
  .leaflet-popup-content-wrapper {
    border: 1px solid blue;
  }

  a.leaflet-popup-close-button {
    outline: 1px solid blue;
  } */

  .panel {
    width: calc(100vw - 100px);
    /* left: 30px; */
  }
}

/* =========================
   ICON BUTTONS
========================= */

.icon-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  font-size: 18px;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.08);
}

/* =========================
   FIND ME
========================= */

.find-me-card {
  /* margin: 14px; */
  margin-top: 5px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  border-radius: 22px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease;
}

.find-me-card:hover {
  transform: translateY(-2px);
}

.find-me-emoji {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 18px;
  background: white;
}

.find-me-title {
  font-weight: 600;
  color: #111;
}

.find-me-subtitle {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 4px;
}

/* =========================
   LOCATIONS
========================= */

.location-list {
  padding: 14px;
  display: none; /* Hidden by default, shown in fullscreen */
  overflow-y: auto; /* support scrolling */
  max-height: 150px; /* Limit height for scrolling */
}

/* 
Where we are:
1. TV - perfect, allows scrolling to bottom.
2. Mobile - perfect, allows scrolling to bottom.
3. Desktop - Not showing enough of the list.
Desktop sizes:
- 1920x1080: shows 3 items, needs to show 4.
- 1440x900: shows 3 items, needs to show 4.
- 1366x768: shows 3 items, needs to show 4.
- 745x360: shows 3 items, needs to show 4.

 Warning: A specific media query will be required if you wish to display more results on a laptop or desktop computer screen.
 These sizes are optimized for mobile and tv.
*/

/* custom scroller */
.location-list::-webkit-scrollbar {
  width: 8px;
}

.location-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.location-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

.location-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.location-list.show {
  display: block;
}

.location-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 22px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.location-item:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.03);
}

.location-emoji {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 18px;
  background: white;
  flex-shrink: 0;
}

.location-name {
  font-weight: 600;
  color: #111;
  margin-bottom: 6px;
}

.location-description {
  color: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.location-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.05);
}

.distance {
  color: #2563eb;
}

/* =========================
   USER PANEL
========================= */

.panel {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 300px;
  padding: 18px;
  border-radius: 28px;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.hidden {
  opacity: 0;
  display: none;
  pointer-events: none;
  transform: translateY(10px);
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.title-row {
  display: flex;
  gap: 12px;
}

.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.04);
}

.title {
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.subtitle {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 4px;
}

.coords {
  margin: 18px 0;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.75);
}

/* =========================
   BUTTONS
========================= */

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
}

.btn-primary {
  background: #111;
  color: white;
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
}

/* =========================
   MAP MARKERS
========================= */

.poi-marker {
  width: 52px;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* =========================
   POPUPS
========================= */

.leaflet-popup-content-wrapper {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

a.leaflet-popup-close-button {
  padding: 10px; /* Increase clickable area */
}

/* =========================
   LEAFLET
========================= */

.leaflet-control-attribution,
.leaflet-control-zoom {
  display: none;
}

/* SEARCH */

.search-input {
  width: 90%;
  margin-top: 22px;
  padding: 14px;
  border: none;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 14px;
  display: none; /* Hidden by default, shown in fullscreen */
}

.search-input.show {
  display: block;
}

/* FILTERS */

.filters {
  display: none; /* Hidden by default, shown in fullscreen */
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 14px;
}

.filters.show {
  display: flex;
}

.filter-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.filter-btn.active {
  background: #111;
  color: white;
}
