/* ============================================================
   TopoMapping — Draw color picker
   Lets the user choose the color used for new points, lines,
   polygons and circles. Brand: #1e5d44 / #fdbf2d
   ============================================================ */

/* swatch button placed inside the draw toolbars */
.dc-swatch-btn {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background .15s ease, transform .1s ease;
}
.dc-swatch-btn:hover { background: #eef2f0; }
.dc-swatch-btn:active { transform: scale(.9); }
.dc-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff0000;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(0, 0, 0, .25);
}

/* color-applying tool icons inherit the active draw color via currentColor */
.dc-ic { display: block; width: 24px; height: 24px; }
.dc-tool { transition: color .15s ease, background .15s ease, transform .1s ease; }

/* ---------- popover palette ---------- */
.dc-pop {
  position: fixed;
  z-index: 2147480000;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(15, 32, 24, .4), 0 4px 12px rgba(0, 0, 0, .12);
  padding: 14px;
  width: 212px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: dc-in .16s ease;
}
@keyframes dc-in {
  from { opacity: 0; transform: translateY(4px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dc-pop.dc-hidden { display: none; }

.dc-pop-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e5d44;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 0 0 10px;
}
.dc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.dc-color {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
  transition: transform .12s;
}
.dc-color:hover { transform: scale(1.12); }
.dc-color.dc-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e5d44;
  transform: scale(1.1);
}

.dc-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eef0ee;
  padding-top: 12px;
}
.dc-custom label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  flex: 1;
}
.dc-custom input[type="color"] {
  width: 38px;
  height: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  cursor: pointer;
}

/* ============================================================
   Modern action bar (Cancel / Delete all) shown for editing tools
   ============================================================ */
.map-action-bar {
  position: absolute;
  top: 20%;
  right: 50px;
  transform: translateY(-50%);
  z-index: 1001;
  display: flex;
  gap: 8px;
  align-items: center;
}
.map-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font: 600 13px 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  box-shadow: 0 6px 16px -4px rgba(15, 32, 24, .28), 0 1px 3px rgba(0, 0, 0, .1);
  transition: transform .12s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.map-action-btn:hover { background: #f3f4f6; transform: translateY(-1px); }
.map-action-btn:active { transform: translateY(0); }
.map-action-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.map-action-btn--cancel { color: #4b5563; }
.map-action-btn--danger {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(239, 68, 68, .55);
}
.map-action-btn--danger:hover { background: #dc2626; }
.map-action-btn--primary {
  background: #1e5d44;
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(30, 93, 68, .55);
}
.map-action-btn--primary:hover { background: #17492f; }

/* measurement Cancel bar (left side, next to the measure toolbar) */
.measure-action-bar {
  position: absolute;
  top: 25%;
  left: 70px;
  transform: translateY(-50%);
  z-index: 1001;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============================================================
   Modern marker popup (point info card)
   ============================================================ */
.mk-popup {
  position: relative;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 32, 24, .06);
  box-shadow: 0 14px 34px -10px rgba(15, 32, 24, .4), 0 2px 8px rgba(0, 0, 0, .1);
  padding: 13px 15px 12px;
  min-width: 210px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: mk-pop-in .16s ease-out;
}
@keyframes mk-pop-in {
  from { opacity: 0; transform: translateY(5px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.mk-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.mk-popup-close:hover { background: #e5e7eb; color: #111827; }

.mk-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  padding-right: 22px;
}
.mk-popup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(0, 0, 0, .22);
}
.mk-popup-title { font-size: 15px; font-weight: 700; color: #1e5d44; }

.mk-popup-sys {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #fff;
  background: #1e5d44;
  padding: 2px 9px;
  border-radius: 6px;
  margin-bottom: 9px;
}
.mk-popup-sub {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #9ca3af;
  margin: 9px 0 4px;
}
.mk-popup-grid { display: flex; flex-direction: column; gap: 3px; }
.mk-cell {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
}
.mk-cell span { color: #6b7280; }
.mk-cell b {
  color: #111827;
  font-weight: 600;
  font-family: 'Lucida Console', 'Courier New', monospace;
}

.mk-popup-arrow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 15px;
  height: 15px;
  background: #fff;
  border-right: 1px solid rgba(15, 32, 24, .06);
  border-bottom: 1px solid rgba(15, 32, 24, .06);
  transform: translateX(-50%) rotate(45deg);
}

/* ============================================================
   Drag & drop import overlay
   ============================================================ */
#dropOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147481500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(30, 93, 68, .16);
  border: 3px dashed #1e5d44;
  pointer-events: none;
}
#dropOverlay.show { display: flex; }
#dropOverlay .drop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #1e5d44;
  padding: 18px 26px;
  border-radius: 16px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .4);
  font: 600 15px 'Inter', -apple-system, sans-serif;
}

/* transient tool toast (e.g. cut feedback) */
.map-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #1e5d44;
  color: #fff;
  font: 500 14px 'Inter', -apple-system, sans-serif;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5);
  z-index: 2147480500;
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  transition: opacity .25s, transform .25s;
}
.map-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
