/* OpenWrt custom cgit theme - overrides for default cgit.css */

div#cgit {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 10pt;
	color: #333;
	background: #fff;
}

div#cgit a {
	color: #00ace2;
}

div#cgit a:hover {
	color: #002843;
}

/* Header */
div#cgit table#header td.logo {
	width: 40px;
}

div#cgit table#header td.logo a img {
	width: 40px;
	height: 40px;
}

div#cgit table#header td.main {
	font-size: 200%;
	font-weight: 300;
}

div#cgit table#header td.main a {
	color: #002843;
}

div#cgit table#header td.sub {
	color: #666;
	border-top: solid 1px #dde;
}

/* Tabs */
div#cgit table.tabs {
	border-bottom: solid 3px #002843;
}

div#cgit table.tabs td a {
	color: #666;
	border-radius: 3px 3px 0 0;
	padding: 4px 0.75em;
}

div#cgit table.tabs td a:hover {
	color: #002843;
	background-color: #e8f4fa;
	border: solid 2px #002843;
	text-decoration: none;
}

div#cgit table.tabs td a.active {
	color: #002843;
	font-weight: bold;
}

/* Path bar */
div#cgit div.path {
	background-color: #f5f8fa;
	border-bottom: solid 1px #dde;
	color: #002843;
}

/* Content area */
div#cgit div.content {
	border-bottom: solid 3px #dde;
}

/* Repo list */
div#cgit table.list tr:nth-child(even) {
	background: #f8fbfd;
}

div#cgit table.list tr:nth-child(odd) {
	background: #fff;
}

div#cgit table.list tr:hover {
	background: #e8f4fa;
}

div#cgit table.list td a {
	color: #002843;
}

div#cgit table.list td a:hover {
	color: #00ace2;
}

div#cgit table.list td.reposection {
	color: #002843;
	font-weight: bold;
	font-style: normal;
}

/* Decorations */
div#cgit a.branch-deco {
	background-color: #c8ecf8;
	border: solid 1px #00ace2;
	border-radius: 3px;
	color: #002843;
}

div#cgit a.tag-deco {
	background-color: #fff3cd;
	border: solid 1px #c99700;
	border-radius: 3px;
}

div#cgit a.tag-annotated-deco {
	background-color: #ffe0b2;
	border: solid 1px #c99700;
	border-radius: 3px;
}

div#cgit a.remote-deco {
	background-color: #e0e0ff;
	border: solid 1px #5555cc;
	border-radius: 3px;
}

/* Diff stats bar */
div#cgit table.diffstat td.graph td.add {
	background-color: #28a745;
}

div#cgit table.diffstat td.graph td.rem {
	background-color: #dc3545;
}

/* Commit subject */
div#cgit div.commit-subject {
	color: #002843;
}

/* Footer */
div#cgit div.footer {
	color: #aab;
}

div#cgit div.footer a {
	color: #aab;
}

/* Buttons */
div#cgit a.button {
	color: #00ace2;
}

div#cgit a.button:hover {
	color: #002843;
}

/* Age colors - use OpenWrt blue tones */
div#cgit span.age-mins {
	color: #00ace2;
	font-weight: bold;
}

div#cgit span.age-hours {
	color: #0090c0;
}

div#cgit span.age-days {
	color: #006890;
}

div#cgit span.age-weeks {
	color: #004060;
}

