:root {
	--bg-color: #ffffff;
	--text-color: #222;
	--link-color: #25617e;
	--header-bg: #f4f4f4;
	--border-color: #ddd;
	--code-bg: #f4f4f4;
	--code-border: #ddd;
	--grouped-bg: #f4f4f4;
	--map-info-bg: rgba(255, 255, 255, 0.8);
	--caption-color: grey;
	--footer-color: grey;
	--news-title-color: black;
	--news-link-color: black;
	--event-time-color: #777;
	--input-bg: #ffffff;
	--input-border: #ccc;
	--input-text: #222;
	--toggle-bg: #ddd;
	--toggle-active: #4CAF50;
}

body.dark-mode {
	--bg-color: #1a1a1a;
	--text-color: #e0e0e0;
	--link-color: #5ba7d4;
	--header-bg: #2a2a2a;
	--border-color: #444;
	--code-bg: #2a2a2a;
	--code-border: #444;
	--grouped-bg: #252525;
	--map-info-bg: rgba(30, 30, 30, 0.9);
	--caption-color: #aaa;
	--footer-color: #aaa;
	--news-title-color: #e0e0e0;
	--news-link-color: #e0e0e0;
	--event-time-color: #aaa;
	--input-bg: #2a2a2a;
	--input-border: #444;
	--input-text: #e0e0e0;
	--toggle-bg: #444;
	--toggle-active: #5ba7d4;
}

body {
	margin-top: 0;
	margin-bottom: 40px;
	margin-left: auto;
	margin-right: auto;
	max-width: 1000px;
	line-height: 1.6;
	font-size: 18px;
	color: var(--text-color);
	background-color: var(--bg-color);
	/*padding: 0 10px;*/
	padding: 0;
	font-family: Helvetica;
	transition: background-color 0.3s ease, color 0.3s ease;
}
.root-body {
	/*margin-top: 46px;*/
	margin-top: 20px;
	margin-left: 0;
	margin-right: 0;
	width: 96vw;
	/*width: 100%;*/
	max-width: 3000px; /*override max-width: 1000px in body*/
	/*max-width: 100%;*/
	overflow-x: hidden; /*prevents horizontal scroll bar by allowing the body to be under the vertical scroll bar*/
}

.root-rest-of-body {
	max-width: 1000px;
	width: 75vw;
	margin-left: auto;
	margin-right: auto;
}

/* This is the body class for all pages apart from the root page. */
.standard-body 
{
	margin-top: 60px;
	width: 75vw;
}
h1,h2,h3
{
	line-height: 1.2;
}
h2 {
    margin-top: 45px;
}
table
{
	width: 100%;
}
td
{
	vertical-align: top;
}
a
{
	color: var(--link-color);
}
.main
{
	min-height: 400px;
}
.caption
{
	font-size: 0.8em;
	color: var(--caption-color);
	margin-bottom: 20px;
}
#login
{
	text-align: right;
	float: right;
	margin-top: -8px;
}
.map-info {
	padding: 6px 8px;
	background: var(--map-info-bg);
	box-shadow: 0 0 15px rgba(0,0,0,0.4);
	border-radius: 5px;
}


.form-field {
	margin-bottom: 1em;
}

.msg {
	background-color: yellow;
}
.info-notify
{
	background-color: blanchedalmond;
}

.footer {
	font-size: 0.8em;
	color: var(--footer-color);
	text-align: center;
}

#price-plot-canvas
{
	border:1px solid #d3d3d3;
}
#tooltip-canvas
{
	border:1px solid #d3d3d3;
	position:absolute;
	left:-400px;
	top:100px;
	pointer-events:none;
}
#selection-point-canvas
{
	border:none;
	position:absolute;
	left:-400px;
	top:100px;
	pointer-events:none;
}

.eth-address
{
	color: grey;
}
.substrata-logo-top-small
{
	padding-bottom:20px;
}
.logo-root-page
{
	padding-bottom:20px;
}
.buy-visa-image
{
	position: relative;
	top: 9px;
}
.buy-paypal-image
{
	position: relative;
	top: 6px;
	left: -1px;
}
.inline-block
{
	display: inline-block;
}
#mapid
{
	height: 650px;
}
.hidden
{
	display: none;
}

/*These colours should match those in map.js*/
.map-col-mradmin
{
	color: #3388ff; /* blue */
}
.map-col-other
{
	color: #0f9caa; /* blue */
}
.map-col-for-auction
{
	color: #b40d96; /* purpleish */
}
.map-col-highlighted
{
	color: #ef9518;
}

