/* Map Editor Styles */

/* ==========================================
   CONTAINER — fills the full_width main area
   In the main layout: main is flex-1 inside a flex column with 56px navbar.
   We use 100% with a fallback to calc(100vh - 56px) for robustness.
   ========================================== */
.map-editor-container {
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

/* ==========================================
   HEADER with integrated toolbar
   ========================================== */
.map-editor-header {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  z-index: 20;
  gap: 12px;
}

.map-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.map-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.map-header-back:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.map-header-info {
  min-width: 0;
  flex: 1;
}

.map-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  border-radius: 4px;
  padding: 0 4px;
  margin: 0 -4px;
  transition: background 0.15s ease;
  line-height: 1.4;
}

.map-header-title:hover {
  background: var(--bg-surface-hover);
}

.map-header-title:focus {
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 2px var(--accent);
}

.map-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  line-height: 1;
}

.map-header-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-surface-hover);
  font-weight: 500;
}

.map-header-separator {
  opacity: 0.5;
}

.map-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.map-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-header-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ==========================================
   TOOLBAR (horizontal, inside header)
   ========================================== */
.map-toolbar-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg-surface-hover);
}

.map-toolbar-separator {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--border-default);
}

.map-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-toolbar-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.map-toolbar-btn.active,
.map-toolbar-btn:active {
  background: var(--accent-10);
  color: var(--accent);
}

.map-toolbar-select {
  height: 30px;
  padding: 0 8px;
  padding-right: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: all 0.15s ease;
}

.map-toolbar-select:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.map-toolbar-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.map-toolbar-add-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.map-toolbar-add-btn:hover {
  background: var(--accent-hover);
}

/* Spacing slider */
.map-spacing-group {
  gap: 4px;
  padding: 2px 6px;
}

.map-spacing-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-default);
  outline: none;
  cursor: pointer;
}

.map-spacing-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.map-spacing-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.map-spacing-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Phase 2.4 — Zoom level display */
.map-zoom-level {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 36px;
  text-align: center;
  user-select: none;
}

/* Phase 2.2 — Search input */
.map-search-input {
  height: 30px;
  padding: 0 8px 0 28px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.75rem;
  width: 140px;
  transition: all 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 8px center;
}

.map-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-10);
  width: 180px;
}

.map-search-input::placeholder {
  color: var(--text-tertiary);
}

/* ==========================================
   CANVAS — flex: 1, takes all remaining space
   ========================================== */
.map-canvas {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
  touch-action: none;
  background: var(--bg-primary);
  background-image: radial-gradient(circle, var(--border-default) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ==========================================
   LOADING STATE
   ========================================== */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 50;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

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

.map-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: map-spin 0.8s linear infinite;
}

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

/* ==========================================
   ONBOARDING HINT
   ========================================== */
.map-onboarding {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 0.8125rem;
  color: var(--text-primary);
  white-space: nowrap;
  animation: map-onboarding-appear 0.3s ease;
}

@keyframes map-onboarding-appear {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.map-onboarding-dismiss {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.map-onboarding-dismiss:hover {
  background: var(--accent-10);
  color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================
   CONTEXT MENU — Color swatches & Type items
   ========================================== */
.map-ctx-section-label {
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.map-ctx-colors {
  display: flex;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  flex-wrap: wrap;
}

.map-ctx-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.map-ctx-color:hover {
  transform: scale(1.2);
}

.map-ctx-color.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 3px var(--text-primary);
}

/* Type icons — compact horizontal row */
.map-ctx-types {
  display: flex;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
}

.map-ctx-type-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border: 2px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.1s ease;
}

.map-ctx-type-icon:hover {
  background: var(--bg-surface-hover);
  transform: scale(1.1);
}

.map-ctx-type-icon.active {
  border-color: var(--accent, #6366f1);
  background: var(--accent-10, rgba(99, 102, 241, 0.1));
}

/* Shortcut / info hints in context menu items */
.map-ctx-hint {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ==========================================
   NODE COUNT BADGE
   ========================================== */
.map-node-count {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   MINIMAP
   ========================================== */
.map-minimap {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  width: 180px;
  height: 120px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
}

.map-minimap-viewport {
  position: absolute;
  border: 2px solid var(--accent);
  background: var(--accent-10);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
  transition: left 0.05s linear, top 0.05s linear;
}

/* ==========================================
   CONTEXT MENU
   ========================================== */
.map-context-menu {
  position: fixed;
  z-index: 50;
  min-width: 200px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  padding: 0.25rem;
  animation: map-context-appear 0.1s ease-out;
}

@keyframes map-context-appear {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.map-context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8125rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.1s ease;
  text-align: left;
}

.map-context-menu-item:hover {
  background: var(--bg-surface-hover);
}

.map-context-menu-item.danger {
  color: #ef4444;
}

.map-context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.map-context-menu-separator {
  height: 1px;
  margin: 0.25rem 0;
  background: var(--border-default);
}

/* ==========================================
   LINK SEARCH MODAL
   ========================================== */
.map-link-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(0, 0, 0, 0.4);
  animation: map-fade-in 0.15s ease;
}

.map-link-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.map-link-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
}

.map-link-modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.map-link-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
}

.map-link-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.map-link-search {
  margin: 0.75rem 1.25rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
}

.map-link-search:focus {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px var(--accent-10, rgba(99, 102, 241, 0.1));
}

.map-link-results {
  overflow-y: auto;
  padding: 0.5rem;
  flex: 1;
}

.map-link-hint {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  padding: 1.5rem 0;
  margin: 0;
}

.map-link-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: background 0.1s;
}

.map-link-result:hover {
  background: var(--bg-surface-hover);
}

.map-link-result-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.map-link-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.map-link-result-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-link-result-subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-link-result-type {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-surface-hover);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

/* ==========================================
   SHORTCUTS POPOVER
   ========================================== */
.map-shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  animation: map-fade-in 0.15s ease;
}

@keyframes map-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.map-shortcuts-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 24px;
  max-width: 400px;
  width: 90%;
}

