/* ========================================
   EchoRabbit 小红书卡片生成器 - 样式表
   ======================================== */

/* CSS Variables - 主题系统 */
:root {
  --card: #fcfcfc;
  --ring: #72e3ad;
  --input: #f6f6f6;
  --muted: #ededed;
  --accent: #ededed;
  --border: #dfdfdf;
  --radius: 0.5rem;
  --chart-1: #72e3ad;
  --chart-2: #3b82f6;
  --chart-3: #8b5cf6;
  --chart-4: #f59e0b;
  --chart-5: #10b981;
  --popover: #fcfcfc;
  --primary: #72e3ad;
  --logo: #006934;
  --sidebar: #fcfcfc;
  --font-mono: monospace;
  --font-sans: 'Outfit', 'Noto Sans SC', sans-serif;
  --secondary: #fdfdfd;
  --background: #fcfcfc;
  --font-serif: 'Noto Serif SC', ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --foreground: #171717;
  --destructive: #ca3214;
  --shadow-blur: 3px;
  --shadow-color: #000000;
  --sidebar-ring: #72e3ad;
  --shadow-spread: 0px;
  --letter-spacing: 0.025em;
  --shadow-opacity: 0.17;
  --sidebar-accent: #ededed;
  --sidebar-border: #dfdfdf;
  --card-foreground: #171717;
  --shadow-offset-x: 0px;
  --shadow-offset-y: 1px;
  --sidebar-primary: #72e3ad;
  --muted-foreground: #202020;
  --accent-foreground: #202020;
  --popover-foreground: #525252;
  --primary-foreground: #1e2723;
  --sidebar-foreground: #707070;
  --secondary-foreground: #171717;
  --destructive-foreground: #fffcfc;
  --sidebar-accent-foreground: #202020;
  --sidebar-primary-foreground: #1e2723;
  
  /* 画布缩放比例 */
  --canvas-scale: 0.5;
}

.dark {
  --card: #171717;
  --ring: #4ade80;
  --input: #242424;
  --muted: #1f1f1f;
  --accent: #313131;
  --border: #292929;
  --chart-1: #4ade80;
  --chart-2: #60a5fa;
  --chart-3: #a78bfa;
  --chart-4: #fbbf24;
  --chart-5: #2dd4bf;
  --popover: #242424;
  --primary: #006239;
  --logo: #006934;
  --sidebar: #121212;
  --secondary: #242424;
  --background: #121212;
  --foreground: #e2e8f0;
  --destructive: #541c15;
  --sidebar-ring: #4ade80;
  --sidebar-accent: #313131;
  --sidebar-border: #292929;
  --card-foreground: #e2e8f0;
  --sidebar-primary: #006239;
  --muted-foreground: #a2a2a2;
  --accent-foreground: #fafafa;
  --popover-foreground: #a9a9a9;
  --primary-foreground: #dde8e3;
  --sidebar-foreground: #898989;
  --secondary-foreground: #fafafa;
  --destructive-foreground: #ede9e8;
  --sidebar-accent-foreground: #fafafa;
  --sidebar-primary-foreground: #dde8e3;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  overflow: hidden;
}

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur) var(--shadow-spread) rgba(var(--shadow-color), var(--shadow-opacity));
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo img {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 900;
  font-family: 'Poppins', sans-serif;
  color: var(--logo);
  letter-spacing: var(--letter-spacing);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  background-color: var(--accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: color-mix(in srgb, var(--primary) 90%, black);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--muted);
}

.btn-danger {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border-color: var(--destructive);
}

.btn-danger:hover {
  background-color: color-mix(in srgb, var(--destructive) 90%, black);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-group {
  display: flex;
  gap: 0.25rem;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group .btn.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Main Layout */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid var(--sidebar-border);
}

.panel {
  padding: 1rem;
}

.panel-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Template Section */
.template-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.template-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: var(--accent);
}

.tab-btn.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.template-item {
  aspect-ratio: 3/4;
  background-color: var(--muted);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.template-item:hover {
  border-color: var(--ring);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 227, 173, 0.3);
}

.template-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-item .template-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem;
  font-size: 0.6875rem;
  text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  overflow: hidden;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem;
  overflow: auto;
  min-height: 0;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur) var(--shadow-spread) rgba(var(--shadow-color), var(--shadow-opacity));
}

.canvas-toolbar span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  min-width: 50px;
  text-align: center;
}

.canvas-container {
  position: relative;
  background-color: #e5e5e5;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: auto;
  width: 100%;
  height: 100%;
  min-height: 600px;
}

.card-canvas {
  position: relative;
  background-color: var(--card);
  overflow: hidden;
  transform-origin: top left;
  will-change: transform;
}

