/* =====================
   Design Tokens
   ===================== */
:root {
  --bg: #0f172a;            /* slate-900 */
  --panel: #111827;         /* gray-900 */
  --panel-2: #0b1220;       /* darker panel */
  --text: #e5e7eb;          /* gray-200 */
  --muted: #9ca3af;         /* gray-400 */
  --brand: #60a5fa;         /* blue-400 */
  --brand-2: #34d399;       /* emerald-400 */
  --accent: #f59e0b;        /* amber-500 */
  --shadow: 0 10px 20px rgba(0,0,0,.25), 0 6px 6px rgba(0,0,0,.18);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --maxw: 1200px;
}

@media (prefers-color-scheme: light) {
  :root {
	--bg: #ffffff;
	--panel: #ffffff;
	--panel-2: #f8fafc;     /* slate-50 */
	--text: #0f172a;        /* slate-900 */
	--muted: #475569;       /* slate-600 */
	--brand: #2563eb;       /* blue-600 */
	--brand-2: #059669;     /* green-600 */
	--accent: #d97706;      /* amber-600 */
  }
  header.site-header { box-shadow: 0 1px 0 rgba(15,23,42,.08); }
}

/* =====================
   Base / Utilities
   ===================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
/*  background: radial-gradient(1200px 600px at 20% -10%, rgba(96,165,250,.12), transparent 60%),
			  radial-gradient(900px 500px at 90% 10%, rgba(52,211,153,.10), transparent 60%),*/
			  var(--bg);
  line-height: 1.6;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.button {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--brand);
  color: white; padding: .85rem 1.1rem; border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow); border: 0; cursor: pointer;
  transition: transform .08s ease, filter .2s ease;
}
.button:hover { filter: brightness(1.05) saturate(1.05); }
.button:active { transform: translateY(1px); }

.tag { display:inline-block; padding:.25rem .6rem; border-radius:999px; font-size:.8rem; background: rgba(96,165,250,.18); color: var(--text); border: 1px solid rgba(96,165,250,.35); }

/* =====================
   Header / Nav
   ===================== */
header.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11,18,32,.75); backdrop-filter: saturate(140%) blur(10px); }
.nav-wrap { display:flex; align-items:center; justify-content: space-between; padding: .9rem 0; }

.brand { display:flex; align-items:center; gap:.75rem; font-weight: 800; font-size: 1.1rem; letter-spacing: .2px; color:#fff;}
.brand-logo { width: 36px; height: 36px; display:grid; place-items:center; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow); }

nav.primary-nav { display:none; }
.nav-links { display:flex; gap: 1rem; align-items:center; }
.nav-links a { padding: .6rem .8rem; border-radius: 10px; color: #fff; }
.nav-links a:hover { background: rgba(148,163,184,.12); }

.search { position: relative; flex: 1 1 auto; max-width: 420px; }
.search input {
  width: 100%; padding: .7rem 2.4rem .7rem .9rem; border-radius: 999px; border:1px solid rgba(148,163,184,.25);
  background: var(--panel-2); color: var(--text); outline: none;
}
.search svg { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); opacity: .7; }

