/* ========================================
   Figma-like Editor UI — main.css
   ======================================== */

/* --- Design Tokens --- */
:root {
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-bg-active: rgba(255, 255, 255, 0.1);
  --window-bg: rgba(0, 0, 0, 0.2);
  --border-subtle: rgba(116, 115, 115, 0.34);
  --border-outer: rgba(0, 0, 0, 0.7);
  --outline-white: rgba(255, 255, 255, 0.25);
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.4);
  --separator: rgba(255, 255, 255, 0.06);
  --accent-blue: #0c8ce9;
  --accent-purple: #bc85ff;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

/* --- Reset / Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1e1e1e;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  font-family: var(--font);
  font-size: 11px;
  color: white;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* --- Thin Scrollbar --- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* ========================================
   Mobile Message
   ======================================== */
#mobile-message {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #111111;
  color: white;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  #mobile-message {
    display: flex;
  }

  #figma-window {
    display: none !important;
  }
}

/* ========================================
   Figma Window (root container)
   ======================================== */
#figma-window {
  width: 100vw;
  height: 100vh;
  padding: 10px;
  background: var(--window-bg);
  box-shadow:
    0px 22.5px 36.5px rgba(0, 0, 0, 0.45),
    0px 0px 24px rgba(0, 0, 0, 0.45),
    0px 0px 0px 0.5px rgba(0, 0, 0, 0.7),
    0px 0px 0px 1px var(--border-subtle) inset;
  border-radius: 12px;
  outline: 1px solid var(--outline-white);
  outline-offset: -1px;
  backdrop-filter: blur(39px);
  -webkit-backdrop-filter: blur(39px);
  display: flex;
  overflow: hidden;
}

/* ========================================
   Left Sidebar
   ======================================== */
#left-sidebar {
  width: 230px;
  min-width: 230px;
  align-self: stretch;
  padding: 10px 0;
  background: var(--glass-bg);
  box-shadow:
    0px 0px 0px 1px var(--border-subtle) inset,
    1px 1px 10px rgba(0, 0, 0, 0.1);
  border-radius: 0;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 0;
}

/* Traffic Lights */
.traffic-lights {
  display: flex;
  gap: 9px;
  padding: 6px 16px;
}

.traffic-dot {
  width: 14px;
  height: 14px;
  border-radius: 100px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.traffic-dot.red {
  background: #ff736a;
}

.traffic-dot.yellow {
  background: #febc2e;
}

.traffic-dot.green {
  background: #19c332;
}

/* File Info */
.file-info {
  padding: 8px 8px 12px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 550;
  line-height: 22px;
}

.file-subtitle {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.06px;
}

/* Sidebar Tabs */
.sidebar-tabs {
  padding: 8px;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  display: flex;
  justify-content: space-between;
}

.sidebar-tab {
  height: 24px;
  padding: 0 8px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 450;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-tab.active {
  background: var(--glass-bg-active);
  color: var(--text-primary);
  font-weight: 550;
}

.sidebar-tab:hover:not(.active) {
  background: var(--glass-bg-hover);
}

/* Section */
.section {
  padding: 0 8px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  padding: 4px 0;
}

.section-title {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.06px;
}

.section-action {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.section-action:hover {
  background: var(--glass-bg-hover);
}

/* Page Items */
.page-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 24px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 450;
  cursor: pointer;
  text-align: left;
}

.page-item.active {
  background: var(--glass-bg-active);
}

.page-item:hover:not(.active) {
  background: var(--glass-bg-hover);
}

/* Layers Section */
.layers-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex: 1;
  overflow-y: auto;
}

/* Layer Items */
.layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 450;
  color: var(--text-primary);
  cursor: pointer;
}

.layer-item:hover {
  background: var(--glass-bg-hover);
}

.layer-item.selected {
  background: var(--glass-bg-active);
}

.layer-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.layer-indent-1 {
  padding-left: calc(14px + 16px);
}
.layer-indent-2 {
  padding-left: calc(14px + 32px);
}
.layer-indent-3 {
  padding-left: calc(14px + 48px);
}
.layer-indent-4 {
  padding-left: calc(14px + 64px);
}

.layer-name.purple {
  color: #bc85ff;
}

