/* =========================================================================
   نوار زمان ویدیو — static/js/video_timeline.js
   -------------------------------------------------------------------------
   یک خط نازک و ظریف زیر ویدیو (نه یک پلیر شلوغ): هم‌پای پخش جلو می‌رود،
   با یک لمس ویدیو از همان نقطه پخش می‌شود و با کشیدن انگشت روی آن،
   زیرنویس همان لحظه روی ویدیو دیده می‌شود. نوارهای کم‌رنگ روی خط جاهایی
   هستند که زیرنویس دارند (سکوت‌ها خالی می‌مانند).
   ========================================================================= */
.vt-bar {
    --vt-accent-1: #7C4DFF;
    --vt-accent-2: #00D7FF;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 4px 16px 12px;
    direction: rtl;
    user-select: none;
    -webkit-user-select: none;
}
.vt-wrap {
    width: 100%;
    background: linear-gradient(180deg, #000 0%, #07070b 100%);
    flex-shrink: 0;
}

/* دکمه پخش / توقف */
.vt-play {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.25s;
    -webkit-tap-highlight-color: transparent;
}
.vt-play i { pointer-events: none; }
.vt-play .fa-play { margin-right: -2px; }          /* تعادل بصری مثلث پخش */
.vt-play:active { transform: scale(0.9); }
.vt-bar.is-playing .vt-play {
    background: linear-gradient(135deg, var(--vt-accent-1), #5a2ff0);
    border-color: transparent;
    box-shadow: 0 4px 14px -4px rgba(124, 77, 255, 0.9);
}

/* زمان‌ها */
.vt-time {
    flex: 0 0 auto;
    min-width: 36px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #b6bacb;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
}
.vt-time.vt-dur { color: #6f7487; }

/* محدوده لمس (بلندتر از خود خط، برای راحتی انگشت) */
.vt-track {
    position: relative;
    flex: 1 1 auto;
    height: 26px;
    cursor: pointer;
    touch-action: none;
    outline: none;
}
.vt-rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    transform: translateY(-50%);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.13);
    overflow: hidden;
    transition: height 0.18s ease;
}
/* جاهایی که زیرنویس دارند */
.vt-marks { position: absolute; inset: 0; }
.vt-marks i {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
}
.vt-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 0;
    border-radius: 3px;
    background: linear-gradient(270deg, var(--vt-accent-1) 0%, var(--vt-accent-2) 100%);
    box-shadow: 0 0 10px rgba(0, 215, 255, 0.45);
}
.vt-knob {
    position: absolute;
    top: 50%;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transform: translate(50%, -50%);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: width 0.15s, height 0.15s, box-shadow 0.2s;
    pointer-events: none;
}
.vt-track:hover .vt-rail,
.vt-bar.is-drag .vt-rail { height: 5px; }
.vt-bar.is-drag .vt-knob {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 5px rgba(0, 215, 255, 0.25), 0 2px 10px rgba(0, 0, 0, 0.6);
}
.vt-track:focus-visible .vt-knob { box-shadow: 0 0 0 4px rgba(0, 215, 255, 0.55); }

/* حباب زمان هنگام کشیدن */
.vt-tip {
    position: absolute;
    bottom: 100%;
    right: 0;
    transform: translate(50%, -4px) scale(0.85);
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(20, 20, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}
.vt-bar.is-drag .vt-tip { opacity: 1; transform: translate(50%, -6px) scale(1); }

@media (prefers-reduced-motion: reduce) {
    .vt-rail, .vt-knob, .vt-tip, .vt-play { transition: none; }
}
