* {
	
}

.translated {
	visibility: hidden;
}

:root {
	--inputs-height: 6dvh;
}

/*Deletes the arrows next to number inputs*/
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}
h1{
	font-size: max(4dvh, 1.5rem);
}

canvas {
	width: calc(100% - 2rem);
	height: calc(100% - 2rem);
	max-height: 4fr;
}

#text_overlay_input{
	position: absolute;
	color: white;
	width: calc(100% - 2rem);
	height: calc(100% - 2rem);
	z-index: 1;
	overflow: hidden;
	pointer-events: none;
}

@media (orientation: portrait){
	#disclaimer {
		position: fixed;
		top:0;
		left: 0;
		z-index: 10;
		height: 100dvh;
		width: 100dvw;
		background-color: #111;
		pointer-events: all;
		    display: flex;
    flex-direction: column; /* stack children vertically */
    align-items: center;    /* optional: center horizontally */
    justify-content: center; /* optional: center vertically */
	}

	#disclaimer p {
		margin: 1dvh 10dvw; /* spacing */
		color: white;
		font-size: max(5dvw, 3dvh);
		height: 30dvh;
		margin-top: 2rem;
		text-align: justify;
	}

	#disclaimer img {
		height: 70dvh;
		margin-bottom: 2rem;
	}

	body {
		height: 100dvh;
		overflow-y: hidden;
	}

}


@media (orientation: landscape){
	#disclaimer {
		display: none;
	}
	#Body{
		position: absolute;
		top: 0rem;
		bottom: 0rem;

		display: grid;
		width: 100%;
		height: 100%;

		grid-template-rows: 0.5fr minmax(500px, 7fr);
		overflow-y: auto;
		/*grid-auto-columns: auto;*/
	}

	#title_div {
		grid-column: 1;
		grid-row: 1;
		display: flex;
		justify-content: center;
		align-items: center;
		place-content: center;
		height: 100%;
	}

	#Content{
		grid-row: 2;
		display: grid;
		grid-template-rows: 4fr max(3rem, calc(var(--inputs-height) + 10px)) 2fr;
		grid-template-columns: 100%;
		place-content: center;
		height: auto;
		width: 100%;
	}

		

	#display-section {
		grid-row: 1;
		display: grid;
		grid-template-columns: 4fr 1fr 4fr;
		width: 100%;
	}

	#info-section {
		grid-row: 2;
		display: grid;
		grid-template-columns: 4fr 1fr 4fr;
		height: auto;
		width: 100%;
	}

	/* --------------- Function input ---------------- */

	#input-section {
		grid-row: 3;
		display: flex;
		place-content: center;
		width: 100%;
		height: auto;

		display: grid;
		grid-template-columns: 50% 50%;
		grid-template-rows: 5rem 8rem;

	}

	#F-definiton {
		grid-row: 1;
		grid-column: 1/3;
		display:flex;
		place-content: center;
		margin-top: 0;
	}
	#F-definiton p{
		font-size: 1.2rem;
		display: flex;
		justify-content: center; /* horizontal center */
		align-items: center;
	}

	#f1, #f2 {
		font-size: 1em;
		color: black;
		font-family: MathJax_Math;
	}

	#div-function1 {
		grid-row: 2;
		grid-column: 1/2;
	}

	#div-function2 {
		grid-row: 2;
		grid-column: 2/3;
		
	}

	.div-func {
		display:flex;
		place-content: center;
		display: grid;
		grid-template-rows: 30% 70%;
		grid-template-columns: max(15%, 12dvw) min(85%, 38dvw);
	}

	.div-func .func-name {
		grid-column: 1;
		grid-row: 1/3;
		font-size: 2dvw;
		
		display: flex;
		justify-content: center; /* horizontal center */
		align-items: center;
	}



	.div-func .func-render {
		grid-column: 2;
		grid-row: 2;
		font-size: 1.2rem;
		margin-top: 0;
		display: flex;
		flex-direction: column-reverse;
		overflow: auto;

	}
	

	.div-func input {
		grid-column: 2;
		grid-row: 1;
		font-family: inherit;
		line-height:inherit;
		color:#2e3750;
		border-radius: 9999em;
		border: 3px solid #649e97;
		margin: 2px 10px;
		text-align: center;
	}

	::placeholder {
		color:#cbd0d5;
	}


	/* -------------- Grids ---------------- */

	.canvasContainer{
		display: flex;
		flex: 1;
		justify-content: center;
		align-items: center;

		min-height: 50px;
		min-width: 50px;
		overflow: hidden;
	}

	#input_display{
		background-color: white;
		grid-column: 1/2;
		grid-row:1;

		position: relative;

	}

	#output_display{
		background-color: white;
		grid-column: 3/4;

		position: relative;
	}

	.grid_numbers{
		position: absolute;
		color: rgba(255,255,1,1);
		font-size: 1dvw;
	}


		

	#arrow{
		grid-column: 2/3;

		display: grid;
		place-content: center;
	}
	#svg_Vertical {
		display: none;
	}

	/* --------------------------- Input and edit section ------------------------- */


	#imageButtons {
		height: var(--inputs-height);
		grid-column: 1;
		margin-left: 1rem;
		min-height: 1.8rem;
	}

	#imageButtons button{
		height: 100%;
		width: min(150px, 18dvw);
		cursor: pointer;

		font-size: 1rem;
		align-items: center;
		background-color: #fff;
		border-radius: 12px;
		box-shadow: transparent 0 0 0 3px,rgba(18, 18, 18, .1) 0 6px 20px;
  	box-sizing: border-box;
  	color: #121212;
	  flex: 1 1 auto;
	  font-family: Inter,sans-serif;
	  font-weight: 700;
	  outline: none;
	  padding: 0;
	  text-decoration: none;
	  transition: box-shadow .2s,-webkit-box-shadow .2s;
	  white-space: nowrap;
	  border: 1;
	  user-select: none;
	  -webkit-user-select: none;
	  touch-action: manipulation;
	  z-index: 1;
	  
	  overflow: hidden;
  	text-overflow: ellipsis;
	  

	}


	

	#imageButtons button:hover {
		background-color: #121212;
		color: white;
	   
	}


	#editBtn{
		display: none;
	}


	

		/*Change*/
	button{
		background-color: transparent;
		cursor: pointer;
	}

}





