/* ── ZONES ── */

/* Zone sits behind notes (z-index 0) */
.zone {
  position: absolute;
  top: 0; bottom: 0;
  min-width: 80px;
  z-index: 0;
  display: flex; flex-direction: column;
  pointer-events: none; /* children re-enable selectively */
  transition: width 0.05s;
}

/* Coloured fill */
.zone-fill {
  position: absolute; inset: 0;
  opacity: 0.07;
  transition: opacity 0.2s;
  pointer-events: none;
}
.zone:hover .zone-fill { opacity: 0.11; }

/* Left border accent line */
.zone-border {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 2px;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s;
}
.zone:hover .zone-border { opacity: 0.6; }

/* Title bar at the top */
.zone-header {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px 6px;
  pointer-events: all;
  flex-shrink: 0;
}

.zone-color-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; cursor: pointer;
  transition: transform 0.15s;
  border: 1.5px solid rgba(255,255,255,0.2);
}
.zone-color-dot:hover { transform: scale(1.35); }

.zone-title {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: none; background: transparent; outline: none;
  color: rgba(255,255,255,0.45);
  min-width: 40px; max-width: 200px;
  cursor: text;
  transition: color 0.15s;
  font-family: var(--font-mono, monospace);
}
.zone-title:focus { color: rgba(255,255,255,0.75); }
.zone-title::placeholder { color: rgba(255,255,255,0.2); }

/* Delete button — visible on hover */
.zone-delete-btn {
  width: 18px; height: 18px; border-radius: 4px;
  background: none; border: none;
  color: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  cursor: pointer; pointer-events: all;
  opacity: 0; transition: opacity 0.15s, background 0.12s, color 0.12s;
  margin-left: auto;
}
.zone:hover .zone-delete-btn { opacity: 1; }
.zone-delete-btn:hover { background: var(--red-soft); color: var(--red); }

/* Resize handles (left & right) */
.zone-resize-handle,
.zone-resize-handle-left {
  position: absolute; top: 0; bottom: 0;
  width: 10px; cursor: ew-resize;
  z-index: 3; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
}
.zone-resize-handle       { right: -5px; }
.zone-resize-handle-left  { left: -5px; }

.zone-resize-handle::after,
.zone-resize-handle-left::after {
  content: '';
  width: 2px; height: 32px; border-radius: 2px;
  background: rgba(255,255,255,0.12);
  transition: background 0.15s, height 0.15s;
}
.zone-resize-handle:hover::after,
.zone-resize-handle-left:hover::after {
  background: rgba(255,255,255,0.4);
  height: 48px;
}
.zone-resize-handle.dragging::after,
.zone-resize-handle-left.dragging::after {
  background: rgba(255,255,255,0.6);
  height: 64px;
}

/* Draggable zone header cursor */
.zone-header { cursor: grab; }
.zone-header:active { cursor: grabbing; }
.zone-header .zone-color-dot  { cursor: pointer; }
.zone-header .zone-title       { cursor: text; }
.zone-header .zone-delete-btn  { cursor: pointer; }

/* ── ZONE COLOUR PICKER POPUP ── */
.zone-picker-popup {
  position: absolute; top: 28px; left: 0;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 10px; z-index: 600;
  display: grid; grid-template-columns: repeat(8, 20px); gap: 7px;
  animation: menuIn 0.12s ease forwards;
  pointer-events: all;
}

.zone-picker-swatch {
  width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.12s, border-color 0.12s;
}
.zone-picker-swatch:hover { transform: scale(1.2); }
.zone-picker-swatch.selected { border-color: rgba(255,255,255,0.8); }
