/* =============================================================
   Video studio (محرر الفيديو) — Assets/System/video-editor.js
   The page is RTL; the stage and the timeline are dir="ltr"
   because time runs left→right and the JS maths assumes it.
   Track-head width here must match HEAD in video-editor.js (110).
   ============================================================= */

.vid-panel .vid-head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vid-dirty { font-size: 12px; color: var(--ad-red); min-width: 90px; }

.vid-wrap { display: flex; gap: 12px; align-items: stretch; margin-bottom: 10px; flex-wrap: wrap; }

.vid-side {
  width: 230px; flex: 0 0 230px; background: var(--ad-surface);
  border: 1px solid var(--ad-border); border-radius: var(--ad-radius);
  display: flex; flex-direction: column; max-height: 420px; overflow: hidden;
}
.vid-side-head {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid var(--ad-border);
  font-size: 12px; font-weight: 700; color: var(--ad-ink-soft);
}
.vid-upload-state { font-size: 11px; color: var(--ad-ink-soft); padding: 0 10px; }
.vid-bin { overflow-y: auto; padding: 8px; flex: 1; }

.vid-bin-item {
  display: flex; align-items: center; gap: 8px; padding: 6px; margin-bottom: 6px;
  background: var(--ad-bg); border: 1px solid var(--ad-border); border-radius: 10px; cursor: grab;
}
.vid-bin-item:hover { border-color: var(--ad-accent); }
.vid-bin-item img, .vid-bin-ico {
  width: 46px; height: 34px; flex: 0 0 46px; border-radius: 6px; object-fit: cover;
  background: #1d1d1d; color: #fff; display: flex; align-items: center; justify-content: center;
}
.vid-bin-info { flex: 1; min-width: 0; }
.vid-bin-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid-bin-sub { font-size: 10px; color: var(--ad-ink-soft); }
.vid-bin-del { border: 0; background: none; color: var(--ad-ink-soft); font-size: 18px; line-height: 1; cursor: pointer; }
.vid-bin-del:hover { color: var(--ad-red); }

.vid-main {
  flex: 1; min-width: 280px; background: var(--ad-surface);
  border: 1px solid var(--ad-border); border-radius: var(--ad-radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.vid-stage-wrap {
  flex: 1; min-height: 260px; display: flex; align-items: center; justify-content: center;
  background: #121212; padding: 8px;
}
.vid-stage { position: relative; background: #000; overflow: hidden; }
.vid-layer { position: absolute; overflow: hidden; }
.vid-layer video, .vid-layer img { position: absolute; display: block; }

.vid-transport { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--ad-border); flex-wrap: wrap; }
.vid-play { width: 42px; height: 42px; border-radius: 50%; padding: 0; }
.vid-time { font-size: 12px; color: var(--ad-ink-soft); font-family: Consolas, monospace; }

.vid-props { max-height: 420px; }
.vid-props-body { overflow-y: auto; padding: 8px; }
.vid-props-name { font-size: 12px; font-weight: 700; margin-bottom: 8px; word-break: break-word; }
.vid-fgroup { margin-bottom: 12px; }
.vid-ftitle { font-size: 11px; color: var(--ad-ink-soft); font-weight: 700; margin-bottom: 4px; }
.vid-frow { display: flex; gap: 6px; margin-bottom: 5px; }
.vid-f { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--ad-ink-soft); }
.vid-f input {
  width: 100%; padding: 4px 6px; border: 1px solid var(--ad-border);
  border-radius: 6px; background: #fff; color: var(--ad-ink); direction: ltr;
}

.vid-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }

.vid-timeline {
  position: relative; overflow: auto; max-height: 300px;
  background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: var(--ad-radius);
}
.vid-ruler {
  position: relative; height: 24px; background: var(--ad-bg);
  border-bottom: 1px solid var(--ad-border); cursor: pointer;
}
.vid-tick {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--ad-border);
  padding-left: 3px; font-size: 10px; color: var(--ad-ink-soft);
}
.vid-playhead { position: absolute; top: 0; width: 2px; background: var(--ad-red); z-index: 6; pointer-events: none; }
.vid-tracks { position: relative; }

.vid-track-row { display: flex; height: 54px; border-bottom: 1px solid var(--ad-border); }
.vid-track-head {
  width: 110px; flex: 0 0 110px; border-left: 1px solid var(--ad-border);
  background: var(--ad-surface); position: sticky; left: 0; z-index: 4;
  display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 6px;
}
.vid-track-name { font-size: 11px; font-weight: 700; }
.vid-track-btns { display: flex; gap: 3px; }
.vid-track-btns button {
  font-size: 10px; padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--ad-border); background: var(--ad-bg); color: var(--ad-ink-soft); cursor: pointer;
}
.vid-track-btns button:hover { color: var(--ad-ink); }
.vid-track-body { position: relative; }
.vid-track-body.vid-video { background: rgba(49, 193, 189, .06); }
.vid-track-body.vid-audio { background: rgba(78, 125, 75, .08); }

.vid-clip {
  position: absolute; top: 4px; bottom: 4px; border-radius: 6px; overflow: hidden;
  background: #3d7ea6; color: #fff; border: 1px solid rgba(0, 0, 0, .25);
  display: flex; align-items: center; padding: 0 8px; cursor: grab; user-select: none;
}
.vid-clip.is-audio { background: var(--ad-green); }
.vid-clip.is-sel { outline: 2px solid #ffd54a; z-index: 3; }
.vid-clip-label { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.vid-handle { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 2; }
.vid-handle-l { left: 0; }
.vid-handle-r { right: 0; }

@media (max-width: 991px) {
  .vid-side, .vid-props { width: 100%; flex: 1 1 100%; max-height: 220px; }
  .vid-main { flex: 1 1 100%; }
}
