/* Asset Workspace Styles */

.asset-workspace-tabs {
  position: fixed;
  top: calc(var(--navbar-min-height) + var(--gallery-nav-min-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 997;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  max-width: 1200px;
  border-bottom: 2px solid #e5e5e5;
  padding: 8px 20px 0 20px;
  backdrop-filter: blur(10px);
}

.asset-tabs-left {
  display: flex;
  gap: 10px;
}

.asset-tabs-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-bottom: 14px;
}

@media (max-width: 768px) {
  .asset-tabs-right {
    display: none;
  }
}

.asset-tabs-right .gallery-count {
  font-size: 11px;
  color: #666;
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  line-height: 1;
}

[data-theme="dark"] .asset-tabs-right .gallery-count {
  color: #aaa;
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .asset-workspace-tabs {
  background: rgba(13, 13, 13, 0.95);
  border-bottom-color: #333;
}

.asset-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

[data-theme="dark"] .asset-tab {
  color: #999;
}

.asset-tab:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .asset-tab:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.05);
}

.asset-tab.active {
  color: #4a9eff;
  border-bottom-color: #4a9eff;
}

.asset-tab i {
  font-size: 16px;
}

/* Asset Workspace View */
.asset-workspace-view {
  min-height: 400px;
  padding-bottom: 30px; /* Added bottom padding to prevent content being covered by gen_palette */
  position: relative; /* Allow absolute positioning of action bar */
  display: flex;
  flex-direction: column;
  width: 100%;
}

.asset-workspace-view.hidden {
  display: none;
}

/* Asset Grid */
.asset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  position: relative; /* Allow absolute positioning of action bar */
  justify-content: flex-start;
}

/* Add padding-right to video grids to make space for reference videos */
.asset-grid:has(.reference-videos-section) {
  padding-right: 280px;
}

/* Asset Card */
.asset-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 210px;
  flex-shrink: 0;
}

[data-theme="dark"] .asset-card {
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.asset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .asset-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.asset-card.selected {
  border-color: #4a9eff;
}

/* Asset Thumbnail */
.asset-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  background: #f5f5f5;
  overflow: hidden;
  /* Override global box-sizing to fix layout calculations */
  box-sizing: content-box;
}

[data-theme="dark"] .asset-thumbnail {
  background: #0d0d0d;
}

.asset-image,
.asset-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Override global box-sizing to fix layout calculations */
  box-sizing: content-box;
}

/* Asset Status Badge */
.asset-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.draft {
  background: rgba(108, 117, 125, 0.9);
  color: white;
}

.badge.pending_review {
  background: rgba(255, 193, 7, 0.9);
  color: #333;
}

.badge.approved {
  background: rgba(40, 167, 69, 0.9);
  color: white;
}

.badge.rejected {
  background: rgba(220, 53, 69, 0.9);
  color: white;
}

