/* Copyright (c) 2016, 2025 Robert Kooima

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. */

/* Top-level structure */

body {
	height: 100%;
	margin: 0;
	font-family: "Noto Sans", sans-serif;
}

main {
	display: flex;
	flex-direction: row;
	height: 100vh;
	overflow: hidden;
}

#left {
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

#right {
	flex: 1;
	overflow-y: auto;
}

#toolbar {
	display: flex;
	flex-direction: row;
}

p.note {
	text-align: center;
	color: #CCC;
}

/* Controls */

span.control {
	display: inline-block;
	margin: 2px;
	border: 1px solid #ABA;
	border-radius: 2px;
	background: #DED;
	width: 1.5em;
	line-height: 1.5em;
	text-align: center;
	font-weight: bold;
	vertical-align: middle;
	cursor: pointer;
}

span.control:hover {
	background: #DFD;
}

/* Content list items */

div.item {
	display: flex;
	margin: 1em 1em;
	padding-bottom: 0.5em;
	padding-right: 0.25em;
	border-radius: 8px;
	flex-direction: row;
}

div.unselected {
	background-color: #FFF;
}

div.selected {
	background-color: #FFD;
}

/* Menu table */

table.menu {
	border-collapse: collapse;
	margin: 0.5em;
	padding: 0.5em;
}

table.menu th {
	font-weight: normal;
	height: 2em;
}

table.menu td {
	padding: 0.5em 0.25em;
	min-width: 2em;
	text-align: left;
}

table.menu input {
	vertical-align: middle;
}

table.menu img {
	vertical-align: middle;
}

/* Tone selection menu */

table.piano td:nth-child(1) {
	border-top-left-radius: 8px;
	border-bottom-left-radius: 8px;
}

table.piano tr:nth-child(2),
table.piano tr:nth-child(4),
table.piano tr:nth-child(6),
table.piano tr:nth-child(7),
table.piano tr:nth-child(9),
table.piano tr:nth-child(11),
table.piano tr:nth-child(13) {
	background-color: #EEE;
}

table.piano tr:nth-child(3),
table.piano tr:nth-child(5),
table.piano tr:nth-child(8),
table.piano tr:nth-child(10),
table.piano tr:nth-child(12) {
	background-color: #CCC;
}

label {
	display: flex;
	align-items: center;
}

/* Fretboard table */

table.fretboard {
	border-collapse: collapse;
	flex-grow: 1;
}

table.fretboard th {
	font-weight: normal;
	color:#777;
	width: 0.5%;
}

table.fretboard td {
	border-right: 4px solid #777;
	background-color: white;
	background-repeat: repeat-x;
	background-position: center;
}

table.fretboard td.s0 {
	border-top: 2px solid #777;
	background-image: url("img/s0.svg");
}

table.fretboard td.s1 {
	background-image: url("img/s1.svg");
}

table.fretboard td.s2 {
	background-image: url("img/s2.svg");
}

table.fretboard td.s3 {
	background-image: url("img/s3.svg");
}

table.fretboard td.s4 {
	background-image: url("img/s4.svg");
}

table.fretboard td.s5 {
	background-image: url("img/s5.svg");
	border-bottom: 2px solid #777;
}

table.fretboard td.f00 {
	width: 0.25%;
	background-color: #DDD;
	border-left: 2px solid #777;
	border-right: 0;
}

table.fretboard td.f01 {
	width: 4.7193%
}

table.fretboard td.f02 {
	width: 4.4544%
}

table.fretboard td.f03 {
	width: 4.2044%
}

table.fretboard td.f04 {
	width: 3.9685%
}

table.fretboard td.f05 {
	width: 3.7457%
}

table.fretboard td.f06 {
	width: 3.5355%
}

table.fretboard td.f07 {
	width: 3.3370%
}

table.fretboard td.f08 {
	width: 3.1498%
}

table.fretboard td.f09 {
	width: 2.9730%
}

table.fretboard td.f10 {
	width: 2.8061%
}

table.fretboard td.f11 {
	width: 2.6486%
}

table.fretboard td.f12 {
	width: 2.5000%
}

table.fretboard td.f13 {
	width: 2.3596%
}

table.fretboard td.f14 {
	width: 2.2272%
}

table.fretboard td.f15 {
	width: 2.1022%
}

/* Fretboard positions */

table.fretboard div {
	float: right;
	min-width: 20pt;
	min-height: 20pt;
	text-align: center;
}

/* Selected fretboard positions */

table.fretboard div.t1 {
	background-image: url("img/t1.svg");
}

