/* ============ CSS Variables ============ */
:root {
  /* Colors - Dark theme with vibrant accents */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-elevated: #22222f;
  --bg-hover: #2a2a3a;
  
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  
  --accent-primary: #ff3366;
  --accent-secondary: #ff6b35;
  --accent-gradient: linear-gradient(135deg, #ff3366 0%, #ff6b35 100%);
  
  --success: #00d68f;
  --warning: #ffaa00;
  --error: #ff4757;
  --info: #3366ff;
  --ignored: #8b5cf6;
  
  --border-color: #2a2a3a;
  --border-light: #3a3a4a;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(255, 51, 102, 0.3);
  
  /* Typography */
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
  
  /* Layout */
  --header-height: 56px;
  --sidebar-width: 320px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 51, 102, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(51, 102, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}

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

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

/* ============ Header ============ */
.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  flex-shrink: 0;
}

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

.logo {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo svg {
  width: 18px;
  height: 18px;
  color: white;
}

.header-brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.version {
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent-gradient);
  color: white;
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

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

.btn-accent:hover {
  box-shadow: var(--shadow-glow);
}

.btn-success {
  background: var(--success);
  color: white;
}

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

.btn-small {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

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

.btn-icon.btn-large {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  color: white;
  border-radius: var(--radius-full);
}

.btn-icon.btn-large:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

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

.btn.authenticated {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* ============ Main Layout ============ */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--header-height));
}

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.sidebar-section {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-section-channel {
  flex-shrink: 0;
}

.sidebar-section-videos {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sidebar-section h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

/* Search Box */
.search-box {
  display: flex;
  gap: var(--space-xs);
}

.search-box input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  font-size: 0.85rem;
}

.search-box input:focus {
  border-color: var(--accent-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Video Search Box */
.video-search-box {
  position: relative;
  margin-bottom: var(--space-sm);
}

.video-search-box input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  padding-right: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  font-size: 0.8rem;
}

.video-search-box input:focus {
  border-color: var(--accent-primary);
}

.video-search-box input::placeholder {
  color: var(--text-muted);
}

.video-search-box svg {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Channel Results */
.channel-results {
  margin-top: var(--space-sm);
  max-height: 180px;
  overflow-y: auto;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.channel-item img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.channel-item-info {
  flex: 1;
  min-width: 0;
}

.channel-item-info h4 {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-item-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Selected Channel */
.selected-channel {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.selected-channel img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.selected-channel-info {
  flex: 1;
}

.selected-channel-info h4 {
  font-weight: 600;
  font-size: 0.85rem;
}

.selected-channel-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.selected-channel .clear-btn {
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.selected-channel .clear-btn:hover {
  color: var(--error);
  background: rgba(255, 71, 87, 0.1);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 2px;
}

.filter-tab {
  flex: 1;
  padding: 6px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent-gradient);
  color: white;
}

/* Video List */
.video-list {
  flex: 1;
  overflow-y: auto;
  margin: 0 calc(var(--space-md) * -1);
  padding: 0 var(--space-md);
}

.video-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-xs);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  position: relative;
}

.video-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.video-item.active {
  border-color: var(--accent-primary);
  background: rgba(255, 51, 102, 0.1);
}

.video-item.finished {
  border-left: 3px solid var(--success);
}

.video-item.ignored {
  opacity: 0.6;
  border-left: 3px solid var(--ignored);
}

.video-item-thumb {
  width: 80px;
  height: 45px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

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

.video-item-thumb .duration {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.85);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
}

.video-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-item-info h4 {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-item-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.video-item-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
}

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

.video-item-actions button {
  width: 24px;
  height: 24px;
  padding: 0;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-item-actions button:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.video-item-actions button svg {
  width: 14px;
  height: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 500;
}

.status-badge.finished {
  background: rgba(0, 214, 143, 0.2);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
}

.status-badge.ignored {
  background: rgba(139, 92, 246, 0.2);
  color: var(--ignored);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.8rem;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  flex-shrink: 0;
}

#page-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============ Editor Area ============ */
.editor-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  min-width: 0;
}

.editor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.placeholder-content {
  color: var(--text-muted);
}

.placeholder-content svg {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.placeholder-content h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

.placeholder-content p {
  font-size: 0.85rem;
}

/* Video Editor - Split Layout */
.video-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  height: 100%;
}

.editor-split {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  min-height: 0;
}

.editor-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.editor-right {
  width: 340px;
  flex-shrink: 0;
}

/* Player Container */
.player-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

/* Download Status Overlay */
.download-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  gap: var(--space-md);
}

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

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

.download-status p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  background: black;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  gap: var(--space-md);
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.time-display .separator {
  color: var(--text-muted);
  margin: 0 2px;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.play-icon, .pause-icon {
  width: 22px;
  height: 22px;
}

/* Timeline */
.timeline-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.timeline {
  position: relative;
  height: 50px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 51, 102, 0.15);
  pointer-events: none;
}

.timeline-cursor {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--accent-primary);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 8px var(--accent-primary);
}

.timeline-seams {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.seam-marker {
  position: absolute;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--warning);
  cursor: grab;
  z-index: 5;
  transform: translateX(-2px);
}

.seam-marker:hover {
  background: var(--accent-secondary);
}

.seam-marker.start {
  background: var(--success);
  cursor: default;
}

.seam-marker::before {
  content: attr(data-index);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.segment-block {
  position: absolute;
  top: 8px;
  bottom: 8px;
  background: rgba(51, 102, 255, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: white;
  pointer-events: none;
}

.segment-block:nth-child(odd) {
  background: rgba(255, 51, 102, 0.25);
}

/* Segments Panel */
.segments-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.panel-actions {
  display: flex;
  gap: var(--space-xs);
}

.segments-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.empty-segments {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.segment-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.segment-card:hover {
  border-color: var(--border-light);
}

.segment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.segment-card-header .segment-number {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.segment-card-header .segment-duration {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.segment-card-header .segment-duration.warning {
  color: var(--warning);
}

.segment-card input {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  margin-bottom: var(--space-xs);
}

.segment-card input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.segment-card-times {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: var(--space-xs);
}

.segment-card-actions {
  display: flex;
  gap: var(--space-xs);
}

.segment-card-actions button {
  flex: 1;
  padding: var(--space-xs);
  font-size: 0.7rem;
}

/* Preview Section */
.preview-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.preview-section .section-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.preview-content {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
}

.preview-video-wrapper {
  flex: 1;
  background: black;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-video-wrapper video {
  width: 100%;
  display: block;
}

.preview-info {
  width: 200px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.preview-info p {
  margin-bottom: var(--space-xs);
}

/* Upload Section */
.upload-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.upload-section .section-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.upload-section .section-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.upload-auth-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

.upload-auth-message svg {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.upload-auth-message p {
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
}

.upload-controls {
  padding: var(--space-md);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-group label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.8rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-row {
  display: flex;
  gap: var(--space-sm);
}

.form-row .form-group {
  flex: 1;
}

.segments-upload-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-height: 200px;
  overflow-y: auto;
}

.segment-upload-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.segment-upload-item .segment-info {
  flex: 1;
}

.segment-upload-item .segment-name {
  font-weight: 500;
  font-size: 0.8rem;
}

.segment-upload-item .segment-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.segment-upload-item .upload-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.segment-upload-item .upload-status.pending {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
}

.segment-upload-item .upload-status.success {
  background: rgba(0, 214, 143, 0.2);
  color: var(--success);
}

/* ============ Toast Notifications ============ */
.toast-container {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  z-index: 1000;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--error); }
.toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.8rem;
}

.toast-message {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.toast-close:hover {
  color: var(--text-primary);
}

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

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .editor-right {
    width: 280px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 280px;
  }
  
  .editor-split {
    flex-direction: column;
  }
  
  .editor-right {
    width: 100%;
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .main {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-height: 40vh;
  }
  
  .header-brand h1 {
    display: none;
  }
}