/* Asset Overlay Info */
.asset-overlay-info {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 6px 8px;
  color: white;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.asset-overlay-date,
.asset-overlay-duration,
.asset-overlay-rating {
  display: flex;
  align-items: center;
  gap: 3px;
}

.asset-overlay-rating i {
  color: #ffc107;
}

/* Asset Actions */
.asset-actions {
  display: flex;
  gap: 8px;
}

.asset-action-btn {
  background: none;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

[data-theme="dark"] .asset-action-btn {
  border-color: #333;
  color: #999;
}

.asset-action-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

[data-theme="dark"] .asset-action-btn:hover {
  background: #2a2a2a;
  border-color: #555;
  color: #f0f0f0;
}

.asset-action-btn i {
  font-size: 14px;
}

/* Empty State */
.asset-workspace-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #999;
  text-align: center;
}

[data-theme="dark"] .asset-workspace-empty {
  color: #666;
}

.asset-workspace-empty i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.asset-workspace-empty p {
  margin: 8px 0;
  font-size: 16px;
}

.asset-workspace-empty .text-muted {
  font-size: 14px;
  opacity: 0.7;
}

/* Override main content for grid layout */
.shot-main-content {
  min-height: 400px;
  padding: 20px 0 0 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
}


/* Keyframe Section */
.keyframe-section {
  display: flex;
  gap: 20px;
  align-items: start;
  position: relative;
}

.keyframe-label {
  position: absolute;
  left: -30px;
  top: 50%;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #6c757d;
  padding: 8px 0;
  flex-shrink: 0;
  transform: translateY(-50%) rotate(180deg);
}

[data-theme="dark"] .keyframe-label {
  color: #adb5bd;
}

/* Reference Videos Section */
.reference-videos-section {
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reference-videos-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #6c757d;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

[data-theme="dark"] .reference-videos-label {
  color: #adb5bd;
  border-bottom-color: #495057;
}

/* Asset cards within reference videos section should be full width */
.reference-videos-section .asset-card {
  width: 100%;
}

/* Primary asset wrapper with border and padding */
.primary-asset-wrapper {
  border: 2px solid #dee2e6;
  border-radius: 16px;
  padding: 8px;
  background: rgba(248, 249, 250, 0.8);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 12px;
  align-items: stretch;
  height: 128px;
}

[data-theme="dark"] .primary-asset-wrapper {
  border-color: #495057;
  background: rgba(108, 117, 125, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.primary-asset-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
}

/* Hide overlay info in keyframes */
.keyframe-section .asset-overlay-info {
  display: none;
}

/* Make keyframe thumbnails less tall */
.keyframe-section .asset-card {
  width: 180px;
}

.keyframe-section .asset-thumbnail {
  height: 100px;
}


/* End Frame Drop Zone */
.end-frame-drop-zone {
  flex-shrink: 0;
  width: 110px;
}

.end-frame-placeholder {
  border: 2px dashed #dee2e6;
  border-radius: 16px;
  padding: 10px;
  height: 105px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6c757d;
  background: rgba(248, 249, 250, 0.4);
  transition: all 0.2s ease;
}

.end-frame-placeholder:hover {
  border-color: #adb5bd;
  background: rgba(248, 249, 250, 0.6);
}

.end-frame-placeholder i {
  font-size: 1.25rem;
  margin-bottom: 0;
  opacity: 0.5;
}

.end-frame-placeholder p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

[data-theme="dark"] .end-frame-placeholder {
  border-color: #495057;
  background: rgba(108, 117, 125, 0.1);
  color: #adb5bd;
}

[data-theme="dark"] .end-frame-placeholder:hover {
  border-color: #6c757d;
  background: rgba(108, 117, 125, 0.2);
}

/* Empty primary asset state */
.primary-asset-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #6c757d;
  min-height: 120px;
  height: 100%;
}

.primary-asset-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.primary-asset-empty p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

[data-theme="dark"] .primary-asset-empty {
  color: #999;
}

/* Dialogue List Container */
.dialogue-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 400px;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  margin: 0;
}

/* Dialogue Row Styles - Compact Table-like Layout */
.dialogue-row {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  position: relative;
}

[data-theme="dark"] .dialogue-row {
  background: #1a1a1a;
  border-color: #333;
}

.dialogue-row:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

[data-theme="dark"] .dialogue-row:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dialogue-row.selected {
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Generating audio state */
.dialogue-row.generating-audio {
  background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-color: #4a9eff;
  opacity: 0.8;
  cursor: default;
}

[data-theme="dark"] .dialogue-row.generating-audio {
  background: linear-gradient(90deg, #1a1a1a 0%, #252525 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  border-color: #4a9eff;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.dialogue-generating-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #4a9eff;
}

.dialogue-generating-spinner i {
  font-size: 20px;
  animation: spin 1s linear infinite;
}

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

/* Stacked card effect for alternate takes */
.dialogue-row.has-one-alternate {
  margin-bottom: 12px;
}

.dialogue-row.has-one-alternate::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 4px;
  right: 4px;
  height: 100%;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  z-index: -1;
}

.dialogue-row.has-multiple-alternates {
  margin-bottom: 16px;
}

.dialogue-row.has-multiple-alternates::before,
.dialogue-row.has-multiple-alternates::after {
  content: '';
  position: absolute;
  height: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  z-index: -1;
}

.dialogue-row.has-multiple-alternates::before {
  bottom: -4px;
  left: 4px;
  right: 4px;
  background: #f5f5f5;
}

.dialogue-row.has-multiple-alternates::after {
  bottom: -8px;
  left: 8px;
  right: 8px;
  background: #fafafa;
}

[data-theme="dark"] .dialogue-row.has-one-alternate::before,
[data-theme="dark"] .dialogue-row.has-multiple-alternates::before {
  background: #151515;
  border-color: #2a2a2a;
}

[data-theme="dark"] .dialogue-row.has-multiple-alternates::after {
  background: #0f0f0f;
  border-color: #2a2a2a;
}

/* Metadata Row (Top) */
.dialogue-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
  font-size: 12px;
}

[data-theme="dark"] .dialogue-meta-row {
  background: #0d0d0d;
  border-bottom-color: #333;
}

.dialogue-meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialogue-meta-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialogue-row .dialogue-character {
  color: #4a9eff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .dialogue-row .dialogue-character {
  color: #6bb3ff;
}

.dialogue-sequence {
  color: #999;
  font-weight: 500;
}

.dialogue-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.dialogue-status.badge.draft {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.dialogue-status.badge.approved {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.dialogue-status.badge.needs_review {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.dialogue-row .dialogue-duration-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.dialogue-row .dialogue-duration {
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
  flex-shrink: 0;
  position: static;
  background: none;
  padding: 0;
  border-radius: 0;
  order: 2;
}

[data-theme="dark"] .dialogue-row .dialogue-duration {
  color: #999;
}

.dialogue-row .dialogue-duration i {
  font-size: 10px;
}

.dialogue-row .dialogue-date {
  color: #999;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.2s ease;
  order: 1;
}

.dialogue-row .dialogue-duration-wrapper:hover .dialogue-date {
  opacity: 1;
  max-width: 150px;
  margin-right: 8px;
}

/* Content Row (Bottom) */
.dialogue-content-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.dialogue-play-control {
  flex-shrink: 0;
}

.dialogue-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4a9eff;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dialogue-play-btn:hover {
  background: #3a8eef;
  transform: scale(1.1);
}

.dialogue-play-btn:active {
  transform: scale(0.95);
}

.dialogue-play-btn i {
  font-size: 14px;
  margin-left: 2px; /* Compensate for play icon visual centering */
}

.dialogue-no-audio-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

[data-theme="dark"] .dialogue-no-audio-icon {
  background: #2a2a2a;
  color: #666;
}

.dialogue-text {
  flex: 1;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

[data-theme="dark"] .dialogue-text {
  color: #f0f0f0;
}

/* Has audio indicator */
.dialogue-row.has-audio {
  border-left: 3px solid #4a9eff;
}

.dialogue-row.has-audio .dialogue-meta-row {
  background: rgba(74, 158, 255, 0.05);
}

[data-theme="dark"] .dialogue-row.has-audio .dialogue-meta-row {
  background: rgba(74, 158, 255, 0.1);
}

/* Current asset type badge */
.asset-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.badge.current {
  background: rgba(74, 158, 255, 0.9);
  color: white;
}

/* Asset thumbnails sized appropriately */
.asset-thumbnail {
  aspect-ratio: 16/9;
  max-width: 100%;
}

/* Info tab content styling */
.shot-info-content {
  padding: 0 40px 0 0;
  max-width: 800px;
  margin: 0 auto;
}

.shot-info-content .shot-meta h2 {
  font-size: 24px;
  margin-bottom: 30px;
  color: #333;
  border-bottom: 2px solid #e5e5e5;
  padding-bottom: 15px;
}

[data-theme="dark"] .shot-info-content .shot-meta h2 {
  color: #f0f0f0;
  border-bottom-color: #333;
}

.shot-description-section {
  margin-bottom: 25px;
}

.shot-description-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .shot-description-section h3 {
  color: #999;
}

.shot-description {
  color: #666;
  line-height: 1.6;
  padding: 15px 20px;
  background: #f8f8f8;
  border-radius: 8px;
  border-left: 4px solid #4a9eff;
}

[data-theme="dark"] .shot-description {
  color: #ccc;
  background: #1a1a1a;
}

/* Generating Placeholder Styles */
.asset-card.generating .asset-thumbnail {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #c2185b, #1565c0, #283593, #6a1b9a, #c2185b);
  background-size: 400% 400%;
  animation: gradientUndulate 8s ease infinite;
}

[data-theme="dark"] .asset-card.generating .asset-thumbnail {
  background: linear-gradient(135deg, #880e4f, #0d47a1, #1a237e, #4a148c, #880e4f);
  background-size: 400% 400%;
}

@keyframes gradientUndulate {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 50% 75%;
  }
  50% {
    background-position: 100% 50%;
  }
  75% {
    background-position: 50% 25%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.generating-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.generating-state p {
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  margin: 0;
}

.asset-card.generating .asset-type-badge {
  z-index: 11;
}

.asset-card.generating .badge.generating {
  background: rgba(74, 158, 255, 0.95);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* No Image Placeholder Styles */
.asset-card.no-image .asset-thumbnail {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

[data-theme="dark"] .asset-card.no-image .asset-thumbnail {
  background: #0a0a0a;
}

.no-image-content {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  max-width: 100%;
}

.no-image-character {
  font-size: 14px;
  font-weight: 600;
  color: #4a9eff;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.no-image-dialogue {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

/* Empty State Card Styles */
.asset-card.empty-state-card {
  cursor: default;
}

.asset-card.empty-state-card:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .asset-card.empty-state-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.empty-state-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  padding: 0;
  aspect-ratio: 16 / 9;
}

[data-theme="dark"] .empty-state-thumbnail {
  background: #1a1a1a;
}

.empty-state-content-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  color: #999;
  width: 100%;
  height: 100%;
}

[data-theme="dark"] .empty-state-content-inline {
  color: #666;
}

.empty-state-content-inline i {
  font-size: 32px;
  margin-bottom: 4px;
  opacity: 0.5;
}

.empty-state-content-inline p {
  margin: 2px 0;
  font-size: 11px;
  line-height: 1.3;
}

.empty-state-content-inline .text-muted {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1.2;
}

/* Timeline View Styles */
.shot-timeline-container {
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
  border: 1px solid #dee2e6;

  /* Calculated timeline dimensions */
  --timeline-clip-width: calc(var(--timeline-duration) * var(--timeline-px-per-second));
  --timeline-end-marker: calc(var(--timeline-duration) * var(--timeline-px-per-second) + var(--timeline-left-shift));
}

[data-theme="dark"] .shot-timeline-container {
  background: transparent;
  border-color: #333;
}

/* Timeline Ruler */
.timeline-ruler {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  background: #e9ecef;
  min-height: 32px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

[data-theme="dark"] .timeline-ruler {
  background: #323232;
  border-bottom-color: #333;
}

.ruler-offset {
  width: var(--timeline-label-width);
  flex-shrink: 0;
  border-right: 1px solid #dee2e6;
  border-top-left-radius: 8px;
  background: #e9ecef;
}

[data-theme="dark"] .ruler-offset {
  border-right-color: #333;
  background: #323232;
}

/* Clip Duration Control */
.clip-duration-control {
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duration-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin: 0;
}

[data-theme="dark"] .duration-label {
  color: #868e96;
}

.duration-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.duration-input {
  width: 52px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: monospace;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
  color: #212529;
  text-align: center;
}

.duration-input:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

[data-theme="dark"] .duration-input {
  background: #1a1a1a;
  border-color: #404040;
  color: #e0e0e0;
}

[data-theme="dark"] .duration-input:focus {
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.duration-unit {
  font-size: 11px;
  color: #6c757d;
  font-weight: 500;
}

[data-theme="dark"] .duration-unit {
  color: #868e96;
}

.ruler-markers {
  display: flex;
  position: relative;
  padding: 0 8px 0 var(--timeline-left-shift);
}

.time-marker {
  position: relative;
  padding: 6px 8px 6px 0;
  width: 150px;
  flex-shrink: 0;
}

.time-label {
  font-size: 10px;
  color: #6c757d;
  font-family: monospace;
  white-space: nowrap;
}

[data-theme="dark"] .time-label {
  color: #868e96;
}

.time-tick {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 4px;
  background: #adb5bd;
}

[data-theme="dark"] .time-tick {
  background: #495057;
}

.timeline-tracks {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-track {
  display: flex;
  min-height: 50px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.timeline-track:last-child {
  border-bottom: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.timeline-track:last-child .track-label {
  border-bottom-left-radius: 8px;
}

[data-theme="dark"] .timeline-track {
  background: #252525;
  border-bottom-color: #333;
}

.track-label {
  flex-shrink: 0;
  width: var(--timeline-label-width);
  padding: 8px 20px 8px 12px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 13px;
  color: #495057;
  border-right: 1px solid #dee2e6;
}

[data-theme="dark"] .track-label {
  background: #2a2a2a;
  color: #adb5bd;
  border-right-color: #333;
}

.track-label i {
  font-size: 14px;
}

.track-content {
  padding: 6px 8px 6px var(--timeline-left-shift);
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  position: relative;
  overflow: hidden;
}

.timeline-clip {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  position: absolute;
  z-index: 1;
}

[data-theme="dark"] .timeline-clip {
  background: #1a1a1a;
  border-color: #333;
}

.timeline-clip:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

[data-theme="dark"] .timeline-clip:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Draggable Clips */
.timeline-draggable {
  cursor: grab;
  user-select: none;
}

.timeline-draggable:active {
  cursor: grabbing;
}

.timeline-draggable.dragging {
  cursor: grabbing;
  opacity: 0.8;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

[data-theme="dark"] .timeline-draggable.dragging {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Visual Track Clips */
.video-clip,
.image-clip {
  display: flex;
  height: 38px;
  background-size: auto 100%;
  background-repeat: repeat-x;
  background-position: left center;
}

/* Visual track with background image */
.visual-track .track-content {
  padding: 6px 8px 6px var(--timeline-left-shift);
}

.visual-background {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.clip-thumbnail {
  width: 67px;
  height: 38px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  border-radius: 6px;
}

.clip-thumbnail .clip-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clip-label {
  font-size: 11px;
  font-weight: 500;
  color: #495057;
  line-height: 1.2;
}

[data-theme="dark"] .clip-label {
  color: #adb5bd;
}

.clip-duration {
  font-size: 10px;
  color: #6c757d;
  font-family: monospace;
  line-height: 1;
}

[data-theme="dark"] .clip-duration {
  color: #868e96;
}

/* Timeline Dialogue Clips (for timeline view) */
.timeline-dialogue-clip {
  height: 38px;
}

.timeline-dialogue-clip .clip-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  width: 100%;
}

/* Dialogue Track Clips (for other views) */
.dialogue-clip {
  min-width: 150px;
  max-width: 250px;
  height: 38px;
}

.dialogue-clip .clip-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

.clip-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.clip-character {
  font-size: 10px;
  font-weight: 600;
  color: #0066cc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

[data-theme="dark"] .clip-character {
  color: #4da6ff;
}

.clip-text {
  font-size: 11px;
  color: #212529;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

[data-theme="dark"] .clip-text {
  color: #e9ecef;
}

/* SFX and Ambience Track Clips */
.sfx-clip,
.ambience-clip {
  min-width: 100px;
  height: 38px;
}

.sfx-clip .clip-info,
.ambience-clip .clip-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

.sfx-clip .clip-label {
  color: #dc3545;
}

[data-theme="dark"] .sfx-clip .clip-label {
  color: #ff6b7a;
}

.ambience-clip .clip-label {
  color: #28a745;
}

[data-theme="dark"] .ambience-clip .clip-label {
  color: #51cf66;
}

/* Empty State for Timeline Tracks */
.timeline-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #adb5bd;
  font-size: 12px;
  font-style: italic;
  padding: 8px;
}

[data-theme="dark"] .timeline-empty {
  color: #6c757d;
}

/* Timeline End Marker */
.timeline-end-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #495057;
  z-index: 10;
  pointer-events: none;
}

[data-theme="dark"] .timeline-end-marker {
  background: #6c757d;
}


.timeline-empty i {
  font-size: 14px;
  opacity: 0.5;
}

/* Track-specific colors */
.visual-track .track-label {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-right-color: #667eea;
}

.dialogue-track .track-label {
  background: linear-gradient(135deg, #0066cc 0%, #004c99 100%);
  color: #fff;
  border-right-color: #0066cc;
}

.sfx-track .track-label {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #fff;
  border-right-color: #dc3545;
}

.ambience-track .track-label {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: #fff;
  border-right-color: #28a745;
}

/* Sounds Section Styles */
/* Sounds Two-Column Layout */
.sounds-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  padding: 0 16px 16px 16px;
  height: 100%;
}

.sounds-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.sounds-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(74, 158, 255, 0.1);
  border-left: 3px solid #4a9eff;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  flex-shrink: 0;
}

[data-theme="dark"] .sounds-column-header {
  background: rgba(74, 158, 255, 0.15);
  color: #f0f0f0;
}

.sounds-column-header i {
  font-size: 16px;
  color: #4a9eff;
}

.sounds-column-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sounds-subsection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sounds-subsection-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
}

[data-theme="dark"] .sounds-subsection-label {
  background: rgba(255, 255, 255, 0.05);
  color: #999;
}

.sounds-subsection-label i {
  font-size: 12px;
  color: #999;
}

.sounds-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #999;
  text-align: center;
}

.sounds-empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.sounds-empty-state p {
  margin: 0;
  font-size: 13px;
}

/* Sound Card Selection Styles */
.sound-card.selected {
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Protected Sound Styles (Scene/Location ambient sounds) */
.sound-card.sound-protected .dialogue-meta-row {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-bottom-color: #28a745;
}

[data-theme="dark"] .sound-card.sound-protected .dialogue-meta-row {
  background: linear-gradient(135deg, #1e7e34 0%, #17a589 100%);
  border-bottom-color: #1e7e34;
}

.sound-card.sound-protected .dialogue-character {
  color: white !important;
}

.sound-card.sound-protected .dialogue-duration {
  color: rgba(255, 255, 255, 0.9) !important;
}

.sound-card.sound-protected .dialogue-sequence {
  color: rgba(255, 255, 255, 0.8);
}