/* ===========================================
   Chapter Timeline (editMode "chapters")
   =========================================== */

.playerContainer .chapterTimeline {
    position: relative;
    width: 100%;
    height: 0px;
    background: var(--secondary-bg-color);
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    display: none;
}

.playerContainer .chapterTimeline.editable {
    display: block;
    min-height: 50px;
    height: 50px;
    padding: 10px 0;
    background-color: transparent;
    box-shadow: 0 0 3px 2px #303030 inset;
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.3) -1px, rgba(255,255,255,0.3) 1px, transparent 1px, transparent 3px);
    pointer-events: auto;
    overflow-x: auto;
    overflow-y: hidden;
}

/* ===========================================
   Chapter Blocks (spanning segments)
   =========================================== */

.playerContainer .chapterTimeline.editable .timelineElement.chapterBlock {
    position: absolute;
    top: 10px;
    bottom: 10px;
    height: auto;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 6px 0 12px;
    overflow: hidden;
    background-color: var(--secondary-fg-color);
    border-left: 2px solid var(--primary-bg-color);
    border-radius: 2px;
    color: var(--primary-bg-color);
    cursor: pointer;
    pointer-events: auto;
}

.playerContainer .chapterTimeline.editable .chapterBlock .chapterBlockLabel {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.playerContainer .chapterTimeline.editable .chapterBlock .chapterBlockLabel.placeholder {
    opacity: 0.5;
    font-style: italic;
}

.playerContainer .chapterTimeline.editable .chapterBlock.narrow .chapterBlockLabel {
    display: none;
}

.playerContainer .chapterTimeline.editable .chapterBlock.highlighted {
    background-color: var(--primary-fg-color);
}

.playerContainer .chapterTimeline.editable .chapterBlock.dragging {
    opacity: 0.85;
}

/* Left-edge drag handle (moves this chapter's start = the divider to the previous chapter) */
.playerContainer .chapterTimeline.editable .chapterBlock .chapterResizeHandle {
    position: absolute;
    left: -5px;
    top: 0;
    bottom: 0;
    width: 12px;
    cursor: ew-resize !important;
    z-index: 3;
    touch-action: none;
    background-color: var(--secondary-bg-color);
}

.playerContainer .chapterTimeline.editable .chapterBlock .chapterResizeHandle:hover {
    background-color: var(--primary-bg-color);
}

/* ===========================================
   Chapter list editor (in the EditingOptions panel)
   =========================================== */

.editingOptions .chaptersEditor .chaptersAddButton {
    margin: 8px 0;
}

.editingOptions .chaptersEditor .chaptersEditorList {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.editingOptions .chaptersEditor .chapterRow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border-radius: 3px;
}

.editingOptions .chaptersEditor .chapterRow.highlighted input, 
.editingOptions .chaptersEditor .chapterRow.highlighted button {
    border-width: 2px;
}

.editingOptions .chaptersEditor .chapterRow .chapterStartInput {
    flex: 0 0 auto;
    width: 120px;
}

.editingOptions .chaptersEditor .chapterRow .chapterTitleInput {
    flex: 1 1 auto;
    min-width: 0;
}

.editingOptions .chaptersEditor .chapterRow .chapterDeleteButton {
    flex: 0 0 auto;
}
