/* ── reset & base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #0b0f1a;
  color: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  overflow: hidden;
}
.hidden { display: none !important; }

/* ── layout ── */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 280px;
  min-width: 280px;
  background: #0e1220;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}
.main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* ── logo ── */
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f0f2f6;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.logo-icon { font-size: 1.1rem; }

/* ── section headings ── */
.section-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #9ca3af;
  margin: 16px 0 8px 0;
}

/* ── buttons ── */
.btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e6edf3;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
  font-family: inherit;
}
.btn:hover { background: rgba(255,255,255,0.14); }
.btn:active { transform: scale(0.97); }
.btn-block { display: block; width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #ff4b4b, #e03636);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 10px;
  margin-top: 12px;
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(255,75,75,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }

/* ── clip list ── */
.clip-list { margin-top: 8px; }
.clip-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .2s;
}
.clip-card:hover { border-color: rgba(255,255,255,0.15); }
.clip-card.active { border-color: #ff4b4b; background: rgba(255,75,75,0.06); }
.clip-name {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 13px;
  font-family: "SF Mono","Cascadia Mono","Consolas",monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip-meta { font-size: 11px; color: #9ca3af; margin-top: 3px; }

/* ── empty / drop state ── */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.drop-zone {
  text-align: center;
  padding: 60px 40px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 20px;
  min-width: 420px;
  transition: all .2s;
}
.drop-zone.drag-over {
  border-color: #ff4b4b;
  background: rgba(255,75,75,0.06);
}
.drop-icon { font-size: 56px; opacity: 0.5; margin-bottom: 16px; }
.drop-title { font-size: 18px; font-weight: 600; color: #9ca3af; margin-bottom: 6px; }
.drop-sub { font-size: 14px; color: #6b7280; }
.drop-formats { margin-top: 20px; font-size: 13px; color: #4b5563; }

/* ── controls bar ── */
.controls-bar {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: rgba(16,21,34,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ctrl-group { min-width: 140px; }
.panel-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.info-text { font-size: 13px; color: #c9cdd4; line-height: 1.5; }

/* ── mode toggle ── */
.mode-toggle { display: flex; gap: 4px; }
.mode-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #9ca3af;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all .15s;
}
.mode-btn:hover { color: #e5e7eb; }
.mode-btn.active {
  background: rgba(255,75,75,0.12);
  border-color: #ff4b4b;
  color: #ff4b4b;
  font-weight: 600;
}

/* ── mark display ── */
.mark-display { min-height: 36px; }
.mark-value {
  font-family: "SF Mono","Cascadia Mono","Consolas",monospace;
  font-size: 22px;
  font-weight: 700;
  color: #facc15;
  line-height: 1.25;
}
.mark-sub { font-family: "SF Mono",monospace; font-size: 12px; color: #a1a7b4; }
.mark-empty { font-size: 13px; color: #7a8194; font-style: italic; }

/* ── TC input ── */
.tc-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e5e7eb;
  font-family: "SF Mono","Cascadia Mono","Consolas",monospace;
  font-size: 15px;
  padding: 7px 12px;
  border-radius: 8px;
  width: 170px;
  outline: none;
}
.tc-input:focus { border-color: #ff4b4b; }
.tc-input.short { width: 80px; font-size: 13px; }

/* ── ref select ── */
.ref-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e5e7eb;
  font-family: "SF Mono",monospace;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 8px;
  width: 100%;
  margin-bottom: 12px;
  outline: none;
  cursor: pointer;
}
.ref-select:focus { border-color: #ff4b4b; }

/* ── video player ── */
.player-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #0d1120;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
video {
  width: 100%;
  display: block;
  background: #000;
  max-height: 440px;
  object-fit: contain;
}

/* seek bar */
.seek-row {
  position: relative;
  height: 32px;
  background: #111827;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.seek-track {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}
.seek-fill { height: 100%; background: #ff4b4b; border-radius: 4px; width: 0%; transition: width .05s linear; }
.seek-thumb {
  position: absolute; width: 14px; height: 14px;
  background: #ff4b4b; border: 2px solid #fff; border-radius: 50%;
  top: 50%; transform: translate(-50%,-50%);
  left: 0%; opacity: 0; transition: opacity .15s;
  box-shadow: 0 0 8px rgba(255,75,75,0.4);
  pointer-events: none;
}
.seek-row:hover .seek-thumb { opacity: 1; }
.seek-row.dragging .seek-thumb { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
.mark-flag {
  position: absolute; width: 3px; height: 20px;
  background: #facc15; border-radius: 1px;
  top: 50%; transform: translate(-50%,-50%);
  pointer-events: none; display: none;
  box-shadow: 0 0 6px rgba(250,204,21,0.4);
}
.seek-tip {
  position: absolute; top: -30px; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); color: #f0f2f6;
  font-family: "SF Mono",monospace; font-size: 11px;
  padding: 3px 8px; border-radius: 5px;
  white-space: nowrap; pointer-events: none; display: none;
}

/* player controls */
.player-controls {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: #111827;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.tc { font-family: "SF Mono",monospace; font-size: 13px; white-space: nowrap; color: #a1a7b4; }
.tc-current { color: #f0f2f6; font-weight: 500; }
.tc-sep { color: #6b7280; margin: 0 2px; }
.spacer { flex: 1; }
.btn-mark {
  background: linear-gradient(135deg,#ff4b4b,#e03636);
  border: none; color: #fff; font-weight: 700;
  padding: 7px 18px; font-size: 13px; letter-spacing: .4px;
}
.btn-mark:hover { box-shadow: 0 3px 12px rgba(255,75,75,0.3); transform: translateY(-1px); }

.shortcuts-hint {
  display: flex; justify-content: center; gap: 16px;
  padding: 5px; font-size: 10px; color: #7a8194;
}
.shortcuts-hint kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px; padding: 1px 5px;
  font-family: inherit; font-size: 10px; color: #a1a7b4;
}

/* ── results table ── */
.results { margin-top: 16px; }
.tc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.tc-table thead th {
  text-align: left; padding: 12px 16px; color: #9ca3af;
  font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tc-table tbody td {
  padding: 14px 16px; color: #d1d5db;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tc-table tbody tr:last-child td { border-bottom: none; }
.tc-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.tc-table .mono { font-family: "SF Mono",monospace; font-weight: 500; color: #e5e7eb; }
.tc-table .tc-val { color: #4ade80; font-weight: 600; font-family: "SF Mono",monospace; font-size: 15px; }
.tc-table .offset { color: #a1a7b4; font-family: "SF Mono",monospace; font-size: 13px; }

/* ── apply bar ── */
.apply-bar {
  display: flex; align-items: flex-end; gap: 16px;
  margin-top: 16px; flex-wrap: wrap;
}
.apply-option { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #9ca3af; }

/* ── progress ── */
.progress-wrap { margin-top: 16px; }
.progress-bar {
  height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: #4ade80;
  border-radius: 3px; width: 0%;
  transition: width .3s ease;
}
.progress-text { font-size: 13px; color: #9ca3af; margin-top: 6px; }

/* ── status messages ── */
.msg-success { color: #4ade80; font-size: 13px; margin-top: 6px; }
.msg-error { color: #f87171; font-size: 13px; margin-top: 6px; }
