/* Basics */

body {
	background-color: white;
	color: black;
	margin-top: 0;
	margin-bottom: 4ex;
}

body.narrow {
	margin-left: auto;
	margin-right: auto;
	padding-left: 1em;
	padding-right: 1em;
	max-width: 800px;
}

body.wide {
	margin-left: 1em;
	margin-right: 1em;
}

.error {
	color: red;
	font-weight: bold;
}

a:link, a:visited {
	text-decoration: none;
	color: #0000aa;
}

a:link:hover, a:visited:hover {
	text-decoration: underline;
}

blockquote {
	border-left: solid medium #555;
	margin-left: 0;
	padding-left: 2em;
	color: #333;
}

@media only screen and (max-width: 500px) {
	ul {
		padding-left: 2em;
	}
}

/* Heading */

#owl {
	width: 5rem;
	float: left;
	margin-right: 2rem;
}

h1 {
	padding-top: 0.5ex;
	margin-bottom: 1ex;
	font-size: 4ex;
}

#headmenu {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-right: 1rem;
	margin-bottom: 1ex;
}

#headuser {
	font-size: larger;
	flex-grow: 1;
}

#headbutt {
	display: flex;
	gap: 1rem;
}

.end {
	align-self: flex-end;
}

#clean {
	clear: both;
	border-bottom: 1px solid black;
	margin-bottom: 3ex;
}

header.flavor-test {
	background-color: #33cc33;
}

header.flavor-devel {
	background-color: #cc77cc;
}

/* Footer */

footer {
	margin-top: 4ex;
	border-top: 1px solid black;
	padding-top: 0.5ex;
}

/* Formatting of points */

.pts {
	text-align: right;
}

.standalone {
	color: #888888;
}

.pts-binary {
	text-align: center;
}

.pauto {
	color: #aaaaaa;
}

/* Flashing messages */

.flash {
	border-radius: 4px;
	margin-top: 1ex;
	margin-bottom: 1ex;
	padding-top: 0.5ex;
	padding-bottom: 0.5ex;
	padding-left: 0.5em;
	padding-right: 0.5em;
}

.flash-error {
	background-color: #f2dede;
	color: #a94442;
	border: 1px solid #a94442;
}

.flash-info {
	background-color: #dff0d8;
	color: #1c561d;
	border: 1px solid #1c561d;
}

/* Course page */

#totalpoints {
	font-style: italic;
}

#totalthresh {
	font-style: italic;
}

/* Posts at topic page */

.post {
	border: 1px solid #6666ff;
	border-radius: 4px;
	margin-top: 1ex;
	margin-bottom: 1ex;
	padding-top: 0.1ex;
	padding-bottom: 0.1ex;
	padding-left: 0.5em;
	padding-right: 0.5em;
}

.pnew {
	border: 2px solid green;
}

.pall {
	background-color: #ccffcc;
}

.pteacher {
	background-color: #ccccff;
}

.phdr {
	font-style: italic;
}

.phpast {
	color: #cc0000;
}

.points {
	font-weight: bold;
}

#previewbox {
	display: none;
}

#preview {
	border: 1px solid green;
	border-radius: 4px;
	margin-top: 1ex;
	margin-bottom: 1ex;
	padding-top: 0.1ex;
	padding-bottom: 0.1ex;
	padding-left: 0.5em;
	padding-right: 0.5em;
}

.errorbox {
	border: 1px solid red;
	border-radius: 4px;
	margin-top: 1ex;
	margin-bottom: 1ex;
	padding-top: 0.1ex;
	padding-bottom: 0.1ex;
	padding-left: 0.5em;
	padding-right: 0.5em;
}

.errorbox code {
	display: block;
	margin-block-start: 1em;
	margin-block-end: 1em;
}

#syntaxhelp {
	font-size: small;
	margin-left: 1em;
}

.pdfview {
	width: 100%;
	height: 90vh;
}

