
:root {
  --link: #519331;
  --link-darker: #306E12;
  --dark: #292828;
  --red: #db021f;
  --radius: 5px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  font-size: 16px;
  font-family: Helvetica, Arial, sans-serif;
  height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

i { display: inline-block; margin-right: 0.5rem; line-height: 1em; }
i svg { height: 1.25em; }
i svg.enlarge_tiny { height: 1.75em; margin: -0.25em 0; }

.nicebg {
  background: black center no-repeat;
  background-image: url('./assets/bg.jpg');
  background-image: image-set(
    url('./assets/bg.avif') type('image/avif'),
    url('./assets/bg.jpg') type('image/jpeg')
  );
  background-size: cover;
}

a, a:visited {
  cursor: pointer;
  color: var(--link-darker);
  text-decoration: underline dotted;
}
a:hover {
  color: white;
  background: var(--link-darker);
}
a.button {
  display: flex;
  align-items: center;
}

.row, .columns {
  display: flex;
}
.columns {
  flex-direction: column;
}
.row > .columns {
  flex: 2 1 100px;
  margin-left: 1rem;
}
.row > .columns:first-of-type {
  margin-left: 0;
}

.center {
  align-self: center;
}

header {
  background: black;
  color: white;
  display: flex;
  justify-content: center;
}
header svg {
  fill: white;
}
header a, header a:hover, header a:visited {
  color: white;
  padding: 0.5rem 1rem;
  margin: 0.5rem 1rem;
}
header a:hover {
  background: white;
  color: black;
}
header a:hover svg {
  fill: black;
}

.hidden {
  visibility: collapse;
}

header logo {
  flex: 2 1 auto;
  height: 100px;
  margin: 30px;
  background: center no-repeat url('./logo.svg');
  background-size: contain;
}

h1 {
  font-size: 2rem;
  text-align: center;
  margin: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title_button {
  padding: 0.25rem;
  position: absolute;
  right: 1rem;
  border: none;
  color: var(--link);
  display: flex;
  align-items: center;
}
.title_button svg { fill: var(--link-darker); }
.title_button:hover svg { fill: white; }
.title_button.remove { color: var(--red); }
.title_button.remove svg { fill: var(--red); }
.title_button.remove:hover { background: var(--red); color: white; }
.title_button.remove:hover svg { fill: white; }

.error {
  color: var(--red);
}

#container {
  flex: 2 1 auto;
  justify-content: center;
}

#status {
  flex: 2 1 auto;
  padding: 1rem;
}

#login {
  margin: 2rem;
  align-self: center;
  width: 100%;
  max-width: 500px;
  background: white;
  padding: 1rem 2rem 2rem;
  border-radius: 5px;
}

.adminform {
  align-self: center;
  width: 100%;
  max-width: 700px;
  background: white;
  padding: 1rem 2rem;
  border-radius: 5px;
}

button {
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid var(--link);
  border-radius: var(--radius);
  color: black;
  font-size: 1rem;
  cursor: pointer;
}
button:hover, button:active, button.active {
  background: var(--link);
  color: white;
}
button:hover svg, button:active svg {
  fill: white;
}

button i.solo {
  margin-right: 0;
  position: relative;
  top: 2px;
}

button.exremove {
  border: 1px solid var(--red);
  margin-top: 1rem;
}
button.exremove:hover, button.exremove:active {
  background: var(--red);
  color: white;
}


@keyframes spinner-loader {
  to {transform: rotate(360deg);}
}

.loading-spinner {
  position: relative;
  height: 50px;
}

.loading-spinner:before {
  content: '';
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  margin-left: -25px;
  border-radius: 50%;
  border: 5px solid #ccc;
  border-top-color: var(--link);
  animation: spinner-loader .6s linear infinite;
}

footer {
  margin-top: 2remr;
  text-align: center;
  padding: 1rem;
  color: white;
  text-shadow: 0 0 3px #000;
}

footer a {
  color: white;
}
footer a:hover {
  text-shadow: none;
  color: black;
  background: white;
}

aside {
  align-self: center;
  display: flex;
  flex-direction: column;
}

