/* main layout */
ion-content::part(scroll) {
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: lightgray white;
}

ion-router-outlet {
	max-width: 460px;
}
ion-router-outlet.editMode2 {
	max-width: 100%;
}
ion-menu.editMode2 {
	max-width: 300px;
}
/* ion-menu.hideMenu {
	display: none;
} */

ion-split-pane {
	justify-content: center;
}

/* NAVIGATION */

.pageTitle {
}

.pageSubtitle {
	font-size: small;
	color: grey;
}

.toc ion-label {
	font-size: 0.85rem !important;
	line-height: 1.2 !important;
}

.tocFolder.depth-0 .tocLayer.layer-0 {
	font-size: 1.3rem;
}

.activeMenuItem .layer-1 .text {
	color: white;
}

/* PHRASES */

.phrasesBlock {
	/* max-width: 400px; */
}

.phraseBlock {
	padding: 5px;

	margin-inline: 5px;
	/* border: 1px solid rgba(255, 255, 255, 1); */
	border-radius: 10px;
}

.voiceBlock {
	display: flex;
	align-items: center;
	font-size: small;
	color: grey;
	margin-bottom: 0.5rem;
}

.voiceIcon {
	margin-right: 0.5rem;
}

.voiceIcon ion-icon {
	font-size: 2rem;
	/* color: grey; */
	color: var(--ion-color-primary);
}

.phraseLayer.layer-0 {
	font-size: 1rem;
}

.phraseLayer.layer-1 {
	padding-top: 5px;
}

.phraseBlock .phraseActions {
	font-size: 8px;
	color: grey;
	display: flex;
	flex-direction: row;
	justify-content: flex-end;
	align-items: center;
}

.phraseBlock .phraseNum {
	height: 7px;
}

/* .phraseWrapper:nth-child(1) {
	display: none;
} */

.phraseWrapper.unattached {
	background-color: lightgrey;
}

.playPhraseButton {
	/* color: red; */
}

.phraseBlock.active .layer-1,
.phraseBlock.active .phraseActions {
	/* color: lightgray; */
}

.phraseBlock ion-button {
	height: unset;
	font-size: unset;
	color: unset;
	margin: unset;
	z-index: 0;
}

.phraseBlock.active {
	position: relative;
}
.phraseBlock.active:before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: -1;
	background: rgba(var(--ion-color-primary-rgb), 0.3);
	filter: blur(10px);
}

.pageTitleBlock {
	text-align: center;
	padding: 0.5rem;
}

.pageTitleLayer {
	margin-bottom: 0.5rem;
}

.pageTitleLayer.layer-1,
.tocLayer.layer-1,
.phraseLayer.layer-1 {
	color: grey;
	font-size: 0.8rem;
}

.layerName {
	font-size: small;
	color: grey;
	display: inline-block;
	margin-right: 0.5rem;
}

.pageTitleLayer .path {
	font-size: small;
	color: grey;
	display: inline-block;
	/* margin-left: 0.5rem; */
}

.phraseLayer .text {
	display: inline-block;
	/* margin-left: 0.5rem; */
}

.phrase-0 {
	display: none;
}

/* .pageTitleLayer.index-1 {
	margin-left: 0.5rem;
}

.pageTitleLayer.index-2 {
	margin-left: 1rem;
} */

.settingsTree {
	/* border: 1px solid lightgray; */
}

.settingsTree .level-1 {
	margin-top: 10px;
}

.settingsTree .level-2,
.settingsTree .level-3,
.settingsTree .level-4,
.settingsTree .level-5 {
	margin-left: 15px;
	margin-top: 10px;
}

.settingsHeader {
	/* font-weight: bold; */
	color: var(--ion-color-primary);
}

.settingsLabel {
	display: inline-block;
	/* color: var(--ion-color-medium); */
}

.waveformPlayer {
	position: sticky;
	top: 0px;
	background-color: white;
	z-index: 1;
}

.waveformPlayer video {
	width: 100%;
	max-height: 260px;
}

.tocLayer,
.pageTitleLayer,
.phraseLayer,
.htmlPhraseLayer {
	display: flex;
	align-items: center;
}

.pageTitleLayer {
	justify-content: center;
}

