/* Video Trimmer - .vt-* namespace */

.vt-tool-wrap {
  max-width: 1060px;
  margin: 0 auto;
  margin: 1.5rem 0;
}

.vt-compat-error,
.vt-mobile-warn {
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.vt-compat-error {
  background: rgba(var(--danger-rgb), 0.08);
  border: 1px solid rgba(var(--danger-rgb), 0.28);
  color: var(--danger);
}

.vt-mobile-warn {
  background: rgba(var(--warning-rgb), 0.08);
  border: 1px solid rgba(var(--warning-rgb), 0.28);
  color: var(--warning);
}

/* Drop zone */

.vt-drop-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  padding: 3rem 2rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.vt-drop-zone:hover,
.vt-drop-zone:focus-visible,
.vt-drop-zone.vt-drag-over {
  background: rgba(var(--primary-rgb), 0.06);
  border-color: var(--primary);
  outline: none;
}

.vt-drop-icon {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.vt-drop-title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.vt-drop-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.vt-browse-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0;
  text-decoration: underline;
}

.vt-browse-link:hover {
  color: var(--primary-dark);
}

.vt-drop-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.8rem;
}

.vt-format-pill {
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
}

.vt-file-input-hidden {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

/* Editor */

.vt-editor {
  margin-top: 1.25rem;
}

.vt-file-bar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  min-height: 52px;
  padding: 0.6rem 0.9rem;
}