.map-shortcuts-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.map-shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8125rem;
}

.map-shortcut-row span:first-child {
  color: var(--text-secondary);
}

.map-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-default);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: monospace;
}

/* ==========================================
   Phase 1.3 — SAVE INDICATOR
   ========================================== */
.map-save-indicator {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.map-save-indicator.saving {
  color: var(--text-tertiary);
}

.map-save-indicator.saving::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--text-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: map-spin 0.6s linear infinite;
}

.map-save-indicator.saved {
  color: #22c55e;
}

.map-save-indicator.saved::before {
  content: "\2713";
  font-size: 10px;
}

.map-save-indicator.error {
  color: #ef4444;
}

.map-save-indicator.error::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
}

/* ==========================================
   Phase 2.1 — BULK TOOLBAR
   ========================================== */
.map-bulk-toolbar {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  animation: map-context-appear 0.15s ease;
}

.map-bulk-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0 4px;
}

.map-bulk-separator {
  width: 1px;
  height: 18px;
  background: var(--border-default);
  margin: 0 4px;
}

.map-bulk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-bulk-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.map-bulk-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ==========================================
   Phase 3.3 — NODE TOOLTIP
   ========================================== */
.map-node-tooltip {
  position: fixed;
  z-index: 55;
  max-width: 250px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  pointer-events: none;
  animation: map-fade-in 0.15s ease;
  word-break: break-word;
}

/* ==========================================
   Phase 3.1 — EDGE LABEL EDITOR
   ========================================== */
.map-edge-label-editor {
  position: fixed;
  z-index: 55;
  animation: map-context-appear 0.1s ease;
}

.map-edge-label-input {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  outline: none;
}

.map-edge-label-input:focus {
  box-shadow: 0 0 0 2px var(--accent-10), 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ==========================================
   INLINE NODE EDITOR (double-click rename)
   ========================================== */
.map-inline-node-editor {
  position: fixed;
  z-index: 55;
  animation: map-context-appear 0.1s ease;
}

.map-inline-node-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  font-family: Inter, system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  outline: none;
  min-width: 80px;
  max-width: 300px;
}

.map-inline-node-input:focus {
  box-shadow: 0 0 0 3px var(--accent-10), 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   CONNECTION HINT
   ========================================== */
.map-connection-hint {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  animation: map-onboarding-appear 0.3s ease;
  transition: opacity 0.3s ease;
}

.map-connection-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-default);
  font-size: 0.625rem;
  font-weight: 600;
  font-family: monospace;
  color: var(--text-primary);
}

/* ==========================================
   GRAB CURSOR — when nodes are draggable
   ========================================== */
.map-canvas canvas {
  cursor: default;
}

/* ==========================================
   PRESENTATION MODE
   ========================================== */
