/* JMaps — Map Styles */

html, body.map-page {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-navbar {
  height: 56px;
  z-index: 1001;
  flex-shrink: 0;
}

#map-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100vh - 56px);
}

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

/* Nearby People Panel / Floating Drawer */
.nearby-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 320px;
  max-height: calc(100vh - 160px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nearby-panel.panel-hidden {
  transform: translateX(360px);
  opacity: 0;
  pointer-events: none;
}

.nearby-panel-header {
  flex-shrink: 0;
}

.nearby-panel-body {
  overflow-y: auto;
  flex: 1;
  max-height: 380px;
}

.nearby-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nearby-user-card:hover {
  background-color: rgba(13, 110, 253, 0.08);
}

.nearby-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #e9ecef;
}

.nearby-user-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0d6efd;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nearby-user-info {
  flex: 1;
  min-width: 0;
}

.nearby-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-user-distance {
  font-size: 12px;
  color: #6c757d;
}

/* Floating Controls */
.map-floating-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 680px;
  background-color: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.floating-alert {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 500px;
}

/* Custom Marker: Current User */
.current-user-marker {
  position: relative;
  width: 28px;
  height: 28px;
}

.current-user-pulse {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.3);
  animation: marker-pulse 2s infinite ease-out;
}

.current-user-dot {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0d6efd;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

@keyframes marker-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Custom Marker: Other Users */
.user-marker-avatar-container {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  background-color: #6c757d;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease;
}

.user-marker-avatar-container:hover {
  transform: scale(1.1);
}

.user-marker-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-marker-initials {
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
}

.user-marker-online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #198754;
  border: 2px solid #ffffff;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  padding: 4px !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  font-family: inherit !important;
}

.user-popup-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-popup-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #e9ecef;
}

.user-popup-initials {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #0d6efd;
  color: #ffffff;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-popup-info {
  line-height: 1.3;
}

.user-popup-name {
  font-size: 15px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 2px;
}

.user-popup-status {
  font-size: 12px;
  font-weight: 500;
  color: #198754;
  margin-bottom: 2px;
}

.user-popup-distance {
  font-size: 12px;
  color: #6c757d;
}

@media (max-width: 576px) {
  .nearby-panel {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 200px);
  }
  .nearby-panel.panel-hidden {
    transform: translateY(-120%);
  }
  .map-floating-controls {
    bottom: 16px;
    width: 94%;
    padding: 12px !important;
  }
}
