/* =============================================
   TAB: Clips — Untertitel & Übersetzung (Whisper)
   Stil: Apple / Stripe — clean, ruhig.
   Konsistent mit cross-clip.css / tts.css.
   ============================================= */

.tr-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ─── Section-Intro ───────────────────────────────────────────────── */
.tr-intro {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: var(--radius-md);
}
.tr-intro-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.tr-intro-icon svg { width: 18px; height: 18px; }
.tr-intro-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.tr-intro-sub {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.tr-intro-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tr-intro-pill.warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}
.tr-intro-pill.err {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.tr-intro-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── Card-Look ───────────────────────────────────────────────────── */
.tr-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg, 16px);
  padding: 20px 22px;
}
.tr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tr-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tr-card-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ─── Source-Tabs ─────────────────────────────────────────────────── */
.tr-source-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tr-source-tab {
  flex: 1;
  min-width: 110px;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all .15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tr-source-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
}
.tr-source-tab.active {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ─── Source-Bodies ───────────────────────────────────────────────── */
.tr-source-body { display: none; }
.tr-source-body.active { display: block; }

.tr-upload-zone {
  position: relative;
  border: 2px dashed rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.03);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
}
.tr-upload-zone:hover,
.tr-upload-zone.dragover {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.08);
}
.tr-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.tr-upload-zone-icon {
  font-size: 28px;
  margin-bottom: 6px;
  opacity: .85;
}
.tr-upload-zone-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.tr-upload-zone-sub {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}
.tr-upload-zone-file {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #a78bfa;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
}
.tr-upload-zone-file.err { color: #f87171; }

.tr-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tr-select-label {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.tr-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all .15s;
}
.tr-select:hover { border-color: rgba(167, 139, 250, 0.35); }
.tr-select:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}
.tr-select option {
  background: #0f0f17;
  color: var(--color-text);
}

/* ─── Options-Row ─────────────────────────────────────────────────── */
.tr-options {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: end;
}
@media (max-width: 600px) {
  .tr-options { grid-template-columns: 1fr; }
}
.tr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  color: var(--color-text);
  transition: all .15s;
}
.tr-toggle:hover { border-color: rgba(167, 139, 250, 0.35); }
.tr-toggle input { accent-color: #a78bfa; cursor: pointer; }
.tr-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tr-toggle-text small {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ─── Submit-Row ──────────────────────────────────────────────────── */
.tr-submit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}
.tr-submit-summary {
  flex: 1;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  min-width: 200px;
}
.tr-submit-summary strong { color: var(--color-text); }

.tr-progress {
  width: 100%;
  margin-top: 12px;
  display: none;
  flex-direction: column;
  gap: 6px;
}
.tr-progress.active { display: flex; }
.tr-progress-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
}
.tr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
  width: 0%;
  transition: width .25s ease-out;
  animation: trShimmer 1.6s infinite linear;
  background-size: 200% 100%;
}
@keyframes trShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.tr-progress-label {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tr-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(167, 139, 250, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: trSpin .8s linear infinite;
  display: inline-block;
}
@keyframes trSpin { to { transform: rotate(360deg); } }

/* ─── Output-Card ─────────────────────────────────────────────────── */
.tr-output {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.tr-output.active { display: flex; }

.tr-output-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
}
.tr-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  color: var(--color-text-muted);
}
.tr-meta-pill strong { color: var(--color-text); font-weight: 600; }

.tr-output-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tr-output-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.tr-output-actions {
  display: inline-flex;
  gap: 6px;
}
.tr-output-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--color-text);
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .15s;
}
.tr-output-textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.45);
}
.tr-output-textarea.srt {
  min-height: 160px;
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ─── Segments-Table ──────────────────────────────────────────────── */
.tr-segments {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}
.tr-segment {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.83rem;
  line-height: 1.5;
}
.tr-segment:last-child { border-bottom: none; }
.tr-segment:hover { background: rgba(255, 255, 255, 0.02); }
.tr-segment-time {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #a78bfa;
  white-space: nowrap;
  padding-top: 1px;
}
.tr-segment-text {
  color: var(--color-text);
}

.tr-segments-empty {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

/* ─── Output-Footer ───────────────────────────────────────────────── */
.tr-output-footer {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}

/* ─── Mobile-Tweaks ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tr-output-textarea { font-size: 0.78rem; }
  .tr-segment { grid-template-columns: 1fr; }
  .tr-segment-time { padding-top: 0; }
}
