/* Leaflet geographic map styling */

/* Container + inner map, compatible with the Ukraine header style */
.geo-map-container{
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.geo-map-leaflet{
  width: 100%;
  height: calc(100% - 64px);
  min-height: 520px;
}

/* Legend (Leaflet control) */
.geo-map-legend{
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  font-size: 12px;
  line-height: 1.25;
}

.geo-map-legend-title{
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 13px;
}

.geo-map-legend-section{ margin: 0 0 10px 0; }
.geo-map-legend-section:last-child{ margin-bottom: 0; }

.geo-map-legend-sub{
  font-weight: 700;
  opacity: 0.75;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.geo-map-legend-items{
  display:flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items:center;
}

.geo-map-legend-row{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  white-space: nowrap;
}

.geo-map-legend-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.18);
  display:inline-block;
}

.geo-map-legend-size{ display:inline-block; border-radius:50%; border: 1px solid rgba(0,0,0,0.18); background: rgba(0,0,0,0.06); }
.geo-map-legend-size.s1{ width:10px; height:10px; }
.geo-map-legend-size.s2{ width:14px; height:14px; }
.geo-map-legend-size.s3{ width:18px; height:18px; }

.geo-map-legend-shape{ display:inline-block; width: 12px; height: 12px; background: rgba(0,0,0,0.25); border-radius: 0; }
.geo-map-legend-shape.circle{ border-radius:50%; }
.geo-map-legend-shape.square{}
.geo-map-legend-shape.triangle{ clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.geo-map-legend-shape.diamond{ transform: rotate(45deg); }
.geo-map-legend-shape.star{
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Custom marker styling */
.custom-marker {
  background: transparent;
  border: none;
}

.custom-marker svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Popup styling */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
  min-width: 250px;
}

.geo-popup {
  padding: 12px;
}

.geo-popup h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

.geo-popup .popup-meta {
  margin: 0 0 8px 0;
  font-size: 12px;
  line-height: 1.6;
  color: #4b5563;
}

.geo-popup .popup-meta strong {
  font-weight: 600;
  color: #374151;
}

.geo-popup .popup-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
}

.geo-popup .popup-sources a {
  color: #2563eb;
  text-decoration: none;
  word-break: break-word;
}

.geo-popup .popup-sources a:hover {
  text-decoration: underline;
}

/* Map tiles styling */
.map-tiles {
  filter: grayscale(10%) brightness(1.05);
}

/* Attribution styling */
.leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.8);
}



/* Dark theme legend styling (home map & others) */
body.theme-dark .geo-map-legend,
html[data-theme="dark"] .geo-map-legend{
  background: rgba(17,24,39,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
}

body.theme-dark .geo-map-legend-title,
html[data-theme="dark"] .geo-map-legend-title{
  color: #fff;
}

body.theme-dark .geo-map-legend-sub,
html[data-theme="dark"] .geo-map-legend-sub{
  color: rgba(255,255,255,0.70);
}

body.theme-dark .geo-map-legend-size,
html[data-theme="dark"] .geo-map-legend-size{
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
}

body.theme-dark .geo-map-legend-dot,
html[data-theme="dark"] .geo-map-legend-dot{
  border: 1px solid rgba(255,255,255,0.18);
}

body.theme-dark .geo-map-legend-shape,
html[data-theme="dark"] .geo-map-legend-shape{
  background: rgba(255,255,255,0.35);
}