/* --- Focus States --- */
.sidebar-tab:focus-visible,
.page-item:focus-visible,
.section-action:focus-visible,
.tool-btn:focus-visible,
.share-btn:focus-visible,
.right-tab:focus-visible,
.prop-action:focus-visible,
.icon-btn:focus-visible,
.page-tab:focus-visible,
.page-tab-items button:focus-visible,
.page-tab-add:focus-visible,
.help-circle:focus-visible,
.color-swatch:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -1px;
}

/* ========================================
   Canvas Area
   ======================================== */
#canvas-area {
  flex: 1;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  background: #2c2c2c;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  margin: 0 2px;
}

/* Canvas Cursors */
#canvas-area.cursor-selector {
  cursor: default;
}
#canvas-area.cursor-hand {
  cursor: grab;
}
#canvas-area.cursor-hand:active {
  cursor: grabbing;
}
#canvas-area.cursor-frame {
  cursor: crosshair;
}
#canvas-area.cursor-rectangle {
  cursor: crosshair;
}
#canvas-area.cursor-pen {
  cursor: crosshair;
}
#canvas-area.cursor-text {
  cursor: text;
}

/* Draw Canvas (pen / vector overlay) */
#draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#draw-canvas.active {
  pointer-events: auto;
}

/* Canvas Content (pannable / zoomable container) */
#canvas-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  z-index: 5;
}

/* Canvas Elements */
.canvas-element {
  position: absolute;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-element.selected {
  outline: 2px solid #0c8ce9;
}

.canvas-element.selected .resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: white;
  border: 1px solid #0c8ce9;
  z-index: 2;
}

.canvas-element.selected .resize-handle.nw {
  top: -4px;
  left: -4px;
  cursor: nwse-resize;
}
.canvas-element.selected .resize-handle.ne {
  top: -4px;
  right: -4px;
  cursor: nesw-resize;
}
.canvas-element.selected .resize-handle.sw {
  bottom: -4px;
  left: -4px;
  cursor: nesw-resize;
}
.canvas-element.selected .resize-handle.se {
  bottom: -4px;
  right: -4px;
  cursor: nwse-resize;
}

/* Canvas Frames */
.canvas-frame {
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.canvas-frame-label {
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
}

/* Selection Box (marquee) */
#selection-box {
  position: absolute;
  border: 1px solid #0c8ce9;
  background: rgba(12, 140, 233, 0.1);
  pointer-events: none;
  z-index: 15;
}

#selection-box.hidden {
  display: none;
}

/* Page Tabs (top-left of canvas) */
#page-tabs {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
}

.page-tab,
.page-tab-items button {
  padding: 8px 11px;
  background: var(--glass-bg-active);
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.page-tab.active,
.page-tab-items button.active {
  color: white;
}

.page-tab:hover:not(.active),
.page-tab-items button:hover:not(.active) {
  background: var(--glass-bg-hover);
}

/* Zoom Control (top-right of canvas) */
#zoom-control {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 8px;
  background: var(--glass-bg-active);
  border-radius: 6px;
  z-index: 20;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 11px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
}

/* ========================================
   Toolbar (bottom center of canvas)
   ======================================== */
#toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 8px;
  background: var(--glass-bg-active);
  box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  z-index: 20;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.tool-btn {
  width: 32px;
  height: 32px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  background: var(--glass-bg-hover);
}

.tool-btn.active {
  background: var(--accent-blue);
}

.tool-btn svg {
  width: 16px;
  height: 16px;
}

.tool-dropdown-arrow {
  width: 5px;
  height: 3px;
  margin-right: 6px;
  background: white;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  opacity: 0.5;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 8px;
  flex-shrink: 0;
}

.toolbar-color {
  display: flex;
  align-items: center;
  gap: 4px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: 0;
}

/* ========================================
   Right Sidebar
   ======================================== */
#right-sidebar {
  width: 230px;
  min-width: 230px;
  align-self: stretch;
  padding: 10px;
  background: var(--glass-bg);
  box-shadow:
    0px 0px 0px 1px var(--border-subtle) inset,
    1px 1px 10px rgba(0, 0, 0, 0.1);
  border-radius: 0;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Right Top (avatar + share) */
.right-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #ffcd29;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: black;
  flex-shrink: 0;
}

.share-btn {
  height: 32px;
  padding: 4px 12px;
  background: #0d99ff;
  border: none;
  border-radius: 6px;
  color: white;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 450;
  cursor: pointer;
}

