/* ===== MAP VIEWPORT - Pan/Zoom + WoW Zone Areas ===== */

/* Viewport: fills the map-side flex area */
.map-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: radial-gradient(ellipse at center, #0d1020 0%, #060810 100%);
  cursor: grab;
  min-height: 0;
}
.map-viewport.is-dragging { cursor: grabbing; }

/* Container: transforms applied here for pan/zoom */
.map-container {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* The map image */
.map-image {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Zone overlay layer - sits on top of the image */
.zones-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* children re-enable their own */
}


/* ======================================================
   ZONE AREAS - WoW-style clickable region overlays
   ====================================================== */

.zone-area {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: all;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
}

/* Category colours */
.zone-area.c-divine {
  background: rgba(136,136,255,0.08);
  border: 1px solid rgba(136,136,255,0.25);
}
.zone-area.c-prime {
  background: rgba(68,204,136,0.08);
  border: 1px solid rgba(68,204,136,0.25);
}
.zone-area.c-liminal {
  background: rgba(204,136,68,0.08);
  border: 1px solid rgba(204,136,68,0.25);
}
.zone-area.c-primordial {
  background: rgba(204,68,102,0.08);
  border: 1px solid rgba(204,68,102,0.25);
}

/* Hover: glow up the zone */
.zone-area.c-divine:hover    { background: rgba(136,136,255,0.22); border-color: rgba(136,136,255,0.7); box-shadow: 0 0 20px rgba(136,136,255,0.35), inset 0 0 20px rgba(136,136,255,0.1); }
.zone-area.c-prime:hover     { background: rgba(68,204,136,0.22);  border-color: rgba(68,204,136,0.7);  box-shadow: 0 0 20px rgba(68,204,136,0.35),  inset 0 0 20px rgba(68,204,136,0.1); }
.zone-area.c-liminal:hover   { background: rgba(204,136,68,0.22);  border-color: rgba(204,136,68,0.7);  box-shadow: 0 0 20px rgba(204,136,68,0.35),  inset 0 0 20px rgba(204,136,68,0.1); }
.zone-area.c-primordial:hover { background: rgba(204,68,102,0.22); border-color: rgba(204,68,102,0.7);  box-shadow: 0 0 20px rgba(204,68,102,0.35),  inset 0 0 20px rgba(204,68,102,0.1); }

/* Active (selected) state */
.zone-area.active.c-divine    { background: rgba(136,136,255,0.18); border-color: rgba(136,136,255,0.9); border-width: 2px; box-shadow: 0 0 25px rgba(136,136,255,0.5); }
.zone-area.active.c-prime     { background: rgba(68,204,136,0.18);  border-color: rgba(68,204,136,0.9);  border-width: 2px; box-shadow: 0 0 25px rgba(68,204,136,0.5); }
.zone-area.active.c-liminal   { background: rgba(204,136,68,0.18);  border-color: rgba(204,136,68,0.9);  border-width: 2px; box-shadow: 0 0 25px rgba(204,136,68,0.5); }
.zone-area.active.c-primordial { background: rgba(204,68,102,0.18); border-color: rgba(204,68,102,0.9);  border-width: 2px; box-shadow: 0 0 25px rgba(204,68,102,0.5); }

/* Zone name label - always visible */
.zone-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0,0,0,0.55);
  letter-spacing: 0.03em;
  transition: color 0.2s, text-shadow 0.2s;
}
.zone-area.c-divine    .zone-label { color: #aaaaff; }
.zone-area.c-prime     .zone-label { color: #66ddaa; }
.zone-area.c-liminal   .zone-label { color: #ddaa66; }
.zone-area.c-primordial .zone-label { color: #dd6688; }

.zone-area:hover .zone-label,
.zone-area.active .zone-label {
  text-shadow: 0 0 8px currentColor;
}

/* Drill-down indicator (small chevron for zones with drill-down) */
.zone-drill-indicator {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: rgba(200,168,75,0.7);
  pointer-events: none;
  font-family: monospace;
}

/* Animated pulse on zones with drill-down */
.zone-area.has-drill::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(200,168,75,0.3);
  animation: zonePulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes zonePulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.06); opacity: 0.8; }
}


/* ======================================================
   CREATOR ZONE GEOMETRY EDITOR
   ====================================================== */

/* Toggle button in the layer bar */
.ze-toggle-btn {
  margin-left: auto;
  padding: 3px 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #C8A84B;
  background: rgba(200,168,75,.1);
  border: 1px solid rgba(200,168,75,.35);
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ze-toggle-btn:hover {
  background: rgba(200,168,75,.22);
  border-color: rgba(200,168,75,.7);
  color: #E8C870;
}
.ze-toggle-btn.ze-toggle-active {
  background: rgba(200,168,75,.25);
  border-color: #C8A84B;
  color: #fff;
  box-shadow: 0 0 8px rgba(200,168,75,.4);
}

/* Edit mode: zones become draggable boxes (square, not ellipse) */
.ze-edit-active .zone-area {
  border-radius: 6px;
  border-style: dashed;
  border-width: 2px;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
}
.ze-edit-active .zone-area:hover {
  box-shadow: 0 0 0 2px rgba(200,168,75,.7), 0 0 18px rgba(200,168,75,.3);
}

/* Suppress the panning cursor on the viewport while editing */
#map-viewport.ze-editing { cursor: default; }

/* Resize handle: bottom-right corner grip - enlarged for easy targeting */
.ze-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-right: 3px solid #C8A84B;
  border-bottom: 3px solid #C8A84B;
  border-radius: 0 0 5px 0;
  cursor: se-resize;
  opacity: .85;
  transition: opacity .15s, border-color .15s;
  pointer-events: all;
  background: rgba(200,168,75,.18);
}
.ze-resize-handle:hover {
  opacity: 1;
  border-color: #f0d070;
  background: rgba(200,168,75,.35);
}
/* Hide the handle while NOT in edit mode */
.zone-area:not(.ze-edit-active .zone-area) .ze-resize-handle { display: none; }

/* Grow / Shrink step bar */
.ze-step-bar {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  gap: 3px;
  flex-direction: row;
  align-items: center;
  pointer-events: all;
}
.ze-edit-active .zone-area .ze-step-bar {
  display: flex;
}
.ze-step-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(200,168,75,.6);
  border-radius: 4px;
  background: rgba(10,12,24,.75);
  color: #C8A84B;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  pointer-events: all;
  line-height: 1;
}
.ze-step-btn:hover {
  background: rgba(200,168,75,.28);
  border-color: #f0d070;
  color: #f0d070;
}
.ze-step-grow  { order: 2; }
.ze-step-shrink { order: 1; }

/* Save-status flash label */
.ze-status {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  font-family: 'Share Tech Mono', monospace;
  font-weight: 700;
  letter-spacing: .04em;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .3s;
}
.ze-status.ze-saved  { color: #6ddd99; }
.ze-status.ze-failed { color: #ff7a7a; }
