/* LiteCut Styles */
* { box-sizing: border-box; }
body { margin: 0; background: #111; color: #fff; font-family: system-ui, sans-serif; }

#app { padding: 20px; max-width: 1200px; margin: 0 auto; }

h1 {
  font-size: 20px;
  margin: 0 0 24px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sections */
section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #222;
}
section:last-child { border-bottom: none; }
section h2 {
  font-size: 12px;
  color: #666;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* File input */
input[type="file"] {
  color: #fff;
}
input[type="file"]::file-selector-button {
  background: #333;
  color: #fff;
  border: 1px solid #444;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 12px;
  transition: all 0.2s;
}
input[type="file"]::file-selector-button:hover {
  background: #444;
  border-color: #555;
}

/* Preview video */
#preview, #preview-b {
  width: 100%;
  max-width: 800px;
  background: #000;
  display: block;
}

/* Timeline */
#timeline {
  background: #222;
  border-radius: 8px;
  padding: 10px;
  min-height: 100px;
  position: relative;
}

/* Ruler */
#ruler {
  height: 24px;
  background: #1a1a1a;
  border-radius: 4px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.ruler-mark {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid #444;
  padding-left: 4px;
  font-size: 10px;
  color: #666;
  line-height: 24px;
}

/* Tracks */
.track {
  background: #333;
  border-radius: 4px;
  height: 50px;
  margin-bottom: 8px;
  position: relative;
  overflow: visible;
}

.track-label {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
  z-index: 1;
}

/* Clips */
.clip {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  background: #6366f1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  cursor: move;
  user-select: none;
}

.clip.audio { background: #22c55e; }
.clip.selected {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.toolbar button {
  background: #333;
  padding: 6px 12px;
  font-size: 12px;
  box-shadow: none;
}
.toolbar button:hover {
  background: #444;
  transform: none;
  box-shadow: none;
}
.toolbar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.toolbar .shortcut {
  color: #666;
  margin-left: 6px;
  font-size: 10px;
}

/* Playhead */
#playhead {
  position: absolute;
  top: 10px;
  width: 2px;
  height: calc(100% - 20px);
  background: #ef4444;
  pointer-events: none;
  z-index: 10;
}

#playhead::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ef4444;
}

/* Time display */
#time-display {
  font-family: monospace;
  font-size: 14px;
  margin: 10px 0;
}

/* Controls */
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

/* Buttons */
button {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}
button:active {
  transform: translateY(0);
}

/* Media list */
.media-item {
  background: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 10px;
  cursor: grab;
  font-size: 13px;
  border: 1px solid #333;
  transition: all 0.2s;
}
.media-item:hover {
  border-color: #6366f1;
  background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
}
.media-item:active { cursor: grabbing; }

/* Empty states */
.empty-state {
  border: 2px dashed #333;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  margin-top: 10px;
}

.empty-state-text {
  font-size: 13px;
  color: #666;
}

.empty-state.hidden {
  display: none;
}

/* Preview empty state */
#preview-container {
  position: relative;
  max-width: 800px;
}

.preview-empty {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  border: none;
  margin: 0;
  min-height: 200px;
}

.preview-empty.hidden {
  display: none;
}

/* Track hints */
.track-hint {
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #555;
  font-style: italic;
  pointer-events: none;
}

.track-hint.hidden {
  display: none;
}

/* Project header */
.project-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.project-name {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}

.btn-small {
  background: #333;
  padding: 4px 10px;
  font-size: 11px;
  box-shadow: none;
}

.btn-small:hover {
  background: #444;
  transform: none;
  box-shadow: none;
}

/* Project actions */
.project-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #333;
}

.dropdown-item.current {
  background: #2a2a5a;
}

.dropdown-item .project-date {
  font-size: 11px;
  color: #666;
}

.dropdown-empty {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 13px;
}