.commands {
	font-size: 0.8em;
	font-family: "Lucida Console", Courier, monospace;
	background-color: var(--code-bg);
	overflow: auto;
}
.code-block {
	/* Style from https://stackoverflow.com/a/48694906 */
	background: var(--code-bg);
	border: 1px solid var(--border-color);
	border-left: 3px solid #f36d33;
	color: var(--text-color);
	page-break-inside: avoid;
	font-family: monospace;
	font-size: 15px;
	line-height: 1.6;
	margin-bottom: 1.6em;
	max-width: 100%;
	overflow: auto;
	padding: 1em 1.5em;
	display: block;
	word-wrap: break-word;
}


.root-auction-list-container {
	/* Use grid layout, works pretty well with putting items side by side, also works well with having a little bit of space between them */
	display: grid;
	/*auto-fit: Fit whatever columns there are into the space. Prefer expanding columns to fill space rather than empty columns.*/
	grid-template-columns: repeat(auto-fit, minmax( /*min=*/ 230px, /*max=*/ 230px));
	grid-auto-flow: row;
	gap: 15px 15px;
}

.root-auction-div {
	margin-bottom: 30px;
}

.root-auction-thumbnail {
	width: 230px; /* for consistency with root-news-thumbnail width*/
	object-fit: cover;
}


.root-news-div-container {
	/* Use grid layout, works pretty well with putting items side by side, also works well with having a little bit of space between them */
	display: grid;
	/*auto-fit: Fit whatever columns there are into the space. Prefer expanding columns to fill space rather than empty columns.*/
	grid-template-columns: repeat(auto-fit, minmax( /*min=*/ 230px, /*max=*/ 230px));
	grid-auto-flow: row;
	gap: 15px 15px;
}

.root-news-div {
	margin-bottom: 30px;
}

.root-news-thumb-div {
	min-height: 160px;
}

.root-news-thumbnail {
	width: 230px;
	height: 131px;
	object-fit: cover;
}

.root-news-title {
	font-weight: bold;
}

.root-news-title a { /*override link colour*/
	color: var(--news-title-color);
}

.root-news-content {
}

.root-news-content a { /*override link colour*/
	color: var(--news-link-color);
	text-decoration: none;
}

.news-image {
	max-width: 650px;
}

.news-post-timestamp {
	font-size: 0.8em;
}

.news-post-content {
	margin-bottom: 60px;
}



/*----------------------------------------Events-----------------------------------------*/
.root-events-div-container {
	/* Use grid layout, works pretty well with putting items side by side, also works well with having a little bit of space between them */
	display: grid;
	/*auto-fit: Fit whatever columns there are into the space. Prefer expanding columns to fill space rather than empty columns.*/
	grid-template-columns: repeat(auto-fit, minmax( /*min=*/ 230px, /*max=*/ 230px));
	grid-auto-flow: row;
	gap: 15px 15px;
}

.root-event-div {
	margin-bottom: 30px;
}

.root-event-thumb-div {
	min-height: 160px;
}

.root-event-thumbnail {
	width: 230px;
	height: 131px;
	object-fit: cover;
}

.root-event-title {
	font-weight: bold;
}

.root-event-title a { /*override link colour*/
	color: var(--news-title-color);
}

.root-event-content {
}

.root-event-content a { /*override link colour*/
	color: var(--news-link-color);
	text-decoration: none;
}

.root-event-time {
	font-size: 0.8em;
	color: var(--event-time-color);
}

.event-image {
	max-width: 650px;
}

.event-post-timestamp {
	font-size: 0.8em;
}

.event-post-content {
	margin-bottom: 60px;
}

.event-datum-title {
	padding-right: 1em;
}
.event-datum {
}

.event-title {
	font-size: 1.2em;
}

.event-description {
	padding-bottom: 1em;
}






.top-section {
	position: relative; /*needed because position: absolute positions relative to 'positioned' ancestor*/
	height: 60vh;
	min-height: 400px;
	max-height: 600px;
	width: 100vw;
}

.top-section-text-container {
	position: absolute;
	width: 75vw;
	top: 150px;
	left: 50vw;
	transform: translate(-50%, 0);
	
	color: white;
	border-radius: 0px;
	margin: 0px;
	padding: 10px;
	font-size: 1.0em;
}

.top-intro-section {
	padding: 10px;
	background-color: rgba(0, 0, 0, 0.6);
	margin-bottom: 40px;
}


