html {
  height: 100%;
  width: 100%;
}

body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: "Iosevka Web";
}

main {
  display: flex;
  flex-direction: row;
  height: 100%;
  z-index: 0;
}

.dark-mode-body {
  color: #fafafa;
  background-color: #161b22;
}

.light-mode-body {
  color: black;
  background-color: #ffffff;
}

.editor-container {
  height: 99%;
  width: 38%;
  display: inline-flex;
  gap: 10px;
  line-height: 20px;
  position: relative;
  font-family: "Iosevka Web";
  flex: 1 0 20rem;
}

.editor:focus {
  outline: none;
}

.markdown-display {
  border-radius: 0.5%;
  height: 94%;
  width: 52%;
  margin-right: 30px;
  font-size: 1.3rem;
  box-sizing: border-box;
  padding-left: 15px;
}

.markdown-display hr {
  width: 90%;
}

.line-numbers {
  padding-top: 14px;
  width: 20px;
  font-size: 1.4rem;
  text-align: right;
}

.line-numbers span {
  counter-increment: linenumber;
}

.line-numbers span::before {
  padding-bottom: 5.5px;
  content: counter(linenumber);
  display: block;
  color: #506882;
}

.plain,
.text {
  flex: 1 0 20rem;
  position: relative;
}

[data-el="input"] {
  border-width: 1px;
  color: transparent;
  white-space: break-spaces;
  word-break: break-word;
  resize: vertical;
}

.dark-mode-input {
  caret-color: #fafafa;
}

.light-mode-input {
  caret-color: black;
}

[data-el="input"][data-initialized="true"] {
  color: transparent;
  resize: none;
}

[data-el="highlight"] {
  font-family: inherit;
  line-height: inherit;
  font-size: inherit;
  margin: 0;
  padding: 0;
  white-space: break-spaces;
  word-break: break-word;
}

.plain__highlights {
  position: absolute;
  top: 0;
  left: 0;
  width: 90%;
  border: 1px solid transparent;
  pointer-events: none;
}

.editor,
.plain__highlights {
  width: 95%;
  font-size: 1.2rem;
  font-family: "Iosevka Web";
  margin: 0;
  padding: 0.7rem 1.4ch;
  line-height: 1.313;
  background: transparent;
  border: none;
  resize: none;
}

.action-button {
  font-weight: bold;
  font-family: "Iosevka Web";
  font-size: 0.92rem;
  border-radius: 4px;
  padding: 0 1rem;
  height: 36px;
  text-decoration: none;
  text-align: center;
  vertical-align: middle;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  border: none;
  position: relative;
}

.dark-mode-button {
  color: #fafafa;
}

.all-documents-button {
  color: #31373d;
}

.light-mode-button {
  color: black;
}

.download-button {
  background-color: #8153a5;
}

.user-buttons {
  background-color: #0969da;
}

.action-button:hover {
  transition:
    background-color,
    color 1s ease-in-out;
}

.download-button:hover {
  background-color: #644b7b;
}

.user-buttons:hover {
  background-color: #124c8e;
}

.action-button:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

.action-button:disabled {
  filter: brightness(75%);
}

.top-navbar {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  padding-right: 50px;
  column-gap: 10px;
  transition:
    width,
    height 2s;
}

.top-navbar a {
  font-size: 2rem;
}

.top-navbar h1 {
  margin: 10px auto 10px 10px;
  font-size: 1.5rem;
}

.modal {
  margin: auto;
  min-width: 15rem;
  border: solid 0.5px;
  padding: 1rem 1rem 1rem 1rem;
  border-radius: 5px;
  text-align: left;
}

