@import url('/css/utils.css');

@media only screen and (min-width: 600px) {
  body {
    font-size: 150%;
  }
}

main {
  width: 100%;
  max-width: 100vw;
  margin-left: auto;
  margin-right: auto;

  display: grid;
  grid-template-areas: "training"
                       "controls";
  grid-template-rows: auto min-content;
  grid-template-columns: 1fr;
  gap: 2rem;
  justify-items: center;
  justify-content: center;
  align-items: flex-start;
}

@media (hover: hover) {
  main {
    grid-template-areas: "controls"
                         "training";
    grid-template-rows: min-content auto;
  }
}

#controls > * {
  margin-top: 1rem;
}

label.file-upload-button {
  display: inline-block;
  cursor: pointer;
  font-size: 100%;

  padding: 0.5rem;
  border: 1px solid #3e3e3e;
  border-radius: 0.125rem;
    
  background-color: #3e3e3e;
  color: #cecece;
}

label.file-upload-button:hover {
  background-color: var(--blue-hex);
  color: white;
}

label.file-upload-button:active {
  background-color: var(--blue-hex);
  color: #3e3e3e;
}

input[type=file] {
  display: none;
}

.horizontal-group {
  gap: 1em;
}

#training {
  grid-area: training;
  width: 100%;
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fit, minmax(min-content, 20rem));
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
}

.training-day {
  border: 1px solid #3e3e3e;
  background-color: white;
  color: #3e3e3e;
  
  display: inline-grid;
  gap: 0;
  grid-template-areas: "training-date"
                       "training-distance"
                       "training-description"
                       "training-data"
                       "training-data-entry"
                       "training-data-actions";
  grid-template-rows: auto auto 1fr auto auto auto;                       
  justify-content: stretch;
  justify-items: center;
  align-content: start;
  align-items: center;
  overflow: hidden;

  min-width: 10rem;
  max-width: 20rem;
  min-height: 10rem;

  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.35);
}

.training-day.performed {
  background-color: rgba(var(--green-components), 20%);
}

.training-day.rest-day {
  background-color: #cecece;
}

.training-day > * {
  min-width: 0px;
}

.training-date {
  width: 100%;
  font-size: 150%;
  grid-area: training-date;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  background-color: #3e3e3e;
  text-align: center;
  color: #cecece;
}

.training-day.performed > .training-date {
  color: white;
}

.training-distance {
  grid-area: training-distance;
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 150%;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

.training-description {
  grid-area: training-description;
  font-size: 75%;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  text-align: center;
}

.training-data {
  grid-area: training-data;
  font-size: 100%;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.training-data-entry {
  grid-area: training-data-entry;
  font-size: 80%;
  width: 100%;
  display: none;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  background-color: #3e3e3e;
  color: white;
  overflow: hidden;
  gap: 0.5rem;
}

@media (hover: hover) {
  .training-data-entry {
    align-items: flex-start;
  }
}

.training-data-actions {
  grid-area: training-data-actions;
  width: 100%;
  display: none;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  background-color: #3e3e3e;
  overflow: hidden;
  padding-left: 0.5rem;
}

.training-day.selected > .training-data-actions,
.training-day.selected > .training-data-entry {
  display: flex;
}

li > label {
  color: #3e3e3e44;
  justify-self: center;
}

li > button {
  justify-self: center;
}

li.done > label {
  color: var(--blue-hex);
}

li.done > .item-content > .note {
  text-decoration: line-through;
}

@media only screen and (max-width: 600px) {
  .tags {
    display: none;
  }
}

.tag {
  -moz-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.tag.status {
  display: none;
}

li.item.done .tag.status {
  display: inline-flex;
} 

.tag.created::before {
  content: "created:";
  padding-right: 0.5em;
}

.tag.last-modified::before {
  content: "last-modified:";
  padding-right: 0.5em;
}

.tag {
  font-size: 50%;

  padding-left: 1em;
  padding-right: 1em;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-radius: 1em;
  height: 2em;
  margin: 0.25rem;

  border: 1px solid var(--blue-hex);
  color: white;
  background-color: var(--blue-hex);

  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.training-day.performed .tag {
  border: 1px solid var(--green-hex);
  color: white;
  background-color: var(--green-hex);
}

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

.error[data-error] {
  position: relative;
}

.error[data-error]:hover::after {
  content: attr(data-error);
  position: absolute;
  top: 1.5em;
  left: 0;
  padding: 0.25rem;
  background-color: var(--red-hex);
  border: 1px dotted #3e3e3e;
  color: white;
  font-size: 75%;
  z-index: 100;
}
