/* ════════════════════════════════════════════════════════════════
   editors.css — Image Editor, Video Editor, Animation Creator
   ════════════════════════════════════════════════════════════════ */

/* ── Shared Editor Styles ────────────────────────────────────── */
.ed-toolbar {
  width: 44px; flex-shrink: 0;
  background: rgba(15,23,42,0.45);
  border-right: 1px solid rgba(59,130,246,0.12);
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px; gap: 4px;
}
.ed-tool {
  width: 34px; height: 34px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: #94a3b8; cursor: pointer; font-size: 13px;
  transition: all 150ms ease;
}
.ed-tool:hover { background: rgba(59,130,246,0.15); color: #e2e8f0; }
.ed-tool.active { background: rgba(59,130,246,0.25); color: #60a5fa; border-color: rgba(59,130,246,0.4); }
.ed-sep { width: 28px; border: none; border-top: 1px solid rgba(59,130,246,0.12); margin: 4px 0; }

.ed-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 6px; font-size: 12px;
  font-weight: 500; cursor: pointer; transition: all 150ms ease;
  border: 1px solid rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.15); color: #60a5fa;
}
.ed-btn:hover { background: rgba(59,130,246,0.25); }
.ed-btn-ai { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.3); color: #c084fc; }
.ed-btn-ai:hover { background: rgba(168,85,247,0.25); }
.ed-btn-save { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.ed-btn-save:hover { background: rgba(34,197,94,0.25); }
.ed-btn-danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.25); color: #f87171; }
.ed-btn-danger:hover { background: rgba(239,68,68,0.2); }

.ed-asset-name { font-size: 11px; font-weight: 400; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Canvas Area ─────────────────────────────────────────────── */
.ed-canvas-wrap {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  background-image:
    linear-gradient(45deg, rgba(51,65,85,0.15) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(51,65,85,0.15) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(51,65,85,0.15) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(51,65,85,0.15) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.ed-canvas-wrap canvas {
  max-width: 100%; max-height: 100%; display: block;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.ed-drop-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; color: #64748b; font-size: 13px;
  pointer-events: none;
}
.ed-drop-msg button { pointer-events: auto; }
.ed-drop-msg.hidden { display: none; }

/* ── Crop Overlay ────────────────────────────────────────────── */
.ed-crop-overlay {
  position: absolute; border: 2px dashed rgba(59,130,246,0.7);
  background: rgba(59,130,246,0.08); pointer-events: none; z-index: 5;
}

/* ── Properties Panel ────────────────────────────────────────── */
.ed-props {
  width: 200px; flex-shrink: 0; overflow-y: auto;
  background: rgba(15,23,42,0.5);
  border-left: 1px solid rgba(59,130,246,0.12);
  padding: 10px;
}
.ed-props-title {
  font-size: 10px; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px; margin-top: 12px;
}
.ed-props-title:first-child { margin-top: 0; }
.ed-slider-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.ed-slider-label {
  width: 20px; font-size: 10px; color: #94a3b8; flex-shrink: 0;
  text-align: right;
}
.ed-slider-val {
  width: 32px; font-size: 10px; color: #94a3b8; text-align: right; flex-shrink: 0;
  font-family: 'Fira Code', monospace;
}
.ed-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: rgba(51,65,85,0.6); outline: none;
}
.ed-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: #3b82f6; cursor: pointer;
  border: 2px solid rgba(15,23,42,0.8);
}
.ed-input {
  width: 100%; padding: 5px 8px; border-radius: 4px;
  background: rgba(30,41,59,0.6); border: 1px solid rgba(59,130,246,0.15);
  color: #e2e8f0; font-size: 12px; outline: none;
  font-family: inherit;
}
.ed-input:focus { border-color: rgba(59,130,246,0.4); }
.ed-color-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ed-color-input {
  width: 28px; height: 28px; border: 1px solid rgba(59,130,246,0.2);
  border-radius: 4px; cursor: pointer; background: transparent;
  padding: 0;
}

/* ── Status Bar ──────────────────────────────────────────────── */
.ed-status {
  height: 28px; flex-shrink: 0; display: flex; align-items: center;
  padding: 0 10px; gap: 12px;
  font-size: 10px; color: #64748b;
  background: rgba(15,23,42,0.5);
  border-top: 1px solid rgba(59,130,246,0.1);
  font-family: 'Fira Code', monospace;
}

/* ── Video Editor ────────────────────────────────────────────── */
.ve-player { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ve-player video { width: 100%; max-height: 60%; object-fit: contain; background: #000; }
.ve-timeline {
  height: 60px; background: rgba(15,23,42,0.45);
  border-top: 1px solid rgba(59,130,246,0.12);
  position: relative; margin: 8px 10px;
  border-radius: 6px; overflow: hidden;
}
.ve-timeline-bar {
  position: absolute; top: 0; height: 100%;
  background: rgba(59,130,246,0.15);
  border-left: 3px solid #3b82f6;
  border-right: 3px solid #3b82f6;
  cursor: grab;
}
.ve-handle {
  position: absolute; top: 0; width: 12px; height: 100%;
  background: #3b82f6; cursor: ew-resize; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.ve-handle::after { content: ''; width: 2px; height: 20px; background: rgba(255,255,255,0.5); border-radius: 1px; }
.ve-handle-start { left: 0; border-radius: 6px 0 0 6px; }
.ve-handle-end { right: 0; border-radius: 0 6px 6px 0; }
.ve-controls {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
}
.ve-time {
  font-family: 'Fira Code', monospace; font-size: 11px; color: #94a3b8;
}

/* ── Animation Creator ───────────────────────────────────────── */
.ac-frames {
  width: 200px; flex-shrink: 0; overflow-y: auto;
  background: rgba(15,23,42,0.5);
  border-right: 1px solid rgba(59,130,246,0.12);
  padding: 8px;
}
.ac-frame-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px; border-radius: 4px; cursor: pointer;
  margin-bottom: 4px; border: 1px solid transparent;
  transition: all 150ms ease;
}
.ac-frame-item:hover { background: rgba(59,130,246,0.08); }
.ac-frame-item.active { border-color: rgba(59,130,246,0.4); background: rgba(59,130,246,0.12); }
.ac-frame-thumb {
  width: 48px; height: 36px; border-radius: 3px; overflow: hidden;
  background: rgba(0,0,0,0.3); flex-shrink: 0;
}
.ac-frame-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ac-frame-info { flex: 1; min-width: 0; }
.ac-frame-name { font-size: 11px; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-frame-dur { font-size: 10px; color: #64748b; }
.ac-preview {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); position: relative;
}
.ac-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ac-play-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; border-top: 1px solid rgba(59,130,246,0.12);
}

/* ── Editor widgets use semi-transparent bg ──────────────────── */
#image-editor-widget,
#video-editor-widget,
#animation-creator-widget,
#lora-trainer-widget {
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