.modal-container {
	font-family: sans-serif;
	background-color: rgba(0, 0, 0, 0.6);
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
}

.modal {
	background-color: #fff;
	border-radius: 5px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);

	position: relative;
	top: 50%; 
	left: 50%; 
	transform: translate(-50%, -50%);


	max-width: 100%;
	width: 400px;

	max-height: 90dvh;
	overflow-y: auto;
}

.modal-content {
	padding: 20px;
}

.modal-form div {
	margin: 20px 0;
	margin-right: 20px;
}

.modal-form label {
	display: block;
	margin-bottom: 6px;
}

.modal-form .form-input, .resolution-input {
	padding: 8px;
	width: 100%;
}

.close-btn {
	background: transparent;
	border: none;
	font-size: 25px;
	position: absolute;
	top: 5px;
	right: 12px;
	cursor: pointer;
}

.modal-container .submit-btn {
	padding: 10px 30px;
	font-weight: bold;
	background-color: crimson;
	border: none;
	color: #fff;
	cursor: pointer;

}

/* ---------------------- For locked ratio ------------- */

#sizeInput {
	display: grid;
	grid-template-columns: 8fr 1.5fr;
	row-gap: 20px;
	grid-template-rows: auto auto;
}

#sizeInput .form-input {
	grid-column: 1/2;
	margin: 0;
	padding: 8px;
	width: 90%;
}
#sizeInput label {
	display: block;
	margin-bottom: 6px;
}
#linkContainer {
	grid-column: 2/3;
	grid-row: 1/4;
	display: flex;
	align-content: center;
	align-items: center;
}
#linkBtn {
	cursor: pointer;
	background-color: transparent;
	border:none;
}