.share-btn:hover {
  filter: brightness(1.1);
}

/* Right Tabs */
.right-tabs {
  display: flex;
  align-items: center;
  padding: 0;
  margin-top: 8px;
  gap: 4px;
}

.right-tab {
  height: 24px;
  padding: 0 8px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 450;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-tab.active {
  background: var(--glass-bg-active);
  color: white;
  font-weight: 550;
}

.right-tab:hover:not(.active) {
  background: var(--glass-bg-hover);
}

.right-tab-zoom {
  margin-left: auto;
  font-size: 11px;
  color: white;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

/* Properties Panel */
#properties-panel {
  flex: 1;
  overflow-y: auto;
  margin-top: 8px;
}

/* Property Section */
.prop-section {
  border-top: 1px solid var(--separator);
  padding: 4px 0;
}

.prop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  padding: 0 8px;
}

.prop-header span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
}

/* Property Rows */
.prop-row {
  padding: 4px 8px;
}

/* Color Fill */
.prop-color-fill {
  display: flex;
  align-items: center;
  height: 24px;
  background: var(--glass-bg-active);
  border-radius: 5px;
  overflow: hidden;
}

.color-preview {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.color-preview .inner {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-hex {
  padding: 0 8px;
  font-size: 11px;
  color: white;
}

.color-opacity {
  margin-left: auto;
  padding: 0 8px;
  border-left: 0.5px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  height: 100%;
}

.opacity-pct {
  color: var(--text-secondary);
}

/* Property Grid (X, Y, W, H, rotation, radius) */
.prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px 8px;
}

.prop-field {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  background: var(--glass-bg-active);
  border-radius: 5px;
}

.prop-field label {
  color: var(--text-secondary);
  font-size: 11px;
  flex-shrink: 0;
}

.prop-field span {
  color: var(--text-primary);
  font-size: 11px;
}

/* Property Action (same as section-action) */
.prop-action {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prop-action:hover {
  background: var(--glass-bg-hover);
}

/* Right Bottom */
.right-bottom {
  padding: 4px 0;
  display: flex;
  justify-content: flex-end;
}

.help-circle {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  cursor: pointer;
  border: none;
}

.help-circle:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   Rulers
   ======================================== */
.ruler {
  position: absolute;
  background: #2a2a2a;
  z-index: 25;
  overflow: hidden;
}

.ruler.horizontal {
  top: 0;
  left: 24px;
  right: 0;
  height: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ruler.vertical {
  top: 24px;
  left: 0;
  bottom: 0;
  width: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.ruler canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ruler-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  background: #2a2a2a;
  z-index: 26;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Adjust canvas content area for rulers */
#canvas-area {
  /* the canvas-content and draw-canvas need offset for rulers */
}

#canvas-content,
#draw-canvas {
  top: 24px !important;
  left: 24px !important;
  width: calc(100% - 24px) !important;
  height: calc(100% - 24px) !important;
}

#page-tabs {
  top: 32px;
  left: 34px;
}

#zoom-control {
  top: 32px;
}

#toolbar {
  bottom: 40px;
}

/* ========================================
   Context Menu
   ======================================== */
#context-menu {
  position: fixed;
  min-width: 220px;
  padding: 4px;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 0 0.5px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.ctx-item:hover {
  background: var(--accent-blue);
  color: white;
}

.ctx-item:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -1px;
}

.ctx-shortcut {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 24px;
}

.ctx-item:hover .ctx-shortcut {
  color: rgba(255, 255, 255, 0.7);
}

.ctx-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 8px;
}

/* ========================================
   Share Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  width: 420px;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.15s ease-out;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 550;
  color: white;
}

.modal-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--glass-bg-hover);
  color: white;
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -1px;
}

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
}

.share-link-input:focus {
  border-color: var(--accent-blue);
}

.share-copy-btn,
.share-invite-btn {
  height: 32px;
  padding: 0 14px;
  background: var(--accent-blue);
  border: none;
  border-radius: 6px;
  color: white;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.share-copy-btn:hover,
.share-invite-btn:hover {
  filter: brightness(1.1);
}

.share-copy-btn:focus-visible,
.share-invite-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.share-invite {
  display: flex;
  gap: 8px;
}

.share-email-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
}

.share-email-input:focus {
  border-color: var(--accent-blue);
}

.share-email-input::placeholder {
  color: var(--text-muted);
}

.share-people {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.share-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.share-person-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.share-person-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
}

.share-person-role {
  font-size: 11px;
  color: var(--text-muted);
}

.share-person-access {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ========================================
   Status Bar
   ======================================== */