.play-webclient-div {
	padding: 10px;
	background-color: rgba(0, 0, 0, 0.6);
	font-size: 1.3em;
	margin-left: auto;
	margin-right: auto;
	width: fit-content; /* make the div just as wide as the 'Enter Substrata in your browser' text */
}

.play-webclient-div a { /*override link colour*/
	color: white;
}



.top-image {
	width: 100vw;
	height: 60vh;
	min-height: 400px;
	max-height: 600px;
	object-fit: cover;
}


.top-logo-section img {
	display: block;
	margin: 10px;
}



#top-image {
	opacity: 1;
	transition: opacity 2s;
}

#top-image.fadeOut {
	opacity: 0;
}


.photo-container {
	display: grid;
	/*auto-fit: Fit whatever columns there are into the space. Prefer expanding columns to fill space rather than empty columns.*/
	grid-template-columns: repeat(auto-fit, minmax( /*min=*/ 230px, /*max=*/ 230px));
	grid-auto-flow: row;
	gap: 15px 15px;
}

.root-photo-img {
	width: 230px;
	height: 172px;
	object-fit: cover;
	display: block; /*to remove whitespace under the image: https://www.tutorialrepublic.com/faq/how-to-remove-white-space-under-an-image-using-css.php */
}

.photo-midsize-img {
	max-width: 100%;
}


/* Used on parcel page for both screenshots and photos */
.generic-image-container {
	display: grid;
	/*auto-fit: Fit whatever columns there are into the space. Prefer expanding columns to fill space rather than empty columns.*/
	grid-template-columns: repeat(auto-fit, minmax( /*min=*/ 320px, /*max=*/ 320px));
	grid-auto-flow: row;
	gap: 15px 15px;
}

.generic-image {
	width: 320px;
	height: 240px;
	object-fit: cover;
	display: block; /*to remove whitespace under the image: https://www.tutorialrepublic.com/faq/how-to-remove-white-space-under-an-image-using-css.php */
}






.article-image {
	max-width: 75vw;
}

.script-log {
	font-size: 0.9em;
}

.log-timestamp {
	color: cadetblue;
}
.log-ob {
	color:darkcyan
}
.log-error {
	color: firebrick;
}
.log-print {
}


.code-func-definition {
	margin-top: 2em;
	margin-bottom: 0.5em;
	font-size: 1.2em;
	font-weight: 400;
	background-color: var(--header-bg);
}

.code-arg {
	margin-top: 0.3em;
	margin-bottom: 0.3em;
}

.code-arg-code {
	background: var(--code-bg);
	border: 1px solid var(--border-color);
	border-left: 3px solid #caefef;
	color: var(--text-color);
	font-family: monospace;
	font-size: 16px;
	margin-right: 0.5em;
	padding: 0.1em 0.3em;
}

.code-func-description {

}


.code-attr {
	margin-top: 0.3em;
	margin-bottom: 0.3em;
}
.code-attr-code {
	background: var(--code-bg);
	border: 1px solid var(--border-color);
	border-left: 3px solid #caefef;
	color: var(--text-color);
	font-family: monospace;
	font-size: 16px;
	margin-right: 1em;
	padding: 0.1em 0.3em;
}

.code-attr-descrip {
}

.feature-enabled {
	color: green;
}
.feature-disabled {
	color: darkred;
}



.full-width {
	width: 96%;
}

.grouped-region {
	background: var(--grouped-bg);
	padding: 1em;
	margin-bottom: 1em;
}

.field-description {
	color: #444;
	font-size: 0.8em;
}

.danger-zone {
	background: #e97e7e;
	width: 96%;
	text-align: right;
	padding: 0.5em;
}

/* Input and form styling for dark mode */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
	background-color: var(--input-bg);
	color: var(--input-text);
	border: 1px solid var(--input-border);
	padding: 0.5em;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
	border-color: var(--link-color);
	outline: none;
}

/* Dark mode toggle button */
.dark-mode-toggle {
	display: inline-block;
	margin-left: 10px;
	cursor: pointer;
	background: var(--toggle-bg);
	border: 2px solid var(--border-color);
	border-radius: 20px;
	padding: 4px 12px;
	font-size: 14px;
	transition: all 0.3s ease;
	color: var(--text-color);
	text-decoration: none;
}

.dark-mode-toggle:hover {
	background: var(--toggle-active);
	color: white;
}

.dark-mode-toggle::before {
	content: "🌙";
	margin-right: 4px;
}

body.dark-mode .dark-mode-toggle::before {
	content: "☀️";
}
