@import url('https://fonts.googleapis.com/css2?family=Agdasima:wght@400;700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

body {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	position: relative;
}
.root {
	width: 100dvw;
	height: 100dvh;

	box-sizing: border-box;
	background-color: hsl(0, 0%, 8%);
	overflow: hidden;

	font-family: "Inter", sans-serif;
	font-optical-sizing: auto;
	font-weight: 400;
	font-style: normal;
	font-size: 16px;

	color: white;

	line-height: 1.5em;
	position: relative;
}
.root.standard {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: min(500px, 50%) auto;
	grid-gap: 5px;
}
.browser {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-gap: 5px;
}
.browser-container {
	display: grid;
	box-sizing: border-box;
	grid-template-rows: repeat(2, 50%);
	grid-gap: 5px;
	overflow: hidden;
	padding: 5px 0px 5px 5px;
}

.viewport {
	border-radius: 10px;
	overflow-y: scroll;
	background-color: hsl(0, 0%, 10%);
	box-sizing: border-box;
	padding: 10px;
	height: 100%;
	width: 100%;
}

.browser-info h1 {
	text-align: center;
}

h2 {
	font-family: "Agdasima", sans-serif;
	font-weight: 400;
	font-style: normal;
	text-transform: uppercase;
	color: hsl(0,0%,100%,0.2);
	font-size: 16px;
	margin: 0;
	margin-top: 30px;
}

h2:first-child {
	margin: 0;
}

.browser-info .contents-holder {
	box-sizing: border-box;
	display: flex;
	justify-content: center;
}
.browser-info .contents {
	box-sizing: border-box;
	width: min(70ch, calc(100% - 20px));
}
.browser-info .exchange-direction {
	border-radius: 5px;
	text-align: center;
}
.browser-info .interface {
	display: contents;
}
.browser-info .interfaces {
	display: grid;
	grid-template-columns: 40px auto auto; /* 300px; */
	box-sizing: border-box;
	width: 100%;
	grid-gap: 2px;
}
.interfaces .transporting-connection {
	display: grid;
	grid-template-columns: repeat(2, auto);
}
.interfaces .component-exchange {
	color: oklch(77.42% 0.16034 255.745);
}
.interfaces .hardware-exchange {
	color: hsl(50, 100%, 71%);
}

.browser-info .exchange-direction[direction="out"] {
	content: 'out';
	background-color: rgb(0, 89, 179);
	color: oklch(77.42% 0.16034 255.745);
}
.browser-info .exchange-direction[direction="in"] {
	content: 'in';
	background-color: hsl(30, 100%, 35%);
	color: oklch(86.299% 0.1417 53.634);
}
.browser-info .exchange-direction[direction="in-out"] {
	content: 'in';
	background-color: hsl(270, 100%, 35%);
	color: hsl(270, 100%, 73%);
}
.list {
	display: flex;
	flex-direction: column;
}
.list .list-item {
	min-height: 1lh;
	vertical-align: middle;
	transition: background-color 0.4s;
	position: relative;
	order: 0;
}
.list .list-item::before {
	display: inline-block;
	content: ' ';
	width: 5px;
	height: 20px;
	position: relative;
	top: 2.5px;
	border-radius: 5px;
	margin-right: 5px;
	background-color: hsl(0, 0%, 15%);
}
.list .list-item:hover {
	background-color: hsl(0, 0%, 12%);
}

.list .list-item[kind="component"]::before {
	background-color: hsl(210, 100%, 35%);
}
.list .list-item[kind="external-component"]::before {
	background-color: hsl(0, 0%, 25%);
}
.list .list-item[kind="hardware"]::before {
	background-color: hsl(50, 100%, 35%);
}
.list .list-item[kind="function"]::before {
	background-color: hsl(160, 100%, 35%);
}
.list .list-item[kind="field"]::before {
	background-color: hsl(46, 100%, 35%);
}

span[contenteditable="plaintext-only"] {
	all: unset;
}
span.writable {
	display: inline-block;
	min-width: 1ch;
	min-height: 1lh;
	text-align: left;
	cursor: text;
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s;
}
span.writable:hover, span[contenteditable="plaintext-only"] {
	border-color: white;
}

.fields .type {
	color: hsl(46, 100%, 35%);
}
.fields .type::before {
	content: ':';
	padding: 0 1ch;
	border-bottom: none;
}
.fields .type:hover {
	border-color: hsl(46, 100%, 35%);
}

button {
	all: unset;
	min-height: 1lh;
	min-width: 1lh;
	margin: 0 2px;
	text-align: center;
	user-select: none;
	border-radius: 5px;
	cursor: pointer;
	background-color: hsl(0, 0%, 15%);
	transition: background-color 0.4s;
}
button:hover {
	background-color: hsl(0, 0%, 20%);
}
button.enabled {
	background-color: oklch(0.7 0.15 80);
}

.list .list-item .info {
	font-size: 0.8em;
	color: hsl(0, 0%, 50%);
	padding: 0 5px;
}

.canvas-area {
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	display: grid;
	grid-gap: 5px;
	overflow: hidden;
	padding: 5px 5px 5px 0px;
}

canvas {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	background-color: hsl(0, 0%, 12%);
	overflow: hidden;
	border-radius: 10px;
}

.overlay {
	position: fixed;
	bottom: 0;
	right: 0;
}

.overlay button {
	all: unset;
	margin: 5px;
	padding: 0px 10px;
	cursor: pointer;
	color: hsl(0, 0%, 100%, 0.2);
	font-size: 0.8em;
	border-radius: 5px;
	outline: 1px solid hsl(0, 0%, 100%, 0.0);
	transition: outline-color 0.3s;
}

.overlay button:hover {
	outline: 1px solid hsl(0, 0%, 100%, 0.2);
}
.menu {
	box-sizing: border-box;
	display: inline-block;
	position: absolute;
	overflow: none;
	width: 100%;
	height: 100%;
	pointer-events: none;
	/* backdrop-filter: blur(3px); */
}
.menu-contents {
	box-sizing: border-box;
	border-radius: 5px;
	display: inline-block;
	position: sticky;
	overflow: hidden;
	pointer-events: all;
}
.menu-contents-item {
	padding: 0px 10px;
	box-sizing: border-box;
	cursor: pointer;
	background-color: hsl(0, 0%, 25%);
	transition: background-color 0.3s;
}
.menu-contents-item:hover {
	filter: brightness(130%);
}
.menu-contents-item[style="component"] {
	background-color: hsl(210, 100%, 35%);
}
.menu-contents-item[style="function"] {
	background-color: hsl(160, 100%, 35%);
}
.menu-contents-item[style="hardware"] {
	background-color: hsl(50, 100%, 35%);
}
.menu-contents-item[style="delete"] {
	background-color: hsl(0, 100%, 35%);
}
.exchange-item-list {
	display: inline-block;
}
.exchange-item {
	background-color: hsl(0, 0%, 8%);
	display: inline-block;
	padding: 5px;
	margin: 2.5px;
	border-radius: 5px;
}
.diagram-view-container {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	position: relative;
}

.diagram-view-container .canvas-container {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
}

.diagram-view-container .hud {
	position: absolute;
	top: 5px;
	left: 5px;
}
.diagram-view-container .hud .name {
	display: inline-block;
	color: hsla(0, 0%, 100%, 0.5);
	padding: 5px 10px;
	border-radius: 5px;
	background-color: hsl(0, 0%, 8%);
}
pre {
	background-color: hsl(0, 0%, 8%);
	border-radius: 5px;
	padding: 5px;
	overflow: scroll;
}

.bubble {
	position: fixed;
	right: 30px;
	bottom: 30px;
	max-width: 400px;
	padding: 30px;
	justify-content: center;
	align-items: center;
  	border-radius: 30px;
	box-sizing: border-box;

	backdrop-filter: blur(2px);
	background-color: hsla(210, 100%, 50%, 0.2);
	color: hsla(210, 100%, 70%);
	box-shadow:
		0px 0px 10px 0px hsla(210, 100%, 70%, 0.2);

	border: 1px solid hsl(210, 100%, 70%);
}
.bubble .progress-controls {
	box-sizing: border-box;
	margin-bottom: 20px;
	width: 100%;
	display: grid;
	grid-template-columns: auto min-content;
	align-items: center;
}
.bubble .progress-controls button {
	background-color: hsla(210, 100%, 50%, 0.2);
}
.bubble .progress-container {
	box-sizing: border-box;
	height: 5px;
	overflow: hidden;
	border-radius: 5px;
	background-color: hsla(210, 100%, 50%, 0.2);
}

.bubble .progress-container .progress {
	height: 100%;
	box-sizing: border-box;
	background-color: hsla(210, 100%, 70%);
}

button[highlight="bubble"] {
	text-shadow: 0px 0px 1px hsl(210, 100%, 70%);
}
.path {
	padding: 0px 5px;
	display: flex;
}
.path:nth-child(odd) {
	background-color: hsl(0, 0%, 12%);
}
.path:nth-child(even) {
	background-color: hsl(0, 0%, 14%);
}
.path .connection {
	display: inline-block;
	margin: 5px 0px;
	text-align: center;
	white-space: nowrap;
}
.path .connection[kind="external component"] {
	color: hsl(0, 0%, 71%);
}
.path .connection[kind="component"] {
	color: hsl(210, 100%, 71%);
}
.path .connection[kind="hardware"] {
	color: hsl(50, 100%, 71%);
}
.path .item {
	padding: 5px;
	border-radius: 5px;
	display: inline-block;
	margin: 5px 0px;
	cursor: pointer;
}
.path .item[kind="external component"] {
	color: hsl(0, 0%, 71%);
	background-color: hsl(0, 0%, 25%);
	outline-color: hsl(0, 0%, 25%);
}
.path .item[kind="component"] {
	color: hsl(210, 100%, 71%);
	background-color: hsl(210, 100%, 30%);
	outline-color: hsl(210, 100%, 30%);
}
.path .item[kind="hardware"] {
	color: hsl(50, 100%, 71%);
	background-color: hsl(50, 100%, 35%);
	outline-color: hsl(50, 100%, 35%);
}
.path .item.source, .path .item.target {
	outline-style: dashed;
	outline-width: 2px;
	outline-offset: -2px;
	background-color: transparent;
}
.tag {
	box-sizing: border-box;
	padding: 5px 10px 5px 25px;
	margin: 5px;
	background-color: oklch(0.7 0.15 80);
	--bevel-size: 15px;
    clip-path: polygon(
        var(--bevel-size) 0,
        100% 0,
        100% 100%,
        var(--bevel-size) 100%,
        0 calc(100% - var(--bevel-size)),
        0 var(--bevel-size)
    );
	border-radius: 5px;
	position: relative;
	white-space: nowrap;
	outline: 1px dashed hsl(0, 0%, 8%);
	outline-offset: -5px;
}
.tag::before {
	content: '';
	position: absolute;
	background-color: hsl(0, 0%, 8%);
	top: 50%;
	left: 10px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	transform: translateY(-50%);
}