table.fretboard div.t2f {
	background-image: url("img/t2f.svg");
}

table.fretboard div.t2 {
	background-image: url("img/t2.svg");
}

table.fretboard div.t3f {
	background-image: url("img/t3f.svg");
}

table.fretboard div.t3 {
	background-image: url("img/t3.svg");
}

table.fretboard div.t4 {
	background-image: url("img/t4.svg");
}

table.fretboard div.t5f {
	background-image: url("img/t5f.svg");
}

table.fretboard div.t5 {
	background-image: url("img/t5.svg");
}

table.fretboard div.t5s {
	background-image: url("img/t5s.svg");
}

table.fretboard div.t6f {
	background-image: url("img/t6f.svg");
}

table.fretboard div.t6 {
	background-image: url("img/t6.svg");
}

table.fretboard div.t7ff {
	background-image: url("img/t7ff.svg");
}

table.fretboard div.t7f {
	background-image: url("img/t7f.svg");
}

table.fretboard div.t7 {
	background-image: url("img/t7.svg");
}

table.fretboard div.t9f {
	background-image: url("img/t9f.svg");
}

table.fretboard div.t9 {
	background-image: url("img/t9.svg");
}

table.fretboard div.t9s {
	background-image: url("img/t9s.svg");
}

table.fretboard div.t11f {
	background-image: url("img/t11f.svg");
}

table.fretboard div.t11 {
	background-image: url("img/t11.svg");
}

table.fretboard div.t11s {
	background-image: url("img/t11s.svg");
}

table.fretboard div.t13f {
	background-image: url("img/t13f.svg");
}

table.fretboard div.t13 {
	background-image: url("img/t13.svg");
}

/* Selected and marked fretboard positions */

table.fretboard div.marked.t1 {
	background-image: url("img/mark.svg"), url("img/t1.svg");
}

table.fretboard div.marked.t2f {
	background-image: url("img/mark.svg"), url("img/t2f.svg");
}

table.fretboard div.marked.t2 {
	background-image: url("img/mark.svg"), url("img/t2.svg");
}

table.fretboard div.marked.t3f {
	background-image: url("img/mark.svg"), url("img/t3f.svg");
}

table.fretboard div.marked.t3 {
	background-image: url("img/mark.svg"), url("img/t3.svg");
}

table.fretboard div.marked.t4 {
	background-image: url("img/mark.svg"), url("img/t4.svg");
}

table.fretboard div.marked.t5f {
	background-image: url("img/mark.svg"), url("img/t5f.svg");
}

table.fretboard div.marked.t5 {
	background-image: url("img/mark.svg"), url("img/t5.svg");
}

table.fretboard div.marked.t5s {
	background-image: url("img/mark.svg"), url("img/t5s.svg");
}

table.fretboard div.marked.t6f {
	background-image: url("img/mark.svg"), url("img/t6f.svg");
}

table.fretboard div.marked.t6 {
	background-image: url("img/mark.svg"), url("img/t6.svg");
}

table.fretboard div.marked.t7ff {
	background-image: url("img/mark.svg"), url("img/t7ff.svg");
}

table.fretboard div.marked.t7f {
	background-image: url("img/mark.svg"), url("img/t7f.svg");
}

table.fretboard div.marked.t7 {
	background-image: url("img/mark.svg"), url("img/t7.svg");
}

table.fretboard div.marked.t9f {
	background-image: url("img/mark.svg"), url("img/t9f.svg");
}

table.fretboard div.marked.t9 {
	background-image: url("img/mark.svg"), url("img/t9.svg");
}

table.fretboard div.marked.t9s {
	background-image: url("img/mark.svg"), url("img/t9s.svg");
}

table.fretboard div.marked.t11f {
	background-image: url("img/mark.svg"), url("img/t11f.svg");
}

table.fretboard div.marked.t11 {
	background-image: url("img/mark.svg"), url("img/t11.svg");
}

table.fretboard div.marked.t11s {
	background-image: url("img/mark.svg"), url("img/t11s.svg");
}

table.fretboard div.marked.t13f {
	background-image: url("img/mark.svg"), url("img/t13f.svg");
}

table.fretboard div.marked.t13 {
	background-image: url("img/mark.svg"), url("img/t13.svg");
}

/* Remove the GUI elements for printing. */

@media print {
	#toolbar {
		display: none;
	}

	p.note {
		display: none;
	}

	span.control {
		display: none;
	}

	div.selected {
		border: none;
		background: inherit;
	}
}