table {
  margin: 1rem;
  display: grid;
  border-collapse: collapse;
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  border-left: 1px solid #ddd;
  border-top: 1px solid #ddd;
  
  /*  minmax(max-content, max-content)
    minmax(max-content, max-content)
    minmax(150px, 1.67fr)
    minmax(150px, 1fr);*/
}
table.two {
  grid-template-columns: auto 1fr;
}

table tr > td:first-child {
  display: flex;
  flex-direction: column;
}

table tr > td:first-child a {
  display: block;
  padding: 0.25rem;
  align-self: stretch;
  margin-bottom: 0.5rem;
}

table.three {
  grid-template-columns: repeat(3, auto);
}
table.four {
  grid-template-columns: repeat(4, auto);
}
table.five {
  grid-template-columns: repeat(5, auto);
}

thead,
tbody,
tr {
  display: contents;
}

.griditems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: center;
}

th,
td {
  padding: 0.125rem 0.25rem;
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

th.right,
td.right {
  text-align: right;
}

th {
  color: #808080;
  background: #f0efff;
  position: sticky;
  top: 0;
  text-align: left;
  font-weight: normal;
  font-size: 1.1rem;
  padding: 0.5rem;
}

td {
  line-height: 2rem;
  display: flex;
}

td a {
  align-self: flex-start;
  white-space: nowrap;
}

tr:nth-child(even) td {
  background: #f8f6ff;
}

form {
  align-self: center;
}

form h5 {
  margin-top: calc(var(--nf-input-size) * 1.5);
}

.form-list {
  margin-top: calc(var(--nf-input-size) * 1.5);
  display: flex;
  align-items: flex-start;
}

.form-list > * {
  display: flex;
  flex-direction: column;
  padding: calc(var(--nf-input-size) * 0.75);
}

.form-list .prefix {
  border: none;
}

.form-list .group {
  border: var(--nf-input-border-width) solid var(--nf-input-border-color);
  border-radius: var(--nf-input-border-radius);
  align-items: stretch;
  flex: 2;
}

.nice-form-row-action {
  align-self: flex-end;
  height: 2.75rem;
}

.form-list .group > .nice-form-group:first-child {
  margin-top: 0;
}

exercises,
workouts,
admins,
users {
  flex: 1;
}

aside.dialogue {
  margin: 2rem 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-self: stretch;
  border: 1px dotted black;
  border-radius: 5px;
}
aside.dialogue p { flex: 1; padding: 0.25rem; }
aside.dialogue.remove {
  border-color: var(--red);
  color: red;
}
aside.dialogue.remove button { border-color: var(--red); color: var(--red) }
aside.dialogue.remove button:hover { color: white; background: var(--red); }

.gridtwo {
  display: grid;
  grid-template-columns: 1fr auto;
  align-self: center;
}

.muscleselector {
  padding-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto) 1fr;
  width: calc(100vw - 450px);
  max-width: 900px;
  overflow: hidden;
  row-gap: 1em;
}

.musclelist {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  z-index: 1;
}

.musclelist label {
  margin-right: 0.25rem;
}

.musclelist button {
  padding: 0.125rem 0.25rem;
  justify-self: start;
}

.muscleselector h4 {
  text-align: center;
  z-index: 2;
  grid-column: span 2;
}

.muscleselector svg {
  transform: scale(1.4);
  align-self: center;
}

.muscle {
  cursor: pointer;
  fill: white;
  stroke: white;
  stroke-width: 2px;
}

.musclepills {
  display: flex;
  flex-wrap: wrap;
  align-self: start;
}

.musclepill {
  padding: 0.125rem 0.25rem 0;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1em;
  height: 1.25em;
  margin: 0 0.25em 0.25em 0;
}

.muscle.major,
.musclepill.major {
  fill: #E92A2A;
  stroke: #E92A2A;
  background: #E92A2A;
}
.muscle.minor,
.musclepill.minor {
  fill: #2ae95d;
  stroke: #2ae95d;
  background: #2ae95d;
}
.muscle.stabilizer,
.musclepill.stabilizer {
  fill: #bbbbbb;
  stroke: #bbbbbb;
  background: #bbbbbb;
}
