/* Custom Leaflet Map Dark/Light styles & shadcn refinements */

.leaflet-container {
  background-color: #020617 !important; /* slate-950 */
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
}

html:not(.dark) .leaflet-container {
  background-color: #f8fafc !important; /* slate-50 */
}

/* Custom Marker Styling */
.player-marker-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player-avatar-box {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 2px solid #2563eb;
  background-color: #0f172a;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.player-marker-container:hover .player-avatar-box {
  transform: scale(1.15);
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.player-label {
  margin-top: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  background-color: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html:not(.dark) .player-label {
  background-color: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Custom Leaflet Popup Overrides (shadcn Card style) */
.leaflet-popup-content-wrapper {
  background-color: #0f172a !important; /* slate-900 */
  color: #f8fafc !important;
  border: 1px solid #1e293b !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  padding: 0 !important;
}

html:not(.dark) .leaflet-popup-content-wrapper {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
}

.leaflet-popup-tip {
  background-color: #0f172a !important;
}

html:not(.dark) .leaflet-popup-tip {
  background-color: #ffffff !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  line-height: 1.4 !important;
  font-size: 12px !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}