#status-bar {
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 0;
  height: 24px;
  background: #2a2a2a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 16px;
  z-index: 25;
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#status-bar span {
  white-space: nowrap;
}

#cursor-coords {
  min-width: 80px;
}

#selection-info {
  color: var(--text-secondary);
}

/* ========================================
   Snap Guides
   ======================================== */
#snap-guides {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 0;
  bottom: 24px;
  pointer-events: none;
  z-index: 12;
}

.snap-line {
  position: absolute;
  background: #ff3366;
}

.snap-line.horizontal {
  left: 0;
  right: 0;
  height: 1px;
}

.snap-line.vertical {
  top: 0;
  bottom: 0;
  width: 1px;
}

/* ========================================
   Ghost / Multiplayer Cursor
   ======================================== */
.ghost-cursor {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  transition:
    left 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.ghost-cursor svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.ghost-cursor-name {
  position: absolute;
  top: 18px;
  left: 10px;
  padding: 2px 6px;
  background: #ff5c5c;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
}

/* ========================================
   Toast Notifications
   ======================================== */
#toast-container {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  padding: 8px 16px;
  background: #333;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-family: var(--font);
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation:
    slideUp 0.2s ease-out,
    fadeOut 0.3s ease-in 2.5s forwards;
  pointer-events: none;
}

/* ========================================
   Editable Property Inputs
   ======================================== */
.prop-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.prop-input::-webkit-outer-spin-button,
.prop-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.prop-input:focus {
  color: white;
}

.prop-field:has(.prop-input:focus) {
  outline: 1px solid var(--accent-blue);
}

/* ========================================
   Layer Enhancements
   ======================================== */
.layer-item {
  position: relative;
  transition: background-color 0.1s ease;
}

.layer-actions {
  display: none;
  align-items: center;
  gap: 2px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.layer-item:hover .layer-actions {
  display: flex;
}

.layer-eye {
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.layer-eye:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.layer-eye.hidden-layer {
  color: rgba(255, 255, 255, 0.15);
}

.layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   Selection Handles (working resize)
   ======================================== */
.selection-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: white;
  border: 1px solid var(--accent-blue);
  border-radius: 1px;
  z-index: 3;
}

.selection-handle.nw {
  top: -4px;
  left: -4px;
  cursor: nwse-resize;
}
.selection-handle.ne {
  top: -4px;
  right: -4px;
  cursor: nesw-resize;
}
.selection-handle.sw {
  bottom: -4px;
  left: -4px;
  cursor: nesw-resize;
}
.selection-handle.se {
  bottom: -4px;
  right: -4px;
  cursor: nwse-resize;
}
.selection-handle.n {
  top: -4px;
  left: 50%;
  margin-left: -4px;
  cursor: ns-resize;
}
.selection-handle.s {
  bottom: -4px;
  left: 50%;
  margin-left: -4px;
  cursor: ns-resize;
}
.selection-handle.e {
  right: -4px;
  top: 50%;
  margin-top: -4px;
  cursor: ew-resize;
}
.selection-handle.w {
  left: -4px;
  top: 50%;
  margin-top: -4px;
  cursor: ew-resize;
}

/* Selection distance indicator */
.distance-label {
  position: absolute;
  background: var(--accent-blue);
  color: white;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  padding: 1px 4px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
}

/* ========================================
   Cursor Grabbing State
   ======================================== */
#canvas-area.cursor-grabbing,
#canvas-area.cursor-grabbing * {
  cursor: grabbing !important;
}

/* ========================================
   Transitions & Animations
   ======================================== */
.sidebar-tab,
.page-item,
.right-tab,
.tool-btn,
.share-btn,
.prop-action,
.section-action,
.layer-item {
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ========================================
   Marquee Selection Box
   ======================================== */
#selection-box {
  border: 1px solid var(--accent-blue);
  background: rgba(12, 140, 233, 0.08);
}

/* ========================================
   Hover Distance Indicators
   ======================================== */
.hover-outline {
  position: absolute;
  border: 1px solid var(--accent-blue);
  pointer-events: none;
  z-index: 11;
  opacity: 0.5;
}
