/* studio_app/css/editor.css */
/* Fullscreen Studio Workspace, Professional Multi-Track Editor, Motion Graphics & Montage Engine */

#editor-workspace {
  position: fixed;
  inset: 0;
  background: #090c14;
  color: var(--text-main);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

#editor-workspace.active {
  display: flex;
}

/* 1. TOPBAR */
.editor-topbar {
  height: 52px;
  background: rgba(13, 17, 28, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 12px;
}

.editor-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Cost Meter Badge */
.cost-meter-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.cost-meter-badge:hover {
  background: rgba(16, 185, 129, 0.2);
}

/* Aspect Ratio Selector */
.ratio-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border-glass);
}

.ratio-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--trans-fast);
}

.ratio-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 85, 255, 0.3);
}

/* Mode Switcher */
.mode-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  padding: 3px;
  border: 1px solid var(--border-glass);
}

.mode-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--trans-fast);
}

.mode-btn.active {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

/* 2. MAIN WORKSPACE BODY */
.editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Left Dock */
.editor-dock {
  width: 380px;
  background: rgba(13, 17, 28, 0.7);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.dock-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
}

.dock-tab-btn {
  flex: 1;
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.dock-tab-btn.active {
  color: var(--text-main);
  border-bottom-color: var(--primary);
  background: rgba(255, 255, 255, 0.03);
}

.dock-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Center Canvas / Preview Player */
.editor-canvas-container {
  flex: 1;
  background: #05070d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 16px;
}

/* Canvas View Mode Switcher (Original vs Versión IA) */
.canvas-view-switcher {
  display: flex;
  background: rgba(13, 17, 28, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 12px;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.view-mode-btn {
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 16px;
  transition: all var(--trans-fast);
}

.view-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 85, 255, 0.35);
}

.preview-stage {
  position: relative;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Aspect Ratio Frames */
.preview-stage[data-ratio="9:16"] {
  width: 270px;
  height: 480px;
}

.preview-stage[data-ratio="16:9"] {
  width: 640px;
  height: 360px;
}

.preview-stage[data-ratio="1:1"] {
  width: 380px;
  height: 380px;
}

.preview-stage[data-ratio="4:5"] {
  width: 320px;
  height: 400px;
}

.preview-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease-out;
}

/* Visual Motion Zoom Classes */
.preview-video-element.zoom-punch {
  transform: scale(1.15);
}

.preview-video-element.zoom-slow {
  transform: scale(1.08);
}

.preview-video-element.shake-cut {
  animation: cameraShake 0.25s ease;
}

@keyframes cameraShake {
  0% { transform: translate(0, 0) scale(1.05); }
  25% { transform: translate(-3px, 3px) scale(1.05); }
  50% { transform: translate(3px, -2px) scale(1.05); }
  75% { transform: translate(-2px, -2px) scale(1.05); }
  100% { transform: translate(0, 0) scale(1.05); }
}

/* Flash Transition Layer */
.canvas-flash-layer {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
  z-index: 40;
}

.canvas-flash-layer.active {
  opacity: 0.85;
  transition: none;
}

/* Canvas Overlays & Kinetic Typography */
.canvas-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
}

/* Watermark Badge */
.canvas-watermark {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 85, 255, 0.9), rgba(37, 99, 235, 0.9));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 85, 255, 0.4);
}

/* Kinetic Title Overlay */
.canvas-kinetic-title {
  align-self: center;
  max-width: 90%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  padding: 8px 14px;
  border-radius: 8px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kinetic-pop {
  animation: kineticPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes kineticPop {
  0% { transform: scale(0.6) translateY(20px); opacity: 0; }
  70% { transform: scale(1.08) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* CTA Card / Badge */
.canvas-cta-pill {
  align-self: center;
  background: linear-gradient(135deg, #ff2244, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(255, 34, 68, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: pulseCta 1.5s infinite;
}

@keyframes pulseCta {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Missing Material Overlay Indicator */
.canvas-missing-material-card {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #fff;
  z-index: 25;
}

/* Transport Controls Bar */
.transport-bar {
  width: 100%;
  max-width: 640px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(13, 17, 28, 0.8);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
}

.timecode-display {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 4px;
}

/* Right Inspector Panel */
.editor-inspector {
  width: 280px;
  background: rgba(13, 17, 28, 0.7);
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inspector-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* 3. MULTI-TRACK TIMELINE */
.editor-timeline-panel {
  height: 260px;
  background: #080b12;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.timeline-toolbar {
  height: 38px;
  background: rgba(13, 17, 28, 0.95);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.timeline-tools-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-icon-btn {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.tool-icon-btn:hover {
  background: var(--primary);
  color: #fff;
}

.tool-icon-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 85, 255, 0.4);
}

/* Timeline Scrollable View */
.timeline-scroll-area {
  flex: 1;
  display: flex;
  overflow: auto;
  position: relative;
}

/* Track Headers Column */
.track-headers-col {
  width: 190px;
  background: rgba(13, 17, 28, 0.9);
  border-right: 1px solid var(--border-glass);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 20;
}

.ruler-header-space {
  height: 24px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.4);
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  padding-left: 8px;
}

.track-header-item {
  height: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Track Lanes Area */
.track-lanes-area {
  flex: 1;
  min-width: 800px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Time Ruler */
.time-ruler {
  height: 24px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-glass);
  position: relative;
  cursor: pointer;
}

.ruler-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 9px;
  color: var(--text-dim);
  padding-left: 4px;
}

/* Track Lane Row */
.track-lane-row {
  height: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  background: rgba(255, 255, 255, 0.01);
}

.track-lane-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Clips on Timeline */
.timeline-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 0 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: grab;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.timeline-clip.active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5);
}

.timeline-clip.overlay-clip {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.timeline-clip.text-clip {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.timeline-clip.pinpi-clip {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.timeline-clip.music-clip {
  background: linear-gradient(135deg, #059669, #10b981);
}

.timeline-clip.missing-material-clip {
  background: repeating-linear-gradient(45deg, #334155, #334155 10px, #475569 10px, #475569 20px);
  border: 1px dashed #94a3b8;
  color: #cbd5e1;
}

/* Playhead */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 50;
  pointer-events: none;
}

.playhead-handle {
  position: absolute;
  top: 0;
  left: -6px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
  pointer-events: auto;
  cursor: ew-resize;
}

/* 4. CREATIVE PROPOSALS */
.proposal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  transition: all var(--trans-fast);
}

.proposal-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 85, 255, 0.4);
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.proposal-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-viral { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-premium { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-doc { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-ai { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.tag-real {
  display: inline-block;
  background: rgba(0, 85, 255, 0.15);
  color: #60a5fa;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 85, 255, 0.3);
}

.tag-ai-illus {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
