// Override Radix Dialog.Content max-width for this wide modal
:global(.rt-DialogContent):has([data-testid="SilenceResultModal"]) {
	max-width: 80vw !important;
	width: 80vw !important;
	max-height: 90vh;
}

.root {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.playerWrapper {
	position: relative;
	width: 100%;
	height: 45vh;
	border-radius: variables.$radius-md;
	overflow: hidden;
	background: #000;

	// Force Vidstack player to fill the container exactly
	:global([data-media-player]) {
		width: 100% !important;
		height: 100% !important;
	}

	:global(.vds-video-layout) {
		width: 100%;
		height: 100%;
	}

	video {
		width: 100%;
		height: 100%;
		object-fit: contain;
		display: block;
	}
}

.timelineSection {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.zoomControls {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: variables.$text-secondary;
}

.zoomButton {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid variables.$border-subtle;
	border-radius: variables.$radius-sm;
	background: variables.$bg-default;
	color: variables.$text-primary;
	cursor: pointer;
	font-size: 16px;
	font-weight: 500;
	user-select: none;

	&:hover {
		background: variables.$bg-hover;
	}
}

.timelineContainer {
	position: relative;
	overflow-x: auto;
	overflow-y: hidden;
	border: 1px solid variables.$border-subtle;
	border-radius: variables.$radius-md;
	background: variables.$bg-surface;
}

.timelineInner {
	position: relative;
}

.rulerRow {
	position: relative;
	height: 24px;
	border-bottom: 1px solid variables.$border-subtle;
}

.rulerCanvas {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	height: 24px;
}

.framesRow {
	position: relative;
	height: 48px;
	border-bottom: 1px solid variables.$border-subtle;
	background: #111;
}

.framesCanvas {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	height: 48px;
}

.waveformRow {
	position: relative;
	height: 48px;
	border-bottom: 1px solid variables.$border-subtle;
}

.cutRegionsRow {
	position: relative;
	height: 32px;
}

.infoBar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 13px;
	color: variables.$text-secondary;
}

.infoTotal {
	font-variant-numeric: tabular-nums;
}

.actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 4px;
}

// --- Cut region blocks ---

.cutRegion {
	position: absolute;
	top: 0;
	height: 100%;
	background: rgba(255, 152, 0, 0.3);
	border: 1px solid rgba(255, 152, 0, 0.7);
	border-radius: 2px;
	cursor: grab;
	user-select: none;
	transition: background 0.1s ease;

	&:hover {
		background: rgba(255, 152, 0, 0.4);
	}
}

.cutRegionActive {
	background: rgba(255, 152, 0, 0.5);
	cursor: grabbing;
}

.handleLeft,
.handleRight {
	position: absolute;
	top: 0;
	width: 6px;
	height: 100%;
	cursor: col-resize;
	z-index: 2;
}

.handleLeft {
	left: -3px;
}

.handleRight {
	right: -3px;
}

// --- Context menu ---

.contextMenu {
	min-width: 160px;
	padding: 4px;
	background: variables.$bg-surface;
	border: 1px solid variables.$border-default;
	border-radius: variables.$radius-md;
	box-shadow: variables.$shadow-md;
	z-index: 100;
}

.contextMenuItem {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 8px 12px;
	border: none;
	border-radius: variables.$radius-sm;
	background: none;
	color: variables.$text-primary;
	font-size: 13px;
	cursor: pointer;
	text-align: left;

	&:hover {
		background: variables.$bg-hover;
	}
}

.contextMenuDanger {
	color: variables.$color-danger;
}

// --- Playhead ---

.playhead {
	position: absolute;
	top: 0;
	width: 2px;
	height: 100%;
	background: variables.$color-danger;
	z-index: 10;
	pointer-events: none;
}
