@charset "utf-8";

:root {
	--color-terminal-black: #1a1a1a;
	--color-terminal-orange: #ffa500;
	--color-terminal-red: #ff6347;
	--color-terminal-green: #9bdd54;
	--color-terminal-blue: #658ec5;
}

.terminal {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: var(--gutter-thin);
	background-color: var(--color-terminal-black);
	color: white;
	font-family: Menlo, Courier, monospace;
	overflow-x: hidden;
	overflow-y: scroll;
	box-sizing: border-box;
	position: relative;
}

.terminal input[type=text],
.terminal input[type=password] {
	width: 100%;
	height: 2em;
	margin: 0;
	padding: 0;
	background-color: transparent;
	color: inherit;
	font-size: inherit;
	font-family: inherit;
	border: 0;
	-webkit-appearance: none;
	appearance: none;
}

.terminal__output {
	margin: 0;
	padding: 0;
}

.terminal__output > div,
.terminal__output > pre {
	overflow-x: scroll;
}

.terminal__output .message__warning { color: var(--color-terminal-orange); font-weight: bold; }
.terminal__output .message__error   { color: var(--color-terminal-red); font-weight: bold; }

.terminal__prompt {
	height: 2em;
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: center;
}

.terminal__prompt--info {
	flex-shrink: 0;
}

.terminal__prompt--info .user { color: var(--color-terminal-green); font-weight: bold; }
.terminal__prompt--info .path { color: var(--color-terminal-blue); font-weight: bold; }

.terminal__prompt--info .user,
.terminal__prompt--info .path {
	display: inline-block;
	max-width: 270px;
	overflow-x: hidden;
	text-overflow: ellipsis;
}

@media all and (max-width: 1000px) {
	.terminal__prompt--info .user,
	.terminal__prompt--info .path {
		max-width: 200px;
	}
}

@media all and (max-width: 700px) {
	.terminal__prompt--info .user,
	.terminal__prompt--info .separator {
		display: none;
	}
}

@media all and (max-width: 500px) {
	.terminal__prompt--info .user,
	.terminal__prompt--info .path {
		max-width: 110px;
	}
}

.terminal__prompt--command {
	width: 100%;
}

.terminal__editor {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: inherit;
	margin: inherit;
	padding: inherit;
	box-sizing: border-box;
	/*display: flex;*/
	display: none;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
}

.terminal__editor.shown {
	display: flex;
}

.terminal__editor--textarea {
	resize: none;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	background-color: transparent;
	color: inherit;
	font-size: inherit;
	font-family: inherit;
	border: 0;
}

.terminal__editor--interface {
	width: 100%;
	flex-shrink: 0;
	margin-top: var(--gutter-thin);
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
}

.terminal__editor .filename {
	text-align: left;
	margin-right: auto;
}

.terminal__editor .cancel,
.terminal__editor .save {
	cursor: pointer;
}

.terminal__editor .cancel:hover,
.terminal__editor .save:hover {
	font-weight: bold;
}

.terminal__editor .cancel {
	color: var(--color-terminal-red);
	margin-right: var(--gutter-thin);
}

.terminal__editor .save {
	color: var(--color-terminal-green);
}

.terminal__history {
	position: fixed;
	bottom: var(--gutter-thin);
	right: var(--gutter-thin);
	display: none;
}

.terminal__history.hidden {
	display: none;
}

.terminal__history .previous,
.terminal__history .next {
	cursor: pointer;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

@media all and (any-hover: none) {
	/* Touch devices usually don't have up and down arrows */
	.terminal__history {
		display: unset;
	}
}