.hamburger { background: transparent; border: 1px solid #fff; border-radius: 12px; padding: .5rem .6rem; color: #fff; display:inline-flex; gap:.5rem; align-items:center; }

/* Mobile menu */
.mobile-menu { display:none; padding: .75rem 0 1rem; border-top: 1px solid rgba(148,163,184,.15);color:#fff; }
.mobile-menu a { display:block; padding:.7rem; border-radius: 10px; }
.mobile-menu a:hover { background: rgba(148,163,184,.12); }

/* =====================
   Hero
   ===================== */
.hero { position: relative; padding: 3.2rem 0 2.4rem; }
.hero-grid { display:grid; gap: 1.6rem; align-items:center; grid-template-columns: repeat(1, minmax(0,1fr));}
.hero h1 { font-size: clamp(1.8rem, 2.6vw + 1rem, 3rem); line-height: 1.15; margin: 0 0 .8rem; letter-spacing: .2px; }
.emphasise {color:var(--brand);}
.hero p { color: var(--muted); margin: 0 0 1.2rem; }
.hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  border: 1px solid rgba(148,163,184,.2);
  border-radius: var(--radius-xl);
  padding: 1.2rem; box-shadow: var(--shadow);
}
.heroicon{
	float: right;
    height: 100px;
    width: 100px;
}

.pill-row { display:flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }

/* =====================
   Sections
   ===================== */
section { padding: 1.4rem 0 0; }
.section-head { display:flex; align-items:center; justify-content: space-between; gap: 1rem; margin: 1.2rem 0 .8rem; }
.section-head h2 { margin: 0; font-size: clamp(1.2rem, 1.1vw + 1rem, 1.6rem); }
.section-head p { margin: 0; color: var(--muted); }

/* Cards grid */
.grid { display:grid; gap: 1rem; border-radius:var(--radius-lg);}
.grid.cards { grid-template-columns: repeat(1, minmax(0,1fr)); }
@media (min-width: 640px) { .grid.cards{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 960px) { .grid.cards{ grid-template-columns: repeat(3, minmax(0,1fr)); } .hero-grid {grid-template-columns: 1.1fr 1fr;} }

.card {
  background: var(--panel-2); border: 1px solid rgba(148,163,184,.2);
  border-radius: var(--radius-lg); padding: 1rem; position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(96,165,250,.45); }
.card .icon { width: 42px; height: 42px; border-radius: 12px; display:grid; place-items:center; background: rgba(96,165,250,.18); border:1px solid rgba(96,165,250,.35); margin-bottom:.6rem; }
.card h3 { margin: .1rem 0 .25rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }
.card .cta { position:absolute; inset:0; }

/* Featured strip */
.featured {
  display:grid; gap: 1rem; grid-template-columns: 1fr; margin-top: .6rem;
}
@media (min-width: 960px) { .featured{ grid-template-columns: 2fr 1fr; } }
.feature-card { background: linear-gradient(180deg, rgba(99,102,241,.12), rgba(2,6,23,0)); border: 1px solid rgba(99,102,241,.35); border-radius: var(--radius-xl); padding: 1rem; box-shadow: var(--shadow); }

/* Fifty fifty */
.fiftyfifty {
  display:grid; gap: 1rem; grid-template-columns: 1fr;
}
.thirds {
  display:grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 800px) { .fiftyfifty{ grid-template-columns: 1fr 1fr; } .thirds{ grid-template-columns: 1fr 1fr 1fr; } }

/* Footer */
footer { margin-top: 2.4rem; border-top: 1px solid rgba(148,163,184,.15); background: rgba(2,6,23,.3); }
.footer-grid { display:grid; gap: 1rem; grid-template-columns: 1fr; padding: 1.2rem 0; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-title { font-weight: 700; margin-bottom: .4rem; }
.footer-links a { color: var(--muted); display:block; padding: .25rem 0; }
.copyright { color: var(--muted); font-size: .9rem; padding: .9rem 0 1.6rem; }

.theory, .theory-title {
	text-align:left;
}

.theory-list {
	padding-left:20px;
}

.theory-list li {
	text-align:left;
	list-style-type: circle;
	padding-bottom:10px;
}


/*
*, html {
	margin:0;
	padding:0;
	font-family: calibri;
	color:#4d4d4d;
	font-size:12pt;
}

body {
	background-image:  repeating-linear-gradient(#fff, #d3dded);
	background-repeat: repeat;
	background-attachment:scroll;
}

#headernav {
	width:100%;
}
*/
#centrewrap {
	position: relative;
	height: auto !important;
	min-height: -moz-calc(100% - 120px);
	min-height: -webkit-calc(100% - 120px);
	min-height: -o-calc(100% - 120px);
	min-height: calc(100% - 120px);
	width:100%;
}

#maincontent {
	width:100%;
}	

#footer {
	width:calc(100% - 20px);
	height:30px;
	padding:10px;
	background-color:#464646;
}

