/* Map container */
.mgm-map-container {
  width: 100%;
  max-width: 100%;
  margin: auto;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

/* SVG style */
.mgm-map-container svg {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
  transform-origin: center center;
}

/* Default country fill (no data) */
.mgm-map-container svg path {
  fill: #a5b4d6;
  stroke: #fff;
  stroke-width: 0.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Country with data */
svg path.has-data {
  cursor: pointer;
  fill: #637bb6 !important;
  transition: fill 0.3s;
}

svg path.has-data:hover {
  fill: #4b69a6;
}

/* Active country (clicked) */
svg path.active-country {
  fill: #ed1c24 !important;
}

/* Tooltip */
.mgm-tooltip {
  position: absolute;
  background: white;
  color: #333;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 4px;
  pointer-events: none;
  display: none;
  z-index: 9999;
  max-width: 100%;
  line-height: 1.5;
  white-space: normal; /* ✅ Allow multiline */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-weight: 600;
  transition: opacity 0.2s; /* Animasi pudar yang kemas */
}

/* Bold key inside tooltip (from JS-generated content) */
.mgm-tooltip strong {
  display: inline-block;
  min-width: 80px;
  font-weight: 400;
  margin-right: 4px;
}


/* Zoom controls */
.mgm-map-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mgm-map-controls button {
  background: #0073aa;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.mgm-map-controls button:hover {
  background: #005f8d;
}

/* Default: cursor normal */
.mgm-map-wrapper {
  cursor: default;
}

/* Selepas zoom: cursor grab */
.mgm-map-wrapper.zoomed {
  cursor: grab;
}

/* Semasa drag: cursor grabbing */
.mgm-map-wrapper.zoomed.dragging {
  cursor: grabbing;
}

/* Popup image styling */
.mgm-popup-image {
  margin-top: 8px;
  text-align: left;
}

.mgm-popup-image img {
  max-width: 120px;   /* Kawal lebar gambar */
  height: auto;
  border-radius: 4px;
  margin-top: 4px;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.mgm-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.mgm-tooltip-row strong {
  min-width: 130px; /* label kiri tetap align */
  font-weight: 600;
}

.mgm-tooltip-values {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.mgm-popup-img {
  max-width: 40px;
  max-height: 40px;
  border-radius: 5px;
  background: #f1f1f1;
  padding: 5px;
  object-fit: contain;
}



/* Responsive */
@media (max-width: 768px) {
  .mgm-tooltip {
    font-size: 12px;
    padding: 5px 8px;
  }

  .mgm-map-controls {
    bottom: 10px;
    right: 10px;
  }

  .mgm-map-controls button {
    font-size: 14px;
    padding: 6px 10px;
  }
  
  .mgm-popup-image img {
  max-width: 80px; /* Kecil sikit bila mobile */
}

  
}