.canvas-info {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Canvas Elements */
.canvas-element {
  position: absolute;
  cursor: move;
  user-select: none;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.canvas-element:hover {
  border-color: var(--ring);
}

.canvas-element.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 227, 173, 0.3);
  z-index: 1000 !important;
}

.canvas-element .resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border: 1px solid white;
  border-radius: 50%;
  display: none;
}

.canvas-element.selected .resize-handle {
  display: block;
}

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

.canvas-text {
  padding: 0.5rem;
  min-width: 50px;
  min-height: 30px;
}

.canvas-text[contenteditable="true"] {
  cursor: text;
  outline: none;
  border-color: var(--primary);
}

.canvas-image, .canvas-sticker {
  overflow: hidden;
}

.canvas-image img, .canvas-sticker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Property Panel */
.prop-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.prop-section:last-child {
  border-bottom: none;
}

.prop-group {
  margin-bottom: 0.875rem;
}

.prop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.prop-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.375rem;
}

/* Form Inputs */
.text-input,
.select-input,
.number-input,
.textarea-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  transition: all 0.2s ease;
}

.text-input:focus,
.select-input:focus,
.number-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(114, 227, 173, 0.2);
}

.textarea-input {
  resize: vertical;
  min-height: 80px;
}

.color-picker {
  width: 100%;
  height: 36px;
  padding: 0.25rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.range-input {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--muted);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.range-value {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Gradient Presets */
.gradient-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gradient-preset {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gradient-preset:hover {
  border-color: var(--ring);
  transform: scale(1.05);
}

.gradient-preset.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(114, 227, 173, 0.3);
}

/* Image Upload */
.image-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-upload:hover {
  border-color: var(--ring);
  background-color: var(--accent);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

/* Add Elements */
.add-elements {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 1rem 0.5rem;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-btn:hover {
  background-color: var(--accent);
  border-color: var(--ring);
  color: var(--foreground);
}

.add-btn svg {
  color: var(--primary);
}

.prop-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.prop-actions .btn {
  flex: 1;
}

/* Batch Section */
.batch-section {
  background-color: var(--card);
  border-top: 1px solid var(--border);
  max-height: 200px;
  transition: max-height 0.3s ease;
}

.batch-section.collapsed {
  max-height: 48px;
}

.batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.batch-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
}

.batch-content {
  padding: 0 1rem 1rem;
  overflow: auto;
}

.batch-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.batch-table-wrapper {
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.batch-table th,
.batch-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.batch-table th {
  background-color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.batch-table input {
  width: 100%;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--input);
  color: var(--foreground);
}

.batch-table input:focus {
  outline: none;
  border-color: var(--ring);
}

.batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--muted);
}

::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 1200px) {
  .sidebar {
    width: 240px;
  }
}

@media (max-width: 992px) {
  .main {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
  }
  
  .sidebar-right {
    border-left: none;
    border-top: 1px solid var(--sidebar-border);
  }
  
  .template-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  .header {
    padding: 0.5rem 1rem;
  }
  
  .logo-text {
    font-size: 0.9375rem;
  }
  
  .btn span {
    display: none;
  }
  
  .template-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Template List Item */
.template-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-list-item:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.template-list-item span {
  font-size: 0.875rem;
  color: var(--foreground);
}

.template-list-item .delete-template {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.template-list-item:hover .delete-template {
  opacity: 1;
}

/* Template Preview */
.template-preview {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

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

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

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

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

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Panel Toggle Buttons */
.panel-toggle {
  position: fixed;
  z-index: 200;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel-toggle:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.panel-toggle.left {
  left: 280px;
  top: 50%;
  transform: translateY(-50%);
}

.panel-toggle.left.collapsed {
  left: 0;
}

.panel-toggle.right {
  right: 280px;
  top: 50%;
  transform: translateY(-50%);
}

.panel-toggle.right.collapsed {
  right: 0;
}

.panel-toggle.bottom {
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}

.panel-toggle.bottom.collapsed {
  bottom: 0;
  transform: translateX(-50%) rotate(0deg);
}

/* Collapsed Sidebar States */
.sidebar.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border: none;
}

.batch-section.collapsed {
  max-height: 48px;
}

.batch-section.collapsed .batch-content {
  display: none;
}

/* Card Navigator */
.card-navigator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--card);
  border-top: 1px solid var(--border);
}

.card-indicator {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  min-width: 60px;
  text-align: center;
}

/* Background Position Grid */
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: fit-content;
}

.position-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.position-btn:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.position-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Font Actions */
.font-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.font-actions .btn {
  flex: 1;
  font-size: 0.75rem;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

/* Element Scale Handle */
.canvas-element .scale-info {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  font-size: 11px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.canvas-element.selected .scale-info {
  opacity: 1;
}

/* Loading State */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