.pbody .hljs, #preview .hljs {
	/* Override background color in hljs styles */
	background-color: rgba(248,248,248,0.5);
	border: 1px solid rgba(224,224,224,0.5);
	border-radius: 0.5em;
}

.katex-error {
	background-color: #ff6666;
}

/* List of topics at course (admin) page */

.topics {
	border-collapse: collapse;
	border: 1px solid #6666ff;
}

.topics TR TD {
	border: 1px solid #6666ff;
	padding: 0.3ex 1ex;
}

.topics TR TH {
	border: 1px solid #6666ff;
	padding: 0.3ex 1ex;
}

.tnew {
	background-color: #ccffcc;
}

.told {
}

.thidden {
	background-color: #aaaaaa;
}

/* Teacher's view of results */

#results {
	border-collapse: collapse;
	border: 1px solid #6666ff;
}

#results TR TH,
#results TR TD {
	border: 1px solid #6666ff;
	padding: 0.3ex;
}

#results TR:hover TD:first-child {
	background-color: #dddddd;
}

.snew {
	background-color: #ccffcc;
}

.sother {
	background-color: #ccccff;
}

.sold {
}

.snull {
	background-color: #dddddd;
}

.sautor {
	color: #aaaaaa;
}

.sautof {
	color: red;
}

.passed { background-color: hsl(25 85% 65%); }

/* Points (relative): yellow-orange scheme */
.hipts .p0 { background-color: hsl(58 85% 65%); }
.hipts .p1 { background-color: hsl(55 85% 65%); }
.hipts .p2 { background-color: hsl(52 85% 65%); }
.hipts .p3 { background-color: hsl(49 85% 65%); }
.hipts .p4 { background-color: hsl(46 85% 65%); }
.hipts .p5 { background-color: hsl(43 85% 65%); }
.hipts .p6 { background-color: hsl(40 85% 65%); }
.hipts .p7 { background-color: hsl(37 85% 65%); }
.hipts .p8 { background-color: hsl(34 85% 65%); }
.hipts .p9 { background-color: hsl(30 85% 65%); }
.hipts .p10 { background-color: hsl(25 85% 65%); }
.hipts .p11 { background-color: hsl(15 85% 65%); }

/* Blue schema: unused
.p0 { background-color: hsl(220 90% 70%); }
.p1 { background-color: hsl(225 90% 70%); }
.p2 { background-color: hsl(230 90% 70%); }
.p3 { background-color: hsl(235 90% 70%); }
.p4 { background-color: hsl(240 90% 70%); }
.p5 { background-color: hsl(245 90% 70%); }
.p6 { background-color: hsl(250 90% 70%); }
.p7 { background-color: hsl(255 90% 70%); }
.p8 { background-color: hsl(260 90% 70%); }
*/

/* Post age: green scheme */
.hiage .a0 { background-color: hsl(120 80% 80%); }
.hiage .a1 { background-color: hsl(120 80% 75%); }
.hiage .a2 { background-color: hsl(120 80% 70%); }
.hiage .a3 { background-color: hsl(120 80% 65%); }
.hiage .a4 { background-color: hsl(120 80% 60%); }
.hiage .a5 { background-color: hsl(120 80% 55%); }
.hiage .a6 { background-color: hsl(120 80% 50%); }
.hiage .a7 { background-color: hsl(120 80% 45%); }
.hiage .a8 { background-color: hsl(120 80% 41%); }
.hiage .a9 { background-color: hsl(120 80% 37%); }

.talive {
	background-color: #ccffcc;
}

.tdead {
	background-color: #ffcccc;
}

.tprivate {
	background-color: #aaaaaa;
}

.taward {
	text-align: center;
}

/* Used only in legacy mode */
.tcrea {
	text-align: center;
}

.tcrea a {
	visibility: hidden;
}

.hicrea .tcrea a {
	visibility: visible;
}

#results TH.tbeforehdr,
#results TD.tbeforehdr {
	border-right: 2px solid #6666ff;
}

