/* =============================================================================
   MALINSKA MAP — styles
   ----------------------------------------------------------------------------
   Custom Leaflet styling that matches the Malinska theme. Pins are CSS-shape
   teardrops in coral / teal / gray depending on category; popups are clean
   white cards with photo, title, meta, and a View link.
   ========================================================================= */


/* Map root container */
.mamap-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 340px;
}

.mamap-root .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: #e8ebed;
}

/* Loading state */
.mamap-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c8e0d8 0%, #d8e8d4 30%, #c8d8e8 70%, #b8c8d8 100%);
  color: #1A1F2E;
  font-size: 14px;
  z-index: 10;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.mamap-root.is-ready .mamap-loading {
  opacity: 0;
  pointer-events: none;
}


/* =============================================================================
   PINS
   ----------------------------------------------------------------------------
   Pure CSS teardrop markers. Color encodes category bucket:
     - coral:  food & drink (restaurant, bar, cafe, beach_bar, ice_cream_shop, bakery)
     - teal:   places to stay & swim (accommodation, beach)
     - amber:  events
     - gray:   permanently closed / fallback
   ========================================================================= */

.mamap-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  background: #888;
  position: relative;
  display: block;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.mamap-pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mamap-pin--food   { background: #D85A30; }        /* coral */
.mamap-pin--stay   { background: #0D6E6E; }        /* teal */
.mamap-pin--event  { background: #BA7517; }        /* amber */
.mamap-pin--closed { background: #888780; opacity: 0.7; }

.mamap-pin--highlighted {
  transform: rotate(-45deg) scale(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 1000;
}

.mamap-pin-wrap:hover .mamap-pin {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}


/* =============================================================================
   POPUPS
   ----------------------------------------------------------------------------
   Clean white card matching the place-card pattern from the theme.
   ========================================================================= */

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(26, 31, 46, 0.18);
}
.leaflet-popup-content {
  margin: 0;
  width: 240px !important;
  font-family: inherit;
}
.leaflet-popup-tip {
  background: #fff;
}
.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  color: #1A1F2E !important;
  background: rgba(255,255,255,0.9) !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  line-height: 20px !important;
  font-size: 16px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mamap-popup__media {
  height: 110px;
  background: #f1ece3;
  background-size: cover;
  background-position: center;
}
.mamap-popup__body {
  padding: 12px 14px;
}
.mamap-popup__title {
  font-size: 14px;
  font-weight: 500;
  color: #1A1F2E;
  margin: 0 0 3px;
  line-height: 1.3;
}
.mamap-popup__meta {
  font-size: 11px;
  color: #6B6F76;
  margin: 0 0 8px;
}
.mamap-popup__row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.mamap-popup__pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.mamap-popup__pill--success {
  background: #E1F5EE;
  color: #085041;
}
.mamap-popup__pill--danger {
  background: #FAECE7;
  color: #993C1D;
}
.mamap-popup__pill--event {
  background: #FAEEDA;
  color: #854F0B;
}
.mamap-popup__link {
  font-size: 11px;
  color: #0D6E6E;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.mamap-popup__link:hover { color: #085041; }


/* =============================================================================
   CLUSTERS
   ----------------------------------------------------------------------------
   Override Leaflet.markercluster default purple bubbles to match brand.
   ========================================================================= */

.marker-cluster {
  background: rgba(13, 110, 110, 0.15) !important;
}
.marker-cluster div {
  background: #0D6E6E !important;
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.marker-cluster-small div { background: #0D6E6E !important; }
.marker-cluster-medium div { background: #085041 !important; }
.marker-cluster-large div { background: #04342C !important; }


/* =============================================================================
   ATTRIBUTION
   ========================================================================= */

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.85) !important;
  font-size: 10px !important;
  color: #6B6F76 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  margin: 8px !important;
}
.leaflet-control-attribution a { color: #0D6E6E !important; }


/* =============================================================================
   ZOOM CONTROLS
   ========================================================================= */

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  border-radius: 8px !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  background: #fff !important;
  color: #1A1F2E !important;
  border: 0 !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 18px !important;
}
.leaflet-control-zoom a:first-child { border-bottom: 0.5px solid rgba(0,0,0,0.1) !important; }
.leaflet-control-zoom a:hover { background: #FAF7F2 !important; }


/* =============================================================================
   EMPTY STATE OVERLAY
   ========================================================================= */

.mamap-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: #1A1F2E;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 500;
  pointer-events: none;
}