#footer span {
	color:#fff;
	display:block;
	margin-top:10px;
}


.contentpadding{
	padding:15px;
}

img {
	max-width: 100%;
	height: auto;
	width: auto\9; 
}

.topictitle {
	color:red;
}

.webtitle {
	font-size:36pt;
	display:inline-block;
	font-weight: 600;
}

.bigselector {
	background-image: linear-gradient(#60b0f4, #4d8bbf);
	text-align: center;
	vertical-align: middle;
	font-weight: 700;
	color: #fff;
	border-radius: 30px;
}

.bigselector:hover{
	box-shadow: inset 0 0 100px 100px rgba(255, 255, 255, 0.3);
	cursor: pointer;
}

.selectordetails p{
	font-size:12pt;
	text-align:left;
	padding:0 0 10px 100px;
	color:#fff;
}

.selectcontainer {
	max-width:930px;
	margin:0 auto;
}

.selectcontainer a{
	text-decoration:none;
}
h4 {
  text-align:center;
  color:#042938;
  }

#infobox, #treeinfobox {
	max-width: 500px;
	padding:5px;
}

#controls{
	width: 500px;
	text-align:right;
}
#notification, .notification{
	/*margin:20px;*/
	margin-top:20px;
	min-height: 20px;
	padding:5px;
	font-size:16px;
	text-transform:uppercase;
	/*text-align:center;*/
}

#treeinfobox {
	background: #bdf2ea;
}

#infobox {
	background: #ffbaf8;
	text-align:center;
	min-height:600px;
}

#stackinfo {
	width:60%;
	float:right;
	text-align:left;
}

#output {
	width:40%;
	float:left;
	text-align:center;
}

.simpleButton {
	border:none ;
	background:#fffd73;
	color:#80826d;
	font-size:16px;
	padding: 10px;
	width:100px;
	text-align: center;
	display:inline-block;
	text-decoration:none;
	margin-bottom: 10px;
}

/*
.button {
	background:#042938;;
	color :#fff;
	text-transform:uppercase;
	display:inline-block;
	text-decoration:none;
}
*/
input[type="text"]{
	padding: 10px 10px;
	
}

.err{
	background: #f09090;
	color:#fff;
}

.alert{
	background:#aefca2;
	color:#80826d;	
}


.algorithm {
	margin: 10px 0px;
	background:#fff;
	padding:5px;
}

.algorithm p {
	font-size:14pt;
	margin: 10px 0px 20px;
	font-weight:bold;
}

.box, .sbox{
	box-sizing: content-box;
	width: 30px;
	padding:5px;
	background-color: #000;
	display:inline-block;
	text-align:center;
	margin: 0 5px;
	font-size: 18px;
	color: white;
	position: relative;
	transition: transform 0.5s ease, opacity 0.5s ease;
}

.exampoints{
	font-size:12pt;
	margin: 10px;
}

.exampoints li {
	list-style-type: square;
	padding: 5px;
	margin-left: 10px;
}

.codeline{
	font-size:12pt;
	display:block;
	padding:3px;
	max-width:400px;
	font-family;Courier New
}

.codetab {
	margin-left:30px;
}

.codetab2 {
	margin-left:60px;
}

.codetab3 {
	margin-left:90px;
}

.highlightCode{
	background:yellow;
}

.highlight {
	background:white;
}


:root {
  --select-border: #777;
  --select-focus: blue;
  --select-arrow: var(--select-border);
}

.custom-select select{
	display: grid;
	place-items: center;
}

select {
  // A reset of styles, including removing the default dropdown arrow
  appearance: none;
  border: none;
  padding: 0 1em 0 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: inherit;
  line-height: inherit;
  text-align:center;

  // Stack above custom arrow
  z-index: 1;

  // Remove dropdown arrow in IE10 & IE11
  // @link https://www.filamentgroup.com/lab/select-css.html
  &::-ms-expand {
	display: none;
  }

  // Remove focus outline, will add on alternate element
  outline: none;
}