#results TH.tnextgroup,
#results TD.tnextgroup {
	border-left: 2px solid #6666ff;
}

.tstandalone-max {
	color: #888888;
}

#results A:visited, #results A:link {
	color: inherit;
}

#color_scale td {
	width: 2em;
	text-align: center;
}

/* Graders */
#results .grading th {
	text-align: center;
}
#results .grading td {
	text-align: center;
}
#results td.grme {
	background-color: #b162ee;
	font-size: smaller;
}
#results td.grother {
	background-color: #62beee;
	font-size: smaller;
}
#results td.grstud {
	background-color: #62ee96;
	font-size: smaller;
}

/* Settings */

.settings {
	border-collapse: collapse;
}

.settings TR TD {
	border: 1px solid #6666ff;
	padding: 0.3ex 1ex;
}

.settings TR TD:first-child {
	padding-right: 1.5rem;
	white-space: nowrap;
}

.explain {
	font-size: smaller;
	padding-left: 1.5rem;
}

/* Generic tables */

.data {
	border-collapse: collapse;
}

.data TD, .data TH {
	border: 1px solid #6666ff;
	padding: 0.3ex 1ex;
}

/* Main page */

.new-threads {
	color: #00cc00;
}

.news {
	border-collapse: collapse;
}

.news TR TD {
	border: 1px solid #6666ff;
	padding: 0.5ex;
	padding-left: 1ex;
	padding-right: 1ex;
}

.news TD:first-child {
	font-weight: bold;
	white-space: nowrap;
}

/* Buttons */

.buttons {
	display: flex;
	flex-wrap: wrap;
	margin-top: 3ex;
	margin-bottom: 3ex;
	gap: 0.5ex;
}

.buttons a:link:hover, .buttons a:visited:hover,
.inline-buttons a:link:hover, .buttons a:visited:hover,
#headmenu a:link:hover, #headmenu a:visited:hover {
	text-decoration: none;
}

.inline-buttons .button,
.inline-buttons input {
	margin-top: 0.2ex;
	margin-bottom: 0.2ex;
}

.button {
	color: #0000aa;
	border: 1px solid blue;
	border-radius: 4px;
	padding: 0.2ex 0.8ex;
	cursor: pointer;
}

.button:hover {
	background: #ccccff;
}

.button.active {
	background: #0000aa;
	color: white;
}

button, input[type='submit'] {
	background-color: white;
	color: #0000aa;
	border: 1px solid blue;
	border-radius: 4px;
	padding: 0.2ex 0.8ex;
	font: inherit;
	cursor: pointer;
}

button:hover, input[type='submit']:hover {
	background-color: #ccccff;
}

button.active {
	background: #0000aa;
	color: white;
}

.ok, a.ok:link, a.ok:visited, input[type='submit'].ok {
	color: #1c561d;
	border-color: #0c560d;
}

.ok:hover, input[type='submit'].ok:hover {
	background-color: #dff0d8;
}

.danger, input[type='submit'].danger {
	color: #a94442;
	border-color: #a94442;
}

.danger:hover, input[type='submit'].danger:hover {
	background-color: #f2dede;
}

input[type='submit'][disabled],
input.ok[type='submit'][disabled],
input.danger[type='submit'][disabled] {
	color: #cccccc;
	border-color: #aaaaaa;
}

input[type='submit'][disabled]:hover,
input.ok[type='submit'][disabled]:hover,
input.danger[type='submit'][disabled]:hover {
	background-color: inherit;
}

/* Choice of course to copy to */

#copy_to {
	list-style-type: none;
}

/* Tips */

.has-tip {
	text-decoration: underline dashed;
	text-underline-offset: 0.2em;
}

/* Generic spacing */

.opentop {
	margin-top: 0.5ex;
}

.pbody img {
	max-width: 100%;
	max-height: 1000px;
}

#preview img {
	max-width: 100%;
	max-height: 1000px;
}
