.video-preview-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 500px;
}
video {
    width: 100%;
    max-height: 500px;
    display: block;
}
.crop-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    display: none;
}
.crop-box {
    position: absolute;
    border: 2px dashed #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    cursor: move;
    box-sizing: border-box;
}
.crop-handle {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--accent);
    bottom: -6px; right: -6px;
    cursor: se-resize;
    border-radius: 2px;
}
.timeline-container {
    width: 100%;
    height: 40px;
    background: #111;
    border-radius: 6px;
    position: relative;
    border: 1px solid var(--border);
    box-sizing: border-box;
    display: none;
}
.timeline-track {
    position: absolute;
    top: 0;
    bottom: 0;
    background: transparent;
    cursor: grab;
    border-left: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}
.timeline-track:active { cursor: grabbing; }
.timeline-handle {
    position: absolute;
    width: 8px;
    top: -2px;
    bottom: -2px;
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 3px;
    cursor: ew-resize;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 10;
    display: none;
}
.handle-left { left: -5px; }
.handle-right { right: -5px; }
.video-native-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.control-btn {
    background: var(--border);
    color: #fff;
    border: 1px solid #444;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.control-btn:hover { background: #3a3a42; }
.control-btn.active {
    background: #e11d48;
    border-color: #be123c;
}
.controls-right-group {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
#videoTimeDisplay {
    font-size: 13px;
    color: var(--text-muted);
}
#trimTimeDisplay {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-left: 12px;
}




/* Контейнер для превью текстовых слоев поверх плеера */
.text-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Чтобы не мешать кликать по плееру, когда слоев нет */
    overflow: hidden;
}

/* Интерактивный текстовый блок на видео */
.draggable-text-node {
    position: absolute;
    pointer-events: auto; /* Включаем мышь обратно для конкретных надписей */
    cursor: move;
    user-select: none;
    white-space: nowrap;
    padding: 2px 4px;
    border: 1px dashed transparent;
    font-family: sans-serif;
    transform: translate(0, 0); /* Смещение отсчитываем от левого верхнего угла */
}

/* Подсветка слоя, который сейчас выбран в инспекторе */
.draggable-text-node.active-node {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
    z-index: 100;
}
