.root {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	height: 100%;
	min-width: 0;
	overflow: hidden;
	background: linear-gradient(180deg, variables.$bg-default 0%, variables.$bg-surface 100%);
	border-top: 1px solid variables.$border-subtle;
	flex-shrink: 0;
	user-select: none;
}

.empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 80px;
}

.emptyText {
	font-size: 13px;
	color: variables.$text-tertiary;
}

/* Toolbar */
.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 40px;
	padding: 0 14px;
	border-bottom: 1px solid variables.$border-subtle;
	background: transparent;
	flex-shrink: 0;
}

.zoomControls {
	display: flex;
	align-items: center;
	gap: 6px;
}

.zoomBtn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: variables.$text-secondary;
	cursor: pointer;
	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;

	&:focus-visible {
		outline: none;
		box-shadow: var(--focus-ring);
	}

	&:hover {
		background: variables.$bg-hover;
		border-color: variables.$border-subtle;
		color: variables.$text-primary;
	}
}

.zoomLabel {
	font-size: 12px;
	color: variables.$text-secondary;
	font-weight: 500;
	min-width: 32px;
	text-align: center;
}

.timeDisplay {
	font-size: 12px;
	color: variables.$text-secondary;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

/* Tracks area */
.tracksArea {
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.labelsColumn {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	width: 68px;
	background: transparent;
	border-right: 1px solid variables.$border-subtle;
	overflow: hidden;
}

.labelCell {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-size: 11px;
	color: variables.$text-tertiary;
	background: transparent;
	border-bottom: 1px solid variables.$border-subtle;
	flex-shrink: 0;
}

.extractBtn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: none;
	border-radius: variables.$radius-sm;
	background: transparent;
	color: variables.$text-tertiary;
	cursor: pointer;

	&:focus-visible {
		outline: none;
		box-shadow: var(--focus-ring);
	}

	&:hover:not(:disabled) {
		background: variables.$bg-hover;
		color: variables.$text-secondary;
	}

	&:disabled {
		cursor: default;
		opacity: 0.7;
	}
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.spin {
	animation: spin 1s linear infinite;
}

/* Scroll container */
.scrollContainer {
	flex: 1;
	overflow-x: auto;
	overflow-y: auto;
	position: relative;
}

.tracksContent {
	position: relative;
	min-width: 100%;
}

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

.ruler {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	cursor: pointer;
}

.trackRow {
	position: relative;
	border-bottom: 1px solid variables.$border-subtle;
	overflow: hidden;
}

/* Playhead */
.playhead {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: variables.$color-danger;
	pointer-events: none;
	z-index: 10;
	transform: translateX(-1px);

	&::before {
		content: "";
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		width: 8px;
		height: 8px;
		background: variables.$color-danger;
		clip-path: polygon(0 0, 100% 0, 50% 100%);
	}
}

/* Placeholder tracks */
.placeholderTrack {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: variables.$bg-canvas;
}

.placeholderLabel {
	font-size: 11px;
	color: variables.$text-tertiary;
}
