/* ----- Dark Theme ----- */
:root,
body.dark {
  --shadow: #fff8;
  --selected-bg: #555;
  --btn-hover: #444;
  --fieldset-color: #0cf;
  --img-filter: invert(1) grayscale(1);
}

/* ----- Light Theme ----- */
@media screen and (prefers-color-scheme: light) {
  :root {
    --shadow: #0004;
    --selected-bg: #eeea;
    --btn-hover: #fff;
    --fieldset-color: #066;
    --img-filter: none;
  }
}

:root {
  --nav-height: 2.5rem;
}

/* ----- General ----- */
body {
  opacity: 0;
  transition: opacity 0.5s;
  overflow: hidden;
}

img {
  vertical-align: text-bottom;
}

nav label img {
  filter: var(--img-filter);
}

article {
  background-color: var(--alt-bg);
}

/* About & Help */
#nav1:checked ~ article,
#nav2:checked ~ article {
  background-color: var(--bg);
}

section {
  padding: 0.5em;
  height: calc(100vh - var(--nav-height));
  display: none;
  overflow: auto;
}

iframe {
  border: none;
  margin: 0;
  width: 100%;
  height: 99%;
}

label[for],
input[type="checkbox"],
summary,
.pointer {
  cursor: pointer;
}

label > input[type="checkbox"] {
  margin-right: 0.5em;
}

input[type="number"] {
  width: 4em;
}

fieldset {
  background: var(--bg);
  margin-bottom: 1em;
  border-radius: 10px;
  border: 1px solid var(--border);
}

fieldset label img {
  width: 1em;
}

legend {
  color: var(--fieldset-color);
  background: var(--bg);
  font-size: 1.1em;
  margin-bottom: 0.5em;
  padding: 0.2em 1em;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table {
  border-collapse: collapse;
  font-size: 0.9em;
  margin: 0 auto;
  width: 100%;
}

thead th {
  color: #fff;
  background: #888;
  padding: 0.5em;
}

tbody tr {
  font-size: 0.9em;
  animation: sect 0.5s ease-in-out;
}

td {
  padding: 0.2em;
  vertical-align: top;
}

.flat {
  color: inherit;
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-top: 3px solid #3be;
  border-radius: 5px;
  padding: 0.4em 1em;
  font-size: 0.9em;
  transition: 0.5s;
  text-align: center;
}

.flat:hover {
  background: var(--btn-hover);
  /* box-shadow: 0 1px 5px var(--shadow); */
}

.description {
  border-left: 2px solid #abc;
  color: var(--fieldset-color);
  font-size: 0.9em;
  font-style: italic;
  margin-left: 0.5em;
  margin-top: 0;
  padding-left: 0.3em;
}

/* ----- Navigation ----- */
input[name="nav"],
input[type="checkbox"].control {
  display: none;
}

nav {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  font-size: 0.9em;
  background: var(--bg);
  padding: 0 0.2em;
  border-bottom: 1px solid var(--border);
}

nav > label {
  padding: 0.5em;
  transition: 0.5s;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  opacity: 0.7;
  user-select: none;
}

nav > label:hover {
  background: var(--hover);
  opacity: 1;
}

nav > label img {
  width: 1.1em;
}

nav label a {
  color: inherit;
}

nav label a:hover {
  text-decoration: none;
}

#nav1:checked ~ article section:nth-of-type(1),
#nav2:checked ~ article section:nth-of-type(2),
#nav3:checked ~ article section:nth-of-type(3),
#nav4:checked ~ article section:nth-of-type(4),
#nav5:checked ~ article section:nth-of-type(5),
#nav6:checked ~ article section:nth-of-type(6),
#nav7:checked ~ article section:nth-of-type(7),
#nav8:checked ~ article section:nth-of-type(8) {
  display: block;
  animation: sect 0.5s ease-in-out;
}

#nav1:checked ~ nav label[for="nav1"],
#nav2:checked ~ nav label[for="nav2"],
#nav3:checked ~ nav label[for="nav3"],
#nav4:checked ~ nav label[for="nav4"],
#nav5:checked ~ nav label[for="nav5"],
#nav6:checked ~ nav label[for="nav6"],
#nav7:checked ~ nav label[for="nav7"],
#nav8:checked ~ nav label[for="nav8"] {
  background-color: var(--selected-bg);
  border-bottom-color: var(--highlight);
  opacity: 1;
}

@keyframes sect {
    0% { opacity: 0; }
  100% { opacity: 1; }
}
/* ----- /Navigation ----- */

/* ----- Import/Export ----- */
input[type="file"] {
  display: none;
}

label[data-i18n^="import"],
button[data-i18n^="import"] {
  border-top-color: #6a4;
}

button[data-i18n^="export"] {
  border-top-color: #d24;
}

label[data-i18n^="import"]::before,
button[data-i18n^="import"]::before {
  content: '📥';
  margin-right: 0.3em;
}

button[data-i18n^="export"]::before {
  content: '📤';
  margin-right: 0.3em;
}
/* ----- /Import/Export ----- */

/* ----- Submit Button ----- */
button[type="submit"] {
  color: #fff;
  font-weight: bold;
  padding: 0.3em 3em;
  background: #3bb3e0 linear-gradient(to bottom, #2ca0ca, #3eb8e5);
  border-radius: 5px;
  border: solid 1px #186f8f;
  position: relative;
  text-shadow: 0 -1px 1px #333;
  display: block;
  margin: 1em auto;
  box-shadow: inset 0 1px 0 #2ab7ec, 0 5px 0 0 #048, 0 10px 5px #999;
}

button[type="submit"]:active {
  top: 0.3em;
  box-shadow: inset 0 1px 0 #2ab7ec, 0 2px 0 0 #008, 0 5px 3px #999;
}

button[type="submit"]:active::before {
  top: -0.8em;
}
/* ----- /Submit Button ----- */