.vt-file-name {
  color: var(--text);
  flex: 1;
  font-size: 0.93rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vt-file-size {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}

.vt-remove-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.82rem;
  gap: 0.35rem;
  justify-content: center;
  min-height: 36px;
  padding: 0.3rem 0.65rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.vt-remove-btn:hover {
  background: rgba(var(--danger-rgb), 0.06);
  border-color: var(--danger);
  color: var(--danger);
}

/* Player */

.vt-player {
  background: #000;
  border-radius: 6px;
  display: block;
  height: auto;
  margin-bottom: 0.5rem;
  max-height: 320px;
  min-height: 60px;
  object-fit: contain;
  width: 100%;
}

/* Timeline */

.vt-timeline-wrap {
  margin: 0.5rem 0 2.75rem;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.vt-filmstrip {
  background: var(--border);
  border-radius: 6px 6px 0 0;
  display: flex;
  height: 54px;
  overflow: hidden;
}

.vt-thumb {
  display: block;
  flex: 1;
  height: 54px;
  min-width: 0;
  object-fit: cover;
}

.vt-track {
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 0 0 6px 6px;
  cursor: crosshair;
  height: 16px;
  overflow: visible;
  position: relative;
}

.vt-range-fill {
  bottom: 0;
  background: rgba(var(--primary-rgb), 0.26);
  border-bottom: 2px solid var(--primary);
  border-top: 2px solid var(--primary);
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 1;
}

.vt-handle {
  background: var(--primary);
  border-radius: 2px;
  cursor: ew-resize;
  height: calc(54px + 16px);
  position: absolute;
  top: -54px;
  touch-action: none;
  transform: translateX(-50%);
  width: 4px;
  z-index: 3;
}

.vt-handle-start { left: 0; }
.vt-handle-end { left: 100%; }

.vt-handle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.vt-handle::before {
  background: var(--primary);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  content: '';
  height: 18px;
  left: 50%;
  margin-top: -4px;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 18px;
}

.vt-handle::after {
  background: var(--surface);
  border: 1px solid rgba(var(--primary-rgb), 0.32);
  border-radius: 4px;
  color: var(--primary);
  content: attr(data-label);
  font-size: 0.72rem;
  font-weight: 700;
  left: 50%;
  padding: 0.1rem 0.4rem;
  pointer-events: none;
  position: absolute;
  top: calc(54px + 16px + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Time row */

.vt-time-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.vt-time-group {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.45rem;
  min-width: 140px;
}

.vt-time-label {
  color: var(--text);
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.vt-time-input {
  flex: 1;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: center;
}

.vt-preview-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.78rem;
  gap: 0.3rem;
  justify-content: center;
  min-height: 44px;
  padding: 0.3rem 0.65rem;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.vt-preview-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.vt-preview-btn svg {
  flex-shrink: 0;
}

.vt-duration-display {
  color: var(--text-muted);
  flex: 1;
  font-size: 0.83rem;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
}

.vt-duration-display strong {
  color: var(--primary);
}

/* Options */

.vt-options {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.vt-option-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.vt-option-label {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.vt-format-select {
  min-height: 44px;
}

.vt-filename-wrap {
  display: flex;
  min-width: 0;
}

.vt-filename-input {
  border-radius: 6px 0 0 6px !important;
  border-right: none !important;
  min-width: 0;
}

.vt-filename-ext {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
  display: flex;
  flex-shrink: 0;
  font-size: 0.9rem;
  height: 44px;
  padding: 0 0.75rem;
}

/* Actions */

.vt-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.vt-trim-btn {
  align-items: center;
  display: inline-flex;
  gap: 0.5rem;
  justify-content: center;
  min-height: 48px;
}

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

.vt-clear-btn,
.vt-cancel-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
}

.vt-clear-btn:hover,
.vt-cancel-btn:hover {
  background: rgba(var(--danger-rgb), 0.06);
  border-color: var(--danger);
  color: var(--danger);
}

.vt-privacy-badge {
  align-items: center;
  color: var(--success);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.4rem;
}

/* Progress */

.vt-progress-wrap {
  margin-top: 1.5rem;
  text-align: center;
}

.vt-progress-track {
  background: var(--border);
  border-radius: 999px;
  height: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.vt-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  height: 100%;
  transition: width 0.35s ease;
  width: 0%;
}

.vt-progress-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.vt-cancel-btn {
  margin-top: 0.8rem;
}

/* Result */

.vt-result {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--success);
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
}

.vt-result-icon {
  color: var(--success);
  flex-shrink: 0;
}

.vt-result-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.vt-result-body strong {
  color: var(--text);
}

.vt-result-body span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.vt-download-btn {
  align-items: center;
  display: inline-flex;
  gap: 0.5rem;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

/* Status */

.vt-status {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 1rem;
}
.vt-status.vt-status-error   { padding: 0.65rem 1rem; border-radius: 8px; border: 1px solid rgba(239,68,68,0.25); background: rgba(239,68,68,0.1); color: var(--danger); font-size: 0.875rem; animation: tool-status-in 0.2s ease; }
.vt-status.vt-status-warning { padding: 0.65rem 1rem; border-radius: 8px; border: 1px solid rgba(245,158,11,0.25); background: rgba(245,158,11,0.1); color: var(--warning); font-size: 0.875rem; animation: tool-status-in 0.2s ease; }
.vt-status.vt-status-info    { padding: 0.65rem 1rem; border-radius: 8px; border: 1px solid rgba(var(--primary-rgb),0.2); background: rgba(var(--primary-rgb),0.08); color: var(--primary); font-size: 0.875rem; animation: tool-status-in 0.2s ease; }

.vt-status:empty {
  display: none;
}

/* Dark mode */

[data-theme="dark"] .vt-drop-zone,
[data-theme="dark"] .vt-file-bar,
[data-theme="dark"] .vt-result {
  background: rgba(var(--on-primary-rgb), 0.03);
}

[data-theme="dark"] .vt-filename-ext {
  background: rgba(var(--on-primary-rgb), 0.04);
}

/* Responsive */

@media (max-width: 640px) {
  .vt-drop-zone {
    padding: 2rem 1rem;
  }

  .vt-time-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .vt-duration-display {
    text-align: left;
  }

  .vt-options {
    grid-template-columns: 1fr;
  }

  .vt-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .vt-trim-btn,
  .vt-clear-btn {
    width: 100%;
  }

  .vt-result {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }
}