.modal[open] {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

.light-mode-modal {
  color: black;
  background-color: #fafafa;
  border-color: #d0d7de;
}

.dark-mode-modal {
  color: #fafafa;
  background-color: #010409;
  border-color: #2c3138;
}

.modal input[type="email"],
input[type="password"],
input[type="text"] {
  font-family: "Iosevka Web";
  padding: 7px;
  outline: none;
  border-radius: 10px;
}

.light-mode-text-field {
  border: solid 1px;
  color: black;
  border-color: #d0d7de;
  background-color: #fafafa;
}

.dark-mode-text-field {
  border: solid 1px;
  color: #fafafa;
  border-color: #2c3138;
  background-color: #010409;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-modal-title {
  text-align: center;
}

dark-user-modal-title {
  color: #fafafa;
}

light-user-modal-title {
  color: black;
}

.submit-button {
  max-width: 80%;
  min-width: 75%;
  margin: 10px auto;
  background-color: #238636;
}

.submit-button:hover {
  background-color: #004d00;
  color: #ebebeb;
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 2;
}

.hidden {
  display: none;
}

.button-close {
  max-width: 20px;
  max-height: 25px;
  margin-left: auto;
  outline: none;
  border: none;
  border-color: #2c3138;
  background-color: #010409;
  color: #fafafa;
  border-radius: 100x;
}

.dark-mode-toggle {
  background: #161b2f;
}

.light-mode-toggle {
  background-color: white;
  color: black;
}

.error-message {
  color: red;
  font-weight: bold;
  word-wrap: break-word;
  text-align: center;
}

.error-modal {
  max-width: 30%;
}

.error-modal p {
  text-align: center;
  word-wrap: break-word;
}

.new-document-button {
  color: #fafafa;
}

.title-modal {
  min-height: 15%;
}

.document-modal {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.document-modal hr {
  width: 97%;
  color: #2c3138;
}

.document-modal a:link {
  text-decoration: none;
}

.dark-mode-document-link {
  color: #fafafa;
}

.dark-mode-document-link:visited {
  color: #fafafa;
}

.light-mode-document-link {
  color: black;
}

.light-mode-document-link:visited {
  color: black;
}

.document-modal a:visited {
  text-decoration: none;
}

.loading-button span {
  visibility: hidden;
}

.loading-button::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-radius: 50%;
  border-top-color: #fafafa;
  animation: loading-button-spinner 1s ease infinite;
}

@keyframes loading-button-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

.loading-overlay::after {
  content: "";
  width: 100px;
  height: 100px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-radius: 50%;
  border-top-color: #fafafa;
  animation: loading-button-spinner 1s ease infinite;
}

.markdown-display table {
  display: block;
  width: 100%;
  overflow: auto;
  word-break: normal;
  word-break: keep-all;
  border-collapse: collapse;
  border-spacing: 0;
  margin-top: 0;
  margin-bottom: 16px;
}
.markdown-display table tr {
  border-top: 1px solid;
}
.markdown-display table th,
.markdown-display table td {
  padding: 6px 13px;
  border: 1px solid;
  vertical-align: top;
}

.toggle {
  --width: 50px;
  --height: calc(var(--width) / 2);
  --border-radius: calc(var(--height) / 2);
  display: inline-block;
  cursor: pointer;
}

.toggle__input {
  display: none;
}

.toggle__fill {
  position: relative;
  width: var(--width);
  height: var(--height);
  border-radius: var(--border-radius);
  background: #dddddd;
  transition: background 0.2s;
}

.toggle__input:checked ~ .toggle__fill {
  background: #238636;
}

.toggle__fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: var(--height);
  width: var(--height);
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  border-radius: var(--border-radius);
  transition: transform 0.2s;
}

.toggle__input:checked ~ .toggle__fill::after {
  transform: translateX(var(--height));
}

.remember-me-container {
  margin: auto;
  display: flex;
  flex-direction: row;
  gap: 15px;
}

.greyed-out-text {
  padding-top: 2px;
  text-align: center;
  filter: brightness(30%);
  font-size: 90%;
}

.forgotten-password-link {
  margin: auto;
}

.forgotten-password-link:visited {
  color: inherit;
}

.forgotten-password-link:link {
  color: inherit;
}

.error-shake-modal {
  animation: error-shake 0.4s 1 linear;
}

@keyframes error-shake {
  0% {
    transform: translate(30px);
  }
  20% {
    transform: translate(-30px);
  }
  40% {
    transform: translate(15px);
  }
  60% {
    transform: translate(-15px);
  }
  80% {
    transform: translate(8px);
  }
  100% {
    transform: translate(0px);
  }
}

.recovery {
  max-width: 50%;
}

.to-home-page {
  margin: auto;
}

.button-delete {
  max-width: 30px;
  max-height: 25px;
  margin-left: 200px;
  outline: none;
  border: solid 1px;
  border-color: #2c3138;
  background-color: #010409;
  color: #fafafa;
  border-radius: 5px;
}

.button-delete:hover {
  transform: scale(1.25);
  transition: all 0.2s ease-in-out;
}

.button-delete:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}
