/* globals */
:root {
	--lightgray: #dddddd;
	--lightblue: #2f72dc;
	--darkblue: #1f62cc;
	--darkgray: #2a2a2a;
	--medgray: #555555;
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	overflow: hidden;
}

.hide {
	display: none;
}

/* body */
.main-body {
	display: grid;
	grid-template-areas: "header header"
	                     "component-list workspace";
	grid-template-rows: 50px 1fr;
	grid-template-columns: 200px 1fr;
	font-family: Arial, Helvetica, sans-serif;
}

/* header */
.header {
	grid-area: header;
	padding: 5px;
	display: flex;
	justify-content: space-between;
	background-color: var(--darkgray);
	color: white;
	z-index: 1;
}

.header-left, .header-right {
	display: flex;
	align-items: center;
}

.header-center {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}

.header-center a {
	color: white;
	text-decoration: none;
}

.header-center a:hover {
	color: white;
	text-decoration: underline;
}

.header-center h1 {
	margin: 0;
}

.header button {
	font-size: 16px;
	padding: 5px;
	margin: 5px;
}

.header .primary-button {
	background-color: var(--lightblue);
	border: solid 1px var(--lightblue);
	border-radius: 5px;
	color: white;
}

.header .primary-button:hover {
	background-color: var(--darkblue);
	border: solid 1px var(--darkblue);
}

.header .primary-button:disabled {
	background-color: var(--medgray);
	border: solid 1px var(--medgray);
}

.header .primary-button:disabled:hover {
	background-color: var(--medgray);
	border: solid 1px var(--medgray);
}

.header .secondary-button {
	background-color: transparent;
border: solid 1px var(--lightgray);
	border-radius: 5px;
	color: var(--lightgray);
}

.header .secondary-button:hover {
	border: solid 1px white;
	color: white;
}

.header .stored-button {
	width: 25px;
	height: 25px;
	background-color: var(--lightgray);
	mask: url("../assets/img/icons/hamburger.svg");
	mask-size: contain;
	/* versioni più vecchie di chrome richiedono la specifica webkit */
	-webkit-mask: url(../assets/img/icons/hamburger.svg);
	-webkit-mask-size: contain;
}

.header .stored-button:hover {
	background-color: white;
}

.header p {
	margin: 5px;
}

/* component-list */
.component-list {
	grid-area: component-list;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow-y: auto;
	border-right: solid 1px var(--lightgray);
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.spacer {
	width: 90%;
}

.component {
	width: 100%;
	display: flex;
	cursor: pointer;
}

.component:hover {
	background-color: var(--lightgray);
	width: 100%;
	display: flex;
}

.component p {
	padding: 10px;
}

.component img {
	padding: 10px;
	height: 70%;
}

/* workspace */
.workspace {
	grid-area: workspace;
	overflow: hidden;
	min-width: 0;
}

.canvas-container {
	overflow: auto;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

canvas {
	display: block;
}

.canvas-button {
	position: absolute;
	width: 40px;
	height: 40px;
	transform: translate(-50%, -50%);
}

.canvas-button img {
	width: 100%;
	height: 100%;
}

/* popups */
.popup-menu {
	padding: 10px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	background-color: white;
	border-radius: 5px;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
	min-width: 500px;
}

.popup-shadow {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.15);
}

.popup-menu .input-bar {
	margin: 0;
	display: flex;
}

.popup-menu h1 {
	margin: 0;
	margin-bottom: 10px;
	font-weight: normal;
	font-size: 32px;
}

.popup-menu input {
	margin: 5px;
	width: 100%;
	font-size: 16px;
}

.popup-menu button {
	font-size: 16px;
	padding: 2px;
	margin: 5px;
	min-width: 80px;
}

.popup-menu .primary-button {
	background-color: var(--lightblue);
	border: none;
	border-radius: 3px;
	color: white;
}

.popup-menu .primary-button:hover {
	background-color: var(--darkblue);
}

.popup-menu a {
	display: block;
	box-sizing: border-box;
	padding: 5px;
	font-size: 20px;
	color: black;
	background-color: white;
	text-decoration: none;
	border-radius: 5px;
	width: 100%;
}

.example-circuits, .user-circuits {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	max-height: 300px;
}

.popup-menu a:hover {
	background-color: var(--lightgray);
}

/* about */
.about-body {
	display: grid;
	grid-template-areas: "header"
	                     "main";
	grid-template-rows: 50px 1fr;
	grid-template-columns: 1fr;
	font-family: Arial, Helvetica, sans-serif;
}

main {
	grid-area: main;
	width: 100%;
	overflow-y: auto;
}

.about-section {
	margin: 0 auto;
	max-width: 800px;
	font-size: 18px;
}

.about-footer {
	padding: 15px;
	display: flex;
	flex-direction: column;
	align-items: center;
	background-color: black;
	color: white;
}

.pin-img {
	display: inline;
	height: 14px;
	width: 14px;
}

dt {
	display: inline;
}

main img {
	width: 100%;
}

figcaption {
	font-size: 14px;
	color: var(--darkgray);
}

.green {
	font-weight: bold;
	color: #3fff00;
}

.red {
	font-weight: bold;
	color: #ff2400;
}

.gray {
	font-weight: bold;
	color: #555555;
}

.small-text {
	font-size: 16px;
}

.about-footer p {
	margin: 5px;
}