.map-editor-container.presenting .map-editor-header,
.map-editor-container.presenting .map-node-count,
.map-editor-container.presenting .map-shortcuts-badge,
.map-editor-container.presenting .map-onboarding,
.map-editor-container.presenting .map-connection-hint,
.map-editor-container.presenting .map-properties-panel {
  display: none;
}

.map-editor-container.presenting .map-canvas {
  /* Full height when header is hidden */
}

.map-editor-container.presenting {
  height: 100vh;
}

.map-presentation-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.map-presentation-info {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: map-context-appear 0.2s ease;
}

.map-presentation-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.map-presentation-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.map-presentation-counter {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.map-presentation-controls {
  pointer-events: auto;
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.map-presentation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-presentation-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ==========================================
   PROPERTIES SIDE PANEL
   ========================================== */
.map-properties-panel {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: 0;
  width: 280px;
  z-index: 20;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-properties-panel.open {
  transform: translateX(0);
}

.map-properties-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.map-properties-header h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.map-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-panel-close:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.map-properties-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.map-prop-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-prop-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.map-prop-input {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease;
}

.map-prop-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-10);
}

.map-prop-textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: Inter, system-ui, sans-serif;
  transition: border-color 0.15s ease;
}

.map-prop-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-10);
}

.map-prop-textarea::placeholder {
  color: var(--text-tertiary);
}

.map-prop-types {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.map-prop-type-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--bg-surface-hover);
  cursor: pointer;
  transition: all 0.1s ease;
}

.map-prop-type-btn:hover {
  transform: scale(1.1);
}

.map-prop-type-btn.active {
  border-color: var(--accent);
  background: var(--accent-10);
}

.map-prop-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================
   KEYBOARD SHORTCUTS BADGE
   ========================================== */
.map-shortcuts-badge {
  position: absolute;
  bottom: 1rem;
  left: 5.5rem;
  z-index: 10;
  cursor: pointer;
}

.map-shortcuts-badge-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.map-shortcuts-badge:hover .map-shortcuts-badge-key {
  background: var(--accent-10);
  color: var(--accent);
  border-color: var(--accent);
}

.map-shortcuts-badge-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.15s ease;
  pointer-events: none;
}

.map-shortcuts-badge:hover .map-shortcuts-badge-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.map-shortcuts-badge-tooltip .map-shortcut-row {
  padding: 3px 0;
  font-size: 0.75rem;
}

.map-shortcuts-badge-more {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-default);
  font-size: 0.6875rem;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
/* Mobile overflow menu button */
.map-toolbar-overflow-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-toolbar-overflow-btn:hover {
  color: var(--text-primary);
}

.map-toolbar-overflow-btn.active {
  background: var(--accent-10);
  color: var(--accent);
}

.map-toolbar-overflow-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 260px;
  animation: map-context-appear 0.1s ease-out;
}

.map-toolbar-overflow-panel.open {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.map-toolbar-overflow-panel .map-toolbar-group {
  flex-shrink: 0;
}

.map-toolbar-overflow-panel .map-toolbar-separator {
  display: none;
}

.map-toolbar-overflow-panel .map-search-input {
  width: 100%;
  flex: 1 1 100%;
}

@media (max-width: 640px) {
  .map-editor-header {
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .map-header-left {
    flex: 1 1 100%;
  }

  .map-header-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    position: relative;
  }

  .map-header-info {
    overflow: hidden;
  }

  .map-header-title {
    font-size: 0.875rem;
  }

  /* Show overflow button, hide inline toolbar content */
  .map-toolbar-overflow-btn {
    display: flex;
  }

  .map-toolbar-inline > *:not(.map-toolbar-overflow-btn):not(.map-toolbar-add-btn):not(.map-save-indicator):not(.map-toolbar-overflow-panel) {
    display: none;
  }

  .map-toolbar-overflow-panel .map-toolbar-group,
  .map-toolbar-overflow-panel .map-search-input,
  .map-toolbar-overflow-panel .map-spacing-group {
    display: flex;
  }

  .map-minimap {
    display: none;
  }

  .map-node-count {
    bottom: auto;
    top: 60px;
    left: auto;
    right: 12px;
  }

  .map-shortcuts-badge {
    display: none;
  }

  .map-onboarding {
    bottom: 24px;
    max-width: 90%;
    white-space: normal;
    text-align: center;
    flex-direction: column;
  }

  .map-bulk-toolbar {
    top: auto;
    bottom: 16px;
    max-width: 90%;
  }
}