.select {
  display: grid;
  grid-template-areas: "select";
  align-items: center;
  position: relative;

  select,
  &::after {
	grid-area: select;
  }

  min-width: 15ch;
  max-width: 30ch;

  border: 1px solid var(--select-border);
  border-radius: 0.25em;
  padding: 0.25em 0.5em;

  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1.1;

  // Optional styles
  // remove for transparency
  background-color: #fff;
  background-image: linear-gradient(to top, #f9f9f9, #fff 33%);

  // Custom arrow
  &:not(.select--multiple)::after {
	content: "";
	justify-self: end;
	width: 0.8em;
	height: 0.5em;
	background-color: var(--select-arrow);
	clip-path: polygon(100% 0%, 0 0%, 50% 100%);
  }
  
  display:inline-block;
  margin-right:20px;
}

// Interim solution until :focus-within has better support
select:focus + .focus {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border: 2px solid var(--select-focus);
  border-radius: inherit;
}

.formfield{
	display: grid;
	grid-template-columns: 2em auto;
	margin-bottom:10px;
}

#quizform, #quizcontent, #question {
	max-width: 600px;
	margin:0 auto;
}

#quizform {
	margin-top:20px;
	padding-bottom:20px;
}

#gamestats {
	max-width:600px;
	display:block;
	margin-top:20px;
}

#gamestats label {
	display: grid;
	grid-template-columns: auto 90px;
	margin-bottom:5px;
}

#quizoptions {
	width:100%;
	height:30px;
}

#errorBlock{
	color:red;
	height:30px;
	float:left;
	width:100%;
}

#qcontrolpanel {
	margin-top:20px;
	min-height:40px;
}
#qcontrolpanel input{
	width:100px; 
	margin-right:10px;
}
			
.white-popup {
  position: relative;
  background: #FFF;
  padding: 20px;
  width: auto;
  max-width: 500px;
  margin: 20px auto;
}

#noQuizQns{
	padding: 10px 20px;
	margin-left: 20px;
}

table, td, th {
	border:1px solid black;
}

th{
	font-weight:bold;
}

td, th {
	padding:3px;
	text-align:center;
	font-size-adjust: 0.5;
}	
/*
table {
	border-collapse:collapse;
	margin:20px;
}
*/
#lightcontent table{
	margin:5px;
}

#lightcontent table td, #lightcontent table th {
	width:38px;
}

table.noborder, .noborder tr, .noborder td, .noborder th {
	border:none;
}

.binaryinputs {
	font-size:10pt;
	color:gray;
	border-collapse:collapse;
	text-align:center;
	margin:10px 0px;
	min-width:380px;
	max-width:calc(100% - 20px);
}

.binaryinputs td{
	border: 1px solid #d6d6d6;
	width:40px;
}

.binaryinputs input[type="text"] {
	width:40px;
	border:0;
	background:#E5ECFF;
}

input#quizanswer[type="text"]:disabled {
	border:0;
	background:#E5ECFF;
	font-size:18px;
}

#lightbox {
	position:fixed; 
	top:0; 
	left:0; 
	width:100%; 
	height:100%; 
	background: rgba(0,0,0,.7); 
	text-align:center;
	overflow-y:auto;
	z-index: 20;
}

#lightbox .smallcontainer {
	box-shadow:0 0 25px #111;
	-webkit-box-shadow:0 0 25px #111;
	-moz-box-shadow:0 0 25px #111;
	margin:0 auto;
}

#lightcontent {
	background:#fff;
	margin-top:50px;
	padding:10px;
}

@container #shortestPathtable {
	padding:20px;
	font-size: 1em;
}

.fiftyfifty{
	float:left;
	padding: 0px 10px;
}
	
#shortestPathtable table {
	width:100%;
	max-width:600px;
	text-align:center;
	margin:10px auto;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

