/*
 * SPDX-FileCopyrightText: 2026 The ExtRA Authors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

:root {
  color-scheme: light dark;

  --solid: light-dark(black, white);
  --grey-heavy: light-dark(#d5d5d5, #373a5d);
  --grey-light: light-dark(#f0f0f0, #292c47);
  --acc-color: light-dark(#053FFF, #50f1c1);
  --error-color: light-dark(#ff94be, #d01348);
}

body {
  color: var(--solid);
  background-color: light-dark(white, #1c1e30);
  accent-color: var(--acc-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  max-width: min(800px, 90vw);
  margin: auto;
}

button[command="show-modal"], .logout > button {
  all: unset;
  cursor: pointer;
}

a, a:visited, button[command="show-modal"], .logout > button {
  color: var(--acc-color);
  text-decoration: none;
}

nav, admin-nav{
  border: solid 1px var(--solid);
  border-top: none;
  background: var(--grey-heavy);

  display: flex;
  flex-direction: row;
  flex-wrap: wrap;

  .current {
    background: light-dark(white, #1c1e30);
  }

  a, .logout > button {
    padding: 10px;

    &:hover {
      background: var(--grey-light);
    }
  }

  .right-start {
    margin-left: auto;
  }
}

form:not(.modal-form):not(.logout) {
  max-width: fit-content;
  margin: 1rem auto;
  text-align: center;
  padding: 1rem;
  background: var(--grey-light);
  border: 1px solid var(--solid);

  checkbox-list {
    text-align: left;
    display: flex;
    flex-direction: column;
  }
}


table {
  margin: 1rem auto;
  border-collapse: collapse;
  border: 1px solid var(--solid);

  th, td {
    padding: 1rem;
  }

  th {
    background: var(--grey-heavy);
  }

  tr:nth-child(odd) {
    background: var(--grey-light);
  }
}

error-box {
  display: block;
  max-width: fit-content;
  padding: 1rem;
  margin: 1rem auto;
  text-align: center;

  border: 1px solid var(--solid);
  background-color: var(--error-color);
}

:root, body {
  height: 100%;
}

footer {
  position: sticky;
  top: 100vh;
}

footer {
  border: solid 1px var(--solid);
  border-bottom: none;
  background: var(--grey-heavy);

  max-width: fit-content;
  margin: auto;

  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;

  a {
    padding: 10px;

    &:hover {
      background: var(--grey-light);
    }
  }
}

dialog {
  border: solid 1px var(--solid);
  max-width: min(500px, 90vw);
  margin: auto;

  h2 {
    margin-top: 0;
  }

  dialog-buttons {
    margin-top: 0.66em;

    display: flex;
    justify-content: right;
    gap: 0.5em;
  }
}

main {
  margin: 1rem auto;
}

details h3 {
  display: inline;
  font-weight: normal;
}

/* Hack for not displaying a table without data running*/
table:not(:has(td)) {
  * {
    display: none;
  }

  &::before {
    display: block;
    content: "No Data in this Table.";
    padding: 1rem;
  }
}