/*---------- Lock transformations button stuff -------------*/

#lockBtn {
	position:absolute;
	height: 2rem;
	width: 2rem;
	bottom: 25px;
	right: 25px;
	z-index: 1;
	background-color: transparent;
	border: none;
	cursor: pointer;
}


/*--------------------- Time related stuff ----------------*/

#time-container {
	grid-column: 3;
	display: grid;
	grid-template-columns: 10% 58% 12% 10% 10%;
	grid-template-rows: auto;
	min-width: 0;
	margin-left: 1rem;
	margin-right: 1rem;
	padding: 0;
	align-items: stretch;
	height: var(--inputs-height);
	max-height: var(--inputs-height);
	min-height: 1.5rem;
}


.slider {
  -webkit-appearance: none;
  width: calc(100% - 15px);
  height: 15px;
  background: #000;
  outline: none;
  border: 3px solid #649e97;
  border-radius: 8px;
  transform: translate(0, calc(max(var(--inputs-height), 1.5rem)/2 - 12px)); /*Container height/2 - ~half the height of the element*/
}


/* for chrome/safari */
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: min(25px, 1.5rem);
  background: #000;
  cursor: pointer;
  border: 3px solid #99f0e5;
  border-radius: 4px;
}

/* for firefox */
.slider::-moz-range-thumb {
  width: 20px;
  height: min(25px, 1rem);
  background: #000;
  cursor: pointer;
  border: 3px solid #99f0e5;
  border-radius: 4px;
}


#time-container .text {
	grid-column: 3;
	height: var(--inputs-height);
	min-height: 1.5rem;
	width: 100%;
	font-size: 2dvw;
	display: flex;
  justify-content: center; /* horizontal center */
  align-items: center;     /* vertical center */
  /*transform: translateY(-10px);*/
}

.stack {
	grid-column: 4;
	height: 8dvh;
	position: relative;
}

.overlap {
	position: absolute;   /* stack them in the same spot */
	left: 0;
	top: 0;
	height: var(--inputs-height);
	min-height: 1.5rem;
}

#time-input {
	z-index: 0;
	width: 100%;
	height: var(--inputs-height);
	min-height: 1.5rem;
	border: none;
	color: black;
	font-size: 1.9dvw;
	background-color: transparent;
}

#time-input-activate{
	z-index: 1;
	width: 100%;
	height: var(--inputs-height);
	min-height: 1.5rem;
	background-color: transparent;
	border: none;
	/*cursor: default;*/
}


#time-container .svg-button {
	height: var(--inputs-height); /* why does 100% doesn't work? */
	min-height: 1.5rem;
	overflow: hidden;
	border: none;
}

#time-container .svg-button:active {
  transform: scale(0.9); /* shrink to 90% while clicked */
}

#time-state-button {
	grid-column: 1;
}
#settings-button{
	grid-column: 5;
}

/*JS*/
.modal-container.show-modal {
	display:block;
}

#editBtn.show-modal {
	display: inline-block; 
}




/*  -------------------------- Information  -------------------------------------------*/
.helpframe{
	padding: 0px;
	color: rgba(0, 0, 0, 0);
	background-color: rgba(0, 0, 0, 0.9);
	border-style: none;
	border-radius: 5px;
	width: 50px;
	height: 50px;
	overflow: hidden;
	transition:.25s;
	
	z-index: 3;

	position:absolute;
	top: 10px;
	left: calc(2rem + 50px);

}
	
.helpframe:hover{
	color: white;
	width:40dvw;
	height:75dvh;
}
	
.helpframe:before {
	font-size: 40px;
	font-weight: bold;
	color: white;
	content: '?';
	position: absolute;
	height: 100%;
	width: 100%;
	text-align: center;
	line-height: 50px;
}
	
.helpframe:hover:before {
	color: rgba(0, 0, 0, 0);
}

.helpframe li {
	margin-bottom: 10px;
}