#graph-container .sigma-node {
  width: 30px;
  height: 30px;
  background-color: #ff5733;
  border: 2px solid #e74c3c;
  border-radius: 50%;
  color: #ffffff;
  font-size: 14px;
}

.number_row{
	display:block;
	width:100%;
	text-align:center;
}

.sbox {
	display:inline-block;
	width:20px;
	height:20px;
	padding: 2px;
	width: 20px;
	min-width: 0;
	height:auto;
	margin: 0px 3px;
}

.highlightnbox{
	background:red;
}
/*
.container {
	display:block;
}
*/
.ngroup {
	display:inline-block;
	padding: 4px;
	margin: 3px 3px;
	background:#d4d4d4;
}

#add_bar{
	margin:10px auto;
	display:block;
	padding:5px;
	text-align:center;
	max-width:600px;
}


@media only screen and (min-width: 300px) {
    
	.webtitle{
		font-size:24px;
	}
	
	.bigselector {
		padding: 60px 0px 10px 0px;
		margin-bottom:20px;
		font-size: 90px;
	}
	/*
	h1{
		font-size:20px;
		margin-bottom:5px;
	}
	
	body{font-size:1.5em;}
	
	.simpleButton/*, .button*/ {
		width:100px;
	}
	/*
	.button {
		font-size:12px;
	}
	*/
	#newnode {
		width:90%;
		margin-bottom:10px;
	}
	
	#infobox, #treeinfobox, #controls, #infobox,#stackinfo,#output, .lpanel, .rpanel {
		width:100%;
	}
/*
	#graph-container {
		position:absolute;
		width:300;
		min-height:280;
	}

	#graph-wrap {
		position: relative;
		width:300;
		min-height:320;
	}
*/
	
	#notification, .notification {
		/*
		width:calc(100% - 40px);
		margin:10px;
		text-align:center;*/
	}
}


@media only screen and (max-width: 550px) {
	.navbuttons {
		width:100%;
		display:block;
		text-align: right;
	}
	
	.didyouknow {
		display:none;
	}
}


#graph-wrap {
		/*margin-top:20px;*/
		position: relative;
		width:100%;
		min-height: 360px;
	}


#graph-container {
		position: relative;
		right: revert;
		margin:0 auto;
		min-height: inherit;
		width:100%;
}

@media only screen and (min-width: 1000px) {
	#graph-container {
		width: 600px;
		min-height: 450px;
	}			
		
	#graph-wrap{
		width: 600px;
		min-height: 450px;
	}
}


@media only screen and (min-width: 800px) {
	
	.rpanel {
		clear:both;
	}
	
	.bigselector {
		width: 400px;
		padding: 140px 10px 50px 10px;
		font-size: 110px;
		margin-right: 30px;
		float: right;
	
	}	
	
	#newnode {
		width:90%;
	}
	
	#add_bar{
		/*
		margin:10px auto;
		display:inline-block;*/
		padding:5px;
		text-align:center;
		/*
		width:450px;
		float:left;*/
	}
}

/*
.container {
  padding: 16px;
}
*/
.pageContainer {
	width: 300px;
	margin:10px auto;
	border-radius: 5px;
	border: 1px solid #333;
	background:#fff;
}

.pageContainer input[type=text], .pageContainer input[type=password] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.lbutton {
  background-color: #60b0f4;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
}

.lbutton:hover {
  opacity: 0.8;
}

.containerbottom {
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	background-color:#afb7ce;
	padding:16px;
	min-height:40px;
	color:#444;
}

span.psw a, span.psw a:visited {
	color: #444;
}

span.psw {
	font-size:10pt;
	float: right;
	padding-top: 16px;
}

.imgcontainer {
  text-align: center;
  margin: 24px 0 12px 0;
  position: relative;
}

img.avatar {
  width: 40%;
}

.navbuttons {
	float:right;
	margin:0px 16px;
}

.navbuttons a{
	margin:5px;
	display:inline-block;
	text-decoration:none;
}
