/* ==============================================================================
   ETERNAL GEMS — In-Canvas Visual Editor Styles
   Applied inside the preview iframe when visual_mode=1 is active
   ============================================================================== */

:root {
  --ve-accent: #d97706; /* Atelier Amber Gold */
  --ve-accent-rgb: 217, 119, 6;
  --ve-blue: #153c6c;   /* Atelier Navy */
  --ve-active-border: 2px solid #d97706;
}

/* Hover outline on editable elements */
.ve-hoverable {
  cursor: pointer !important;
  outline: 1px dashed rgba(var(--ve-accent-rgb), 0.45) !important;
  outline-offset: 3px !important;
  transition: outline 0.15s ease, background 0.15s ease !important;
}

.ve-hoverable:hover {
  outline: 2px solid rgba(var(--ve-accent-rgb), 0.85) !important;
  background-color: rgba(var(--ve-accent-rgb), 0.04) !important;
}

/* Selected element styling */
.ve-selected {
  outline: 2px solid var(--ve-accent) !important;
  outline-offset: 4px !important;
  position: relative !important;
  background-color: rgba(var(--ve-accent-rgb), 0.06) !important;
  box-shadow: 0 0 0 4px rgba(var(--ve-accent-rgb), 0.18) !important;
}

/* Inline text editing state */
[contenteditable="true"] {
  outline: 2px solid #2563eb !important;
  outline-offset: 3px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: #111827 !important;
  cursor: text !important;
  min-width: 20px;
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
}

/* Floating Quick Mini-Toolbar */
.ve-mini-toolbar {
  position: fixed;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  color: #f8fafc;
  pointer-events: auto;
  user-select: none;
  animation: veToolbarPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes veToolbarPop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ve-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ve-mini-btn:hover {
  background: var(--ve-accent);
  color: #ffffff;
  border-color: var(--ve-accent);
}

.ve-mini-btn.is-active {
  background: var(--ve-accent);
  color: #ffffff;
  border-color: var(--ve-accent);
}

.ve-mini-btn svg {
  width: 13px;
  height: 13px;
}

.ve-mini-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 4px;
  margin-right: 4px;
}

.ve-mini-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 3px;
}

/* Drag Handle */
.ve-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  padding: 0 4px;
  color: #94a3b8;
}

.ve-drag-handle:active {
  cursor: grabbing;
}

/* Image Quick Action Overlay */
.ve-img-overlay-btn {
  background: #d97706 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* Follow Link in Toolbar */
.ve-follow-link-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  font-weight: 600 !important;
}
.ve-follow-link-btn:hover {
  background: #1d4ed8 !important;
}

/* Prevent accidental navigation during visual editing */
body.ve-editing-active a:not(.ve-allowed-link) {
  cursor: pointer !important;
}