.scrollframe {
	box-sizing: border-box;
	padding: 20px 20px 10px;
	overflow: auto;
	width:40dvw;
	height:75dvh;
	position: relative;
	left:0px;
	top:0px;
}
	
.textbox {
	font-size: x-large;
	color: white;
	text-align: center;
	background-color: rgba(0, 0, 0, 0.5);
	border-style: none;
	border-radius: 5px;
	transition:.25s;
}
	
.textbox:hover {
	border-style: solid;
	border-width: 2px;
	border-color: white;
}
	
a:link {
	color: inherit;
	text-decoration: inherit;
	font-weight: bold;
}

a:visited {
	color: inherit;
	text-decoration: inherit;
	font-weight: bold;
}
	
a:hover {
	text-decoration: underline;
}


/* ----------------- For examples ---------------- */

#examples-button-container {
	width: 50px;
	height: 50px;
	/*overflow: hidden;*/
	position:absolute;
	top: 10px;
	left: 1rem;
	z-index: 3;
}

#examples-button {
	padding: 0px;
	color: rgba(0, 0, 0, 0);
	background-color: rgba(0, 0, 0, 0.9);
	border-style: none;
	border-radius: 5px;
	transition:.25s;
	
	z-index: 3;

	font-size: 40px;
	font-weight: bold;
	color: white;

	height: 100%;
	width: 100%;
}




#examples-container button{
	width: 100%;
	height: 80px;
	margin: 20px 0;
	margin-right: 20px;
	display: flex;
	align-items: center;

	background-color: whitesmoke;

	appearance: none;
	border: 2px solid #1A1A1A;
  border-radius: 15px;
  box-sizing: border-box;
  color: #000;
  transition: all 300ms cubic-bezier(.23, 1, 0.32, 1);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  width: 100%;
  will-change: transform;
}

#examples-container button:disabled {
  pointer-events: none;
}

#examples-container button:hover {
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
  transform: translateY(-2px);
}

#examples-container button:active {
  box-shadow: none;
  transform: translateY(0);
}

#examples-container button img {
	height: 70px;
	width: 100px;
	object-fit: contain;
}

#examples-container button span {
	font-family: sans-serif;
	font-size: 1.3rem;
	padding-left: 10px;
}

/*----------------- Language -------------------- */
#language-container {
	width: 100px;
	height: 50px;
	border-style: none;
	border-radius: 5px;

	background-color: rgba(0,0,0,0.9);
	position:absolute;
  
	 z-index: 3;
  top: 10px;
  right: 1rem;

  display: flex;
  align-items: center;
}

#langSelect {
 		width: 100%;
 		height: 100%;
 		display: flex;
 		align-items: center;
 		appearance: none;
 	  box-sizing: border-box;
 	  color: #000;

 	  appearance: none;
 	  -webkit-appearance: none;
 	  -moz-appearance: none;
 	  background: transparent;
 	  border: none;
 	  outline: none;
   	
   	font-family: sans-serif;
   	color: white;
   	font-size: 1rem;
   	  text-align: center;
   	  cursor: pointer;
}

#language-container::after {
  position: absolute;
  right: 10px;
  color: white;
  font-size: 0.7rem;
  pointer-events: none;
}

/* dropdown list (for most modern browsers) */
#langSelect option {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background: transparent;
	border: none;
	outline: none;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
}

/* --------------------------- Hover tooltip */

.tooltip {
	position: relative;
  display: inline-block;
  cursor: pointer;
}

.left-tool {
}

.right-tool {
	right: 0;
	transform: translateX(0); /* no centering */
}

.middle-tool {
	left: 50%;
  transform: translateX(-50%);
}

/* Hidden tooltip text */
.tooltip .tooltip-text {
	visibility: hidden;
  position: absolute;
  bottom: -30px; /* Show below */
  background-color: #333;
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 13px;
  white-space: nowrap;
}

/* Show text when hovering */
.tooltip:hover .tooltip-text {
  visibility: visible;
}