div#cgit span.age-months {
	color: #888;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
	body {
		background: #1a1a2e;
	}

	div#cgit {
		color: #ccc;
		background: #1a1a2e;
	}

	div#cgit a {
		color: #4dc9f6;
	}

	div#cgit a:hover {
		color: #9ee5ff;
	}

	/* Header */
	div#cgit table#header td.main a {
		color: #e0e0e0;
	}

	div#cgit table#header td.sub {
		color: #999;
		border-top: solid 1px #333;
	}

	/* Tabs */
	div#cgit table.tabs {
		border-bottom: solid 3px #4dc9f6;
	}

	div#cgit table.tabs td a {
		color: #999;
	}

	div#cgit table.tabs td a:hover {
		color: #e0e0e0;
		background-color: #252545;
		border-color: #4dc9f6;
	}

	div#cgit table.tabs td a.active {
		color: #e0e0e0;
	}

	/* Path bar */
	div#cgit div.path {
		background-color: #16162a;
		border-bottom: solid 1px #333;
		color: #ccc;
	}

	/* Content area */
	div#cgit div.content {
		border-bottom: solid 3px #333;
	}

	/* Repo list */
	div#cgit table.list tr:nth-child(even) {
		background: #1e1e38;
	}

	div#cgit table.list tr:nth-child(odd) {
		background: #1a1a2e;
	}

	div#cgit table.list tr:hover {
		background: #252545;
	}

	div#cgit table.list td a {
		color: #e0e0e0;
	}

	div#cgit table.list td a:hover {
		color: #4dc9f6;
	}

	div#cgit table.list td a.ls-dir {
		color: #4dc9f6;
	}

	div#cgit table.list td.reposection {
		color: #4dc9f6;
	}

	div#cgit table.list tr.logheader {
		background: #252545;
	}

	/* Decorations */
	div#cgit a.branch-deco {
		background-color: #1a3a4a;
		border-color: #4dc9f6;
		color: #ccc;
	}

	div#cgit a.tag-deco {
		background-color: #3a3520;
		border-color: #c99700;
		color: #ccc;
	}

	div#cgit a.tag-annotated-deco {
		background-color: #3a2e1a;
		border-color: #c99700;
		color: #ccc;
	}

	div#cgit a.remote-deco {
		background-color: #2a2a4a;
		border-color: #8888ff;
		color: #ccc;
	}

	/* Commit */
	div#cgit div.commit-subject {
		color: #e0e0e0;
	}

	div#cgit div.commit-msg {
		color: #bbb;
	}

	div#cgit table.commit-info {
		color: #ccc;
	}

	/* Diff */
	div#cgit table.diff td div.head {
		color: #e0e0e0;
	}

	div#cgit table.diff td div.hunk {
		color: #6688cc;
	}

	div#cgit table.diff td div.add {
		color: #5cb85c;
	}

	div#cgit table.diff td div.del {
		color: #d9534f;
	}

	div#cgit table.diffstat {
		border-color: #444;
		background-color: #1e1e38;
	}

	div#cgit table.diffstat th {
		background-color: #252545;
	}

	/* Side-by-side diff */
	div#cgit table.ssdiff td {
		border-color: #444;
	}

	div#cgit table.ssdiff td.add,
	div#cgit table.ssdiff td.add_dark {
		background: #1a3a1a;
		color: #ccc;
	}

	div#cgit table.ssdiff td.del,
	div#cgit table.ssdiff td.del_dark {
		background: #3a1a1a;
		color: #ccc;
	}

	div#cgit table.ssdiff td.changed,
	div#cgit table.ssdiff td.changed_dark {
		background: #3a3520;
		color: #ccc;
	}

	div#cgit table.ssdiff td.lineno {
		background: #252545;
		color: #888;
	}

	div#cgit table.ssdiff td.hunk {
		background: #1a2a4a;
		border-color: #444;
		color: #ccc;
	}

	/* Blob / code view */
	div#cgit div#blob {
		border-color: #444;
	}

	div#cgit table.blob td.linenumbers {
		border-right: 1px solid #444;
	}

	div#cgit table.blob td.linenumbers a {
		color: #666;
	}

	div#cgit table.blob {
		border-top-color: #444;
	}

	/* Blame */
	div#cgit table.blame div.alt:nth-child(even) {
		background: #1e1e38;
	}

	div#cgit table.blame div.alt:nth-child(odd) {
		background: #1a1a2e;
	}

	/* Notes */
	div#cgit div.notes {
		border-color: #554;
		background-color: #2a2a1a;
		color: #ccc;
	}

	/* Stats */
	div#cgit table.stats {
		border-color: #444;
	}

	div#cgit table.stats th {
		background-color: #252545;
		border-color: #444;
	}

	div#cgit table.stats td {
		border-color: #444;
	}

	/* Footer */
	div#cgit div.footer {
		color: #555;
	}

	div#cgit div.footer a {
		color: #555;
	}

	/* Diff options panel */
	div#cgit div.cgit-panel table {
		border-color: #444;
		background-color: #1e1e38;
	}

	div#cgit div.cgit-panel th {
		color: #ccc;
	}

	div#cgit div.cgit-panel td {
		color: #ccc;
	}

	div#cgit div.cgit-panel td select,
	div#cgit div.cgit-panel td input {
		background: #252545;
		color: #ccc;
		border: 1px solid #444;
	}

	div#cgit div.diffstat-header {
		color: #ccc;
	}

	div#cgit div.diffstat-summary {
		color: #888;
	}

	div#cgit table.diffstat td.add a {
		color: #5cb85c;
	}

	div#cgit table.diffstat td.del a {
		color: #d9534f;
	}

	div#cgit table.diffstat td.upd a {
		color: #4dc9f6;
	}

	/* Nohover rows */
	div#cgit table.list tr.nohover,
	div#cgit table.list tr.nohover:hover {
		background: #1a1a2e;
	}

	/* Table headers */
	div#cgit table.list th {
		color: #999;
	}

	/* Form elements */
	div#cgit table#header td.form input,
	div#cgit table#header td.form select,
	div#cgit table.tabs td.form input,
	div#cgit table.tabs td.form select {
		background: #252545;
		color: #ccc;
		border: 1px solid #444;
	}

	/* Age colors */
	div#cgit span.age-mins {
		color: #4dc9f6;
	}

	div#cgit span.age-hours {
		color: #3ab0dd;
	}

	div#cgit span.age-days {
		color: #2a90bb;
	}

	div#cgit span.age-weeks {
		color: #1a7099;
	}

	div#cgit span.age-months {
		color: #666;
	}
}