.settingsLabel div,
.settingsHeader div {
	/* div is .title or .description */
	display: inline-block;
}

.settingsLabel .description,
.settingsHeader .description {
	color: gray;
	font-size: small;
}

.settingsLabel .title,
.settingsHeader .title {
	margin-right: 0.5rem;
}

.settingsNumberInput {
	max-width: 3.5rem;
}

.htmlPage.page-index {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
}

.page-index .pageTitleBlock {
	display: none;
}

.htmlPage.page-index .htmlPhraseLayer {
	justify-content: center;
}

.playbackRate ion-select::part(icon) {
	display: none;
}

.playbackRate ion-select::part(text) {
	color: var(--ion-color-primary);
	/* font-size: small; */
}

.phraseLayer .text,
.pageTitleLayer .text,
.htmlPhraseLayer .text {
	user-select: text;
}

.htmlPage {
	padding: 1rem;
}

.authBlock {
	margin-top: 1rem;
}

.authBlock .authInfoBlock {
	display: flex;
	align-items: center;
	margin-top: 1rem;
	justify-content: center;
}

.authBlock .nameAndLogout {
	flex-direction: column;
	display: flex;
	justify-content: space-around;
	align-items: center;
	margin-left: 0.5rem;
}

.authBlock .resetAuthStateButton {
	color: grey;
}

.authBlock ion-button,
.authBlock .button-native {
	margin: 0;
}

.authBlock .userRoles {
	font-size: small;
	color: grey;
}

[contenteditable]:focus {
	outline: 0px solid transparent;
	background: rgba(var(--ion-color-danger-rgb), 0.1);
}

/* wavesurfer  */

region.wavesurfer-region {
	background-color: rgba(var(--ion-color-primary-rgb), 0.2) !important;
}

handle.wavesurfer-handle {
	background-color: rgba(var(--ion-color-primary-rgb), 0.4) !important;
}

region .remove-region-button {
	font-size: 14px !important;
	line-height: unset !important;
	right: 2px !important;
	color: rgba(var(--ion-color-primary-rgb), 0.4) !important;
}

region[title='0:00'],
region[title='0:00-0:00'] {
	visibility: hidden;
}

#waveformContainer wave {
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: lightgray white;
}

/* EDIT MODE 2 */

.editMode2Block {
	display: flex;
}

.editMode2Block .phrasesPlayColumn {
	margin-inline: 0.2rem;
}

.editMode2Block .linearBackground {
	background-size: 100% 20px;
	background-image: linear-gradient(
		white,
		white 1px,
		#ccc 2px,
		#ccc 1px,
		white 2px
	);
}

.editMode2Block .textarea {
	width: 100%;
	padding: 0;
	resize: none;
	display: inline-block;
	line-height: 20px;
	white-space: nowrap;
	vertical-align: top;
	border: none;
	padding-bottom: 0.5rem;
	font-size: 14px;
	overflow-y: hidden;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: lightgray white;
}

.editMode2Block .textarea:focus {
	border: none;
	outline: none;
}

.phrasesPlayColumn {
	display: flex;
	flex-direction: column;
}

.phrasesPlayColumn .playPhraseButtonContainer {
	cursor: pointer;
	padding-inline: 0.2rem;
	height: 20px;
	display: flex;
	align-items: center;
}

.phrasesPlayColumn .playPhraseButtonContainer:first-child {
	display: none;
}

.phrasesPlayColumn .playPhraseButton.active {
	background-color: var(--ion-color-primary);
	color: white;
}

ion-button.playPhraseButton {
	height: unset;
	font-size: unset;
	color: unset;
	margin: unset;
	z-index: 0;
}

.phrasesPlayColumn .playPhraseButton {
	font-size: 8px;
	color: grey;
	display: flex;
	flex-direction: row;
	justify-content: flex-end;
	align-items: center;
}

@media (prefers-color-scheme: dark) {
	.waveformPlayer {
		background-color: #121212;
	}

	.editMode2Block .linearBackground {
		background-size: 100% 20px;
		background-image: linear-gradient(
			#121212,
			#121212 1px,
			#ccc 2px,
			#ccc 1px,
			#121212 2px
		);
	}
}
