:root {
  --bg: #ffffff; /* white background */
  --text: #0f172a; /* ebony for text */
  --muted: #4e4e5b; /* soft grey for less prominent text */
  --accent: #4a6670;
  --accent-light: #4d80a5;
  --border: #e0e0e5; /* light border for edges/cards */
  --red: #ff746c;
  --grey: rgb(226, 232, 240);
  --radius: 8px;
  --max-width: max-content;
  --gap: 24px;
  --box-shadow: 0px 6px 5px -5px rgba(0, 0, 0, 0.65);
}

/* league-spartan-300 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 300;
  src: url("/static/fonts/league-spartan-v15-latin-300.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* league-spartan-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 400;
  src: url("/static/fonts/league-spartan-v15-latin-regular.woff2")
    format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* league-spartan-600 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 600;
  src: url("/static/fonts/league-spartan-v15-latin-600.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    margin-top: 16px;
  }
}

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

button,
input,
label {
  cursor: pointer;
  border: none;
  background: none;
}

body,
.container,
main {
  width: 100%;
}

body {
  padding: 40px;

  font-family: "League Spartan", sans-serif;
  font-weight: 300;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.01em;
  background-color: var(--bg);
}

header {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--gap);
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

nav {
  margin-left: 16px;
  font-size: 1.1rem;
}

nav a {
  color: var(--accent);
}

main {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

h1,
h2,
h3 {
  color: var(--text);
  margin-bottom: 16px;
}

p {
  color: var(--text);
  margin-bottom: 16px;
}

button {
  box-shadow: var(--box-shadow);
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
}

.button {
  display: inline-block;
  padding: 10px 18px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  transition: background-color 0.2s, color 0.2s;
}

footer {
  margin-top: var(--gap);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

table {
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  position: relative;
}

th,
td {
  min-width: 20ch;
  border: 1px solid #ccc; /* table borders */
  padding: 0.25rem 0.5rem;
  text-align: left;
}

thead th {
  top: -1px;
  padding: 8px;
  position: sticky;

  font-weight: 600;
  opacity: 1;
  color: black;
  background: var(--grey);

  z-index: 1;
}

thead th:is(.sort-asc, .sort-desc) {
  background-color: var(--accent);
}

th {
  cursor: pointer;
  user-select: none;
}

th:hover {
  background-color: #e9e9e9;
}

.display-text {
  white-space: pre-wrap;
  min-width: 120px;
  min-height: 44px;
}

.sort-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  width: 34px;
  height: 34px;
}

.sort-arrow:after {
  content: "";
  width: 100%;
  height: 100%;
  background-image: url("/static/imgs/sort_both.svg");
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

.sort-asc .sort-arrow:after {
  content: "";
  background-image: url("/static/imgs/sort_up.svg");
  background-size: 110%;
  background-position: bottom;
  background-position-y: 10px;
}

.sort-desc .sort-arrow:after {
  content: "";
  background-image: url("/static/imgs/sort_down.svg");
  background-size: 110%;
  background-position-y: 17px;
}

.term-detail-container .editable-cell {
  display: flex;
  flex-flow: row;
}

.editable-cell .edit-form {
  display: none; /* hidden by default */
}

textarea {
  min-height: 60px;
  min-width: 200px;
  box-sizing: border-box;
  overflow: auto;
  resize: both;
  font-weight: 300;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Container for normal display of plurals */
.editable-cell.complex .complex-display {
  list-style: none; /* remove bullets */
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem; /* spacing between plural items */
}

/* Each plural item in the display */
.editable-cell.complex .plural-item-display {
  display: flex;
  gap: 8px; /* space between label and value */
  align-items: center;
}

/* Label styling */
.editable-cell.complex .plural-label {
  min-width: 4ch; /* aligns labels nicely */
}

/* Value styling */
.editable-cell.complex .plural-value {
  flex: 1;
  color: var(--text);
  overflow-wrap: break-word;
}

/* Edit form for plurals (already hidden by default) */
.editable-cell.complex .edit-form {
  display: none;
}

/* Inputs inside the form */
.editable-cell.complex .plural-item input {
  flex: 1;
  box-sizing: border-box;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.link-cell-key {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.link-cell-key img {
  vertical-align: unset;
}

.button-group button {
  padding: 4px 8px;
  margin: 0 8px;
  font-size: 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s;
}

.filter-container,
.fieldset,
.input-container,
.input-wrap {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gap, 1rem);
  line-height: 1;
}

.input-container,
.input-wrap {
  align-items: center;
}

.filter-container {
  --gap: 1rem;

  flex-direction: column;
}

.fieldset {
  @media screen and (width > 700px) {
    max-width: 70%;
  }
}

.legend-text,
.info {
  min-width: 10ch;
  width: max-content;
  margin-block-end: 0;

  font-size: 1.25rem;
  font-weight: 400;
}

.input-wrap {
  --gap: 0;

  align-items: start;
}

.label {
  padding-right: 0.5rem;
  padding-left: 0.5rem;

  line-height: inherit;
  cursor: pointer;
  color: var(--muted);
  /* box-shadow: var(--box-shadow); */
  transition: background-color 0.2s;

  &:has(+ input:checked) {
    font-weight: 600;
  }

  &--checkbox {
    padding: 0.25rem 0.5rem;

    color: var(--bg);
    border-radius: 4px;
    background-color: var(--accent);

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

input {
  line-height: inherit;
}

.comment-form {
  display: flex;
  flex-direction: column;
  margin: 30px;
  gap: 4px;
}

.comment-section {
  max-width: 40%;
  border-radius: 8px;
}

.comment-section .comment {
  border-radius: 5px;
}

.save-button {
  background-color: var(--accent);
}

.cancel-button {
  background-color: var(--grey);
}

.search-container input[type="search"] {
  margin: 0.5rem 0;
  box-shadow: var(--box-shadow);
}

.key-head {
  width: 200px;
}

.term-body {
  max-width: 65%;
  display: flex;
  gap: 4em;
}

.translation-state {
  display: flex;
  justify-content: flex-end;
  height: 2em;
}

/* .translation-value-section {
} */

.key-cell {
  vertical-align: top;
}

.translation-state-button {
  display: flex;
  justify-content: flex-end;
  flex: 1;
}

#sortable-table-container {
  overflow: scroll;
  max-height: 600px;
  border: solid 1px rgba(0, 0, 0, 0.15);
}

#sortable-table .translation-state-button {
  display: none;
}

.btn-primary,
.btn-outline-primary {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover,
.btn-outline-primary:hover {
  background-color: var(--accent-light);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-outline-danger {
  border-color: var(--red);
  color: var(--red);
}

.btn-outline-danger:hover {
  background-color: var(--red);
  border-color: var(--red);
}

.tags .badge {
  padding-top: 0.5rem;
}
