/* Base wrapper: JS controls height after image load */
#vcm-map-wrapper {
  position: relative;
  width: 100%;
  background: #fff;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* While initializing, keep it full-screen-ish for loader */
#vcm-map-wrapper.vcm-initializing {
  min-height: 130vh;
  height: 130vh;
}

#vcm-map {
  width: 100%;
  height: 100%;
  background: #fff;
}

/* While initializing, hide modal + coords (map can still size) */
#vcm-map-wrapper.vcm-initializing #vcmModalBackdrop,
#vcm-map-wrapper.vcm-initializing #vcm-coords {
  visibility: hidden;
}

/* Loading overlay inside wrapper */
#vcm-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  z-index: 9000;
  transition: opacity 0.25s ease;
}

#vcm-loading.vcm-loading-hidden {
  opacity: 0;
  pointer-events: none;
}

.vcm-loading-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #111827;
}

.vcm-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(156, 163, 175, 0.7);
  border-top-color: #111827;
  animation: vcm-spin 0.7s linear infinite;
}

@keyframes vcm-spin {
  to {
    transform: rotate(360deg);
  }
}

#vcm-coords {
  position: fixed;
  top: 10rem;
  left: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  z-index: 500;
  pointer-events: none;
  color: #111827;
}

.vcm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  opacity: 0;
  transition: 0.2s opacity;
}

.vcm-modal-backdrop.vcm-active {
  opacity: 1;
  pointer-events: all;
}

.vcm-modal {
  width: min(500px, 95%);
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  transform: scale(0.9);
  transition: 0.2s transform;
}

.vcm-modal-backdrop.vcm-active .vcm-modal {
  transform: scale(1);
}

.vcm-modal h2 {
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 600;
}

.vcm-modal-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.vcm-modal #vcmModalDescription {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  color: #374151;
  overflow: auto;
  max-height: 40rem;
}

.vcm-modal-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.05);
  color: #111827;
}

/* Optional tooltip styling */
.vcm-marker-tooltip {
  background: rgba(17, 24, 39, 0.92);
  color: #f9fafb;
  border-radius: 999px;
  padding: 4px 10px;
  border: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-size: 11px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.vcm-marker-tooltip .leaflet-tooltip-arrow {
  display: none;
}
