:root {
  /* Colors */
  --bg-deep: #0F0F14;
  --bg-panel: rgba(24, 24, 31, 0.8);
  --bg-surface: #1C1C26;
  --bg-elevated: #2A2A38;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.3);
  
  --accent-primary: #7C3AED; /* Purple */
  --accent-secondary: #0EA5E9; /* Blue */
  --accent-gradient: linear-gradient(135deg, #7C3AED 0%, #0EA5E9 100%);
  
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  /* Spacing & Radius */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Effects */
  --glass-blur: blur(12px);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }

/* Scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 10px; }

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

/* Header */
header {
  height: 64px;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  z-index: 100;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.project-title:hover {
  background: var(--bg-elevated);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

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

/* Sidebar Navigation */
.sidebar-nav {
  width: 80px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) 0;
  gap: var(--space-sm);
}

.nav-item {
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.nav-item.active {
  color: var(--accent-primary);
}

/* Assets Panel */
.assets-panel {
  width: 320px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
}

.search-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  width: 100%;
  margin-bottom: var(--space-md);
}

.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  overflow-y: auto;
}

.asset-card {
  aspect-ratio: 1;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.asset-card:hover {
  border-color: var(--accent-primary);
}

.asset-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

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

.viewport-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
}

.video-preview {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(255,255,255,0.1);
  pointer-events: none;
}

.viewport-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: 1px solid var(--border-subtle);
}

/* Timeline Section */
.timeline-container {
  height: 280px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.timeline-toolbar {
  height: 48px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  justify-content: space-between;
}

.timeline-tracks {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: var(--space-sm) 0;
}

.track-row {
  height: 48px;
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: relative;
}

.track-label {
  width: 120px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  padding-left: var(--space-md);
  font-size: 11px;
  color: var(--text-muted);
  border-right: 1px solid var(--border-subtle);
  position: sticky;
  left: 0;
  z-index: 10;
}

.track-content {
  flex: 1;
  position: relative;
  background-image: linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 100px 100%;
}

.clip {
  position: absolute;
  top: 4px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  cursor: grab;
  overflow: hidden;
}

.clip.video { border-left: 4px solid var(--accent-secondary); }
.clip.audio { border-left: 4px solid #10B981; }
.clip.text { border-left: 4px solid var(--accent-primary); }

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 350px;
  width: 2px;
  background: #EF4444;
  z-index: 20;
}

.playhead::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #EF4444;
  border-radius: 2px;
}

/* Properties Panel */
.properties-panel {
  width: 320px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
}

.prop-section {
  margin-bottom: var(--space-lg);
}

.prop-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: var(--space-sm);
  display: block;
}

.prop-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.prop-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-main);
  font-size: 12px;
  flex: 1;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent-primary);
}

/* AI Tools Overlay/Panel */
.ai-badge {
  background: var(--accent-gradient);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.ai-tool-card {
  padding: var(--space-md);
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.1), rgba(14, 165, 233, 0.1));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-tool-card:hover {
  transform: scale(1.02);
  border-color: var(--accent-secondary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none; /* Hidden by default */
}

.modal {
  background: var(--bg-surface);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

/* Placeholders */
.placeholder-image {
  background: linear-gradient(45deg, #1C1C26, #2A2A38);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
}
