[data-theme="light"] {
  --color-switch: rgba(31, 31, 65, 0.9);
  --color-accent: #9069a7;
  --color-error: #dd374d;
  --color-security: #004ac0;
  --color-warning: #004ac0;
  --color-background: #ffe5ee;
  --color-background--header: #fefefe;
  --color-background--pastes: #fff;
  --color-background--resizer: rgb(255, 255, 255, 0.9);
  --color-background--button: #eff2f7;
  --color-foreground: #2e2e33;
  --color-foreground--dim: rgb(46, 46, 51, 0.6);
  --color-foreground--border: rgb(46, 46, 51, 0.2);
  --color-annotation: rgb(185, 52, 69);
  --color-second-paste: #f6f8fa;
  --button--brightness: brightness(0.95);
  --button--brightness-hover: brightness(0.85);
  --button--brightness-active: brightness(0.95);
  --color-line-hover: rgb(237, 219, 85, 0.2);
  --color-line-selected: rgb(237, 219, 85, 0.2);

  .keyboardLight {
    display: none !important;
  }

  .deleteFile {
    background-color: var(--color-background);
    filter: brightness(0.99);
  }

  .deleteFile:hover {
    cursor: pointer;
    filter: brightness(0.97);
  }

  .deleteFile:active {
    filter: brightness(0.99);
  }

  .savePaste {
    background-color: var(--color-background);
    filter: brightness(0.99);
  }

  .savePaste:hover {
    cursor: pointer;
    filter: brightness(0.97);
  }

  .savePaste:active {
    filter: brightness(0.99);
  }
}

[data-theme="dark"] {
  --color-switch: rgb(246, 249, 255, 0.6);
  --color-accent: #c89ee0;
  --color-error: #dd374d;
  --color-security: #c8e09e;
  --color-warning: #feff99;
  --color-background: #15151c;
  --color-background--header: #1d1d26;
  --color-background--pastes: rgb(29, 29, 38, 0.9);
  --color-background--resizer: rgb(29, 29, 38, 0.9);
  --color-background--button: #1d1d26;
  --color-foreground: #c9c9d1;
  --color-foreground--dim: rgb(201, 201, 209, 0.6);
  --color-foreground--border: rgb(201, 201, 209, 0.2);
  --color-annotation: rgb(192, 99, 112, 0.8);
  --color-second-paste: rgba(127, 97, 175, 0.05);
  --button--brightness: brightness(1.2);
  --button--brightness-hover: brightness(1.1);
  --button--brightness-active: brightness(1.1);
  --color-line-hover: rgb(237, 219, 85, 0.1);
  --color-line-selected: rgb(237, 219, 85, 0.1);

  .keyboardDark {
    display: none !important;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  scrollbar-color: var(--color-background) var(--color-background--header);
  scrollbar-width: auto;
}

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: "Lato", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.logo {
  height: 2.25rem;
  width: 2.25rem;
}

.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 2rem;
  background-color: var(--color-background--header);
}

.headerSection {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3em;
  color: var(--color-accent);
}

.headerSection {
  text-decoration: none;
}

.headerRight {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.keyboard {
  user-select: none;
  width: 2.75rem;
  padding-top: 0.19rem;
  height: auto;
  opacity: 0.6;
}

.keyboard:hover {
  cursor: help;
}

.footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.footerSection {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  font-size: 0.8em;
}

.footerSection>a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9em;
}

.footerText {
  font-size: 0.9em;
  color: var(--color-foreground--dim);
}

.content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 2rem;
  gap: 2rem;
}

.pasteArea {
  display: flex;
  flex-grow: 1;
  flex-shrink: 1;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background-color: var(--color-background--pastes);
  border-radius: 0.25rem;
  border: 1px solid transparent;
}

.dragging {
  opacity: 0.5;
  border: 1px dashed var(--color-accent);
  position: relative;
  cursor: copy;
  background-color: var(--color-background--pastes);
}

.dragging::after {
  pointer-events: none;
  content: "Drop File to Paste...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.prevented {
  border: 1px dashed var(--color-error);
  cursor: no-drop;
}

.prevented::after {
  content: "File is not allowed...";
  color: var(--color-error);
  font-weight: 700;
  font-size: larger;
}

.pasteHeader {
  background-color: var(--color-second-paste);
  border-radius: 0.25rem 0.2rem 0 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  width: 100%;
}

.pasteContainer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
  width: 100%;
  max-width: 100%;
  border-radius: 0.25rem;
}

input[type="password"] {
  background-color: var(--color-background--pastes) !important;
  color: var(--color-foreground) !important;
}

.filenameArea {
  resize: none;
  background-color: var(--color-background--pastes);
  color: var(--color-foreground);
  border-radius: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-optical-sizing: auto;
  font-style: normal;
  font-size: smaller;
  outline: none;
  border: var(--color-foreground--border) 1px solid;
  padding: 0.25rem;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: hidden;
}

.filenameArea:focus {
  outline: var(--color-foreground--dim) 1px solid;
}

.pasteArea>textarea {
  display: flex;
  flex-grow: 1;
  resize: vertical;
  background-color: var(--color-background--pastes);
  color: var(--color-foreground);
  outline: none;
  border-radius: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-optical-sizing: auto;
  font-style: normal;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: scroll;
  border: none;
  padding: 1rem;
  width: 100%;
  height: 100%;
  min-height: 32rem;
}

.smallArea {
  flex-grow: 0;
  height: 9rem;
}

.smallArea>textarea {
  min-height: 4rem;
  height: 4rem;
}

textarea::-webkit-resizer {
  background-color: var(--color-background--resizer);
}

textarea {
  scrollbar-color: var(--color-background) var(--color-background--header);
  scrollbar-width: auto;
}

.addPaste {
  display: flex;
  padding: 1rem;
  border-radius: 0 0 0.25rem 0.25rem;
  background-color: var(--color-background--header);
  color: var(--color-accent);
  justify-content: center;
  align-content: center;
  user-select: none;
}

.addPaste:hover {
  cursor: pointer;
  filter: var(--button--brightness-hover);
}

.addPaste:active {
  filter: var(--button--brightness-active);
}

.deleteFile {
  display: flex;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  background-color: var(--color-background--header);
  filter: brightness(0.8);
  color: var(--color-accent);
  justify-content: center;
  align-content: center;
  user-select: none;
}

.deleteFile:hover {
  cursor: pointer;
  filter: brightness(0.9);
}

.deleteFile:active {
  filter: brightness(0.8);
}

.disabled {
  cursor: unset;
  opacity: 0.6;
  filter: brightness(0.9);
}

.disabled:hover {
  cursor: unset;
  filter: brightness(0.9);
}

.disabled:active {
  filter: brightness(0.9);
}

.pasteOptions {
  display: flex;
  flex-direction: column;
  background-color: var(--color-background--header);
  border-radius: 0 0 0.25rem 0.25rem;
}

.pasteOptions>.hrLight {
  width: 98%;
}

.hrLight {
  border-top: none;
  border-left: none;
  border-right: none;
  outline: none;
  border-bottom: 1px solid var(--color-foreground--border);
  margin: 1rem 0;
  align-self: center;
}

.pasteOptionsSection {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  padding: 0 1rem;
  width: 100%;
}

.savePaste {
  display: flex;
  padding: 0.75rem 4rem;
  border-radius: 0.25rem;
  background-color: var(--color-background--button);
  filter: var(--button--brightness);
  color: var(--color-accent);
  justify-content: center;
  align-content: center;
  user-select: none;
}

.savePaste:hover {
  cursor: pointer;
  filter: var(--button--brightness-hover);
}

.savePaste:active {
  filter: var(--button--brightness-active);
}

.fileContent {
  padding: 0.5rem;
  overflow-x: auto;
  position: relative;
}

.identifierHeader {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: baseline;
}

.identifierHeaderLeft {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.identifierHeaderLeft>a {
  font-weight: 600;
  text-decoration: none;
}

.identifierHeaderLeft>span {
  color: var(--color-foreground--dim);
  font-weight: 400;
  font-size: 0.7em;
}

.identifierHeaderSection {
  font-size: 0.9em;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.linenos {
  font-family: "JetBrains Mono", monospace;
}

.pre {
  font-family: "JetBrains Mono", monospace;
}

.vsc {
  width: 14px;
  height: 14px;
}

.pasteButton {
  font-size: 0.8em;
  color: var(--color-accent);
  user-select: none;
}

.pasteButton:hover {
  cursor: pointer;
  filter: brightness(1.1);
}

#errorResponse {
  color: var(--color-error);
  padding: 1rem;
}

.protected {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.protectedPassword {
  resize: none;
  background-color: var(--color-background--pastes);
  color: var(--color-foreground);
  border-radius: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-optical-sizing: auto;
  font-style: normal;
  outline: none;
  border: var(--color-foreground--border) 1px solid;
  padding: 0.5rem;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: hidden;
  height: 3rem;
}

.protectedPassword:focus {
  outline: var(--color-foreground--dim) 1px solid;
}

.annotations {
  padding-bottom: 0.25rem;
  font-size: 0.9em;
  color: var(--color-annotation);
  padding-left: 1rem;
  background-color: var(--color-second-paste);
}

.security {
  color: var(--color-security);
}

.langSelectContainer {
  display: flex;
  align-items: center;
}

.langSelectContainer>label {
  background-color: var(--color-background--resizer);
  color: var(--color-foreground);
  padding: 0.25rem;
  border-radius: 0.25rem;
  border: 1px solid var(--color-foreground--border);
  outline: none;
}

.langSelectContainer>label>input {
  background-color: transparent;
  color: var(--color-foreground--dim);
  outline: none;
  border: none;
  padding: 0.25rem;
}

.langSelectContainer>label:hover {
  cursor: pointer;
  filter: brightness(1.1);
}

.langSelectContainer>label>input:hover {
  cursor: pointer;
}

.lineNums {
  display: block;
  border-collapse: collapse;
  border-spacing: 0;
  border: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.1rem;
  user-select: none;
}

.lineNumRow {
  padding: 0;
  padding-right: 16px !important;
  opacity: 0.7;
}

.lineNumRow:hover {
  cursor: pointer;
  background-color: var(--color-line-hover);
}

.lineNumRowSelected {
  background: var(--color-line-selected);
}

.lineSelected {
  background: var(--color-line-selected);
  position: absolute;
  width: 100%;
  z-index: 1;
  height: 1.1rem;
}

.lineWarn {
  background: var(--color-error);
  position: absolute;
  width: 100%;
  z-index: 1;
  height: 1.1rem;
  opacity: 0.4;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.1rem;
  z-index: 2;
}

.annotationSecond {
  color: var(--color-warning);
  opacity: 0.9;
  padding-left: 0.125rem;
  font-weight: 400;
}

.annotationSecond:hover {
  cursor: help;
}

/* Theme Switch */
.themeSwitch {
  --size: 1.5rem;

  appearance: none;
  outline: none;
  cursor: pointer;

  width: var(--size);
  height: var(--size);
  box-shadow: inset calc(var(--size) * 0.33) calc(var(--size) * -0.25) 0;
  border-radius: 999px;
  color: var(--color-switch);

  transition: all 500ms;

  &:checked {
    --ray-size: calc(var(--size) * -0.4);
    --offset-orthogonal: calc(var(--size) * 0.65);
    --offset-diagonal: calc(var(--size) * 0.45);

    transform: scale(0.75);
    color: var(--color-switch);
    box-shadow: inset 0 0 0 var(--size),
      calc(var(--offset-orthogonal) * -1) 0 0 var(--ray-size),
      var(--offset-orthogonal) 0 0 var(--ray-size),
      0 calc(var(--offset-orthogonal) * -1) 0 var(--ray-size),
      0 var(--offset-orthogonal) 0 var(--ray-size),
      calc(var(--offset-diagonal) * -1) calc(var(--offset-diagonal) * -1) 0 var(--ray-size),
      var(--offset-diagonal) var(--offset-diagonal) 0 var(--ray-size),
      calc(var(--offset-diagonal) * -1) var(--offset-diagonal) 0 var(--ray-size),
      var(--offset-diagonal) calc(var(--offset-diagonal) * -1) 0 var(--ray-size);
  }
}

.notFound {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-self: center;
}

.annotationSecond {
  position: relative;
}

.annotationSecond:after {
  position: absolute;
  content: attr(data-text);
  color: var(--color-foreground);
  background-color: var(--color-background);
  top: 50%;
  transform: translateY(-50%);
  left: 100%;
  width: max-content;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  padding: 0.5rem;
  display: none;
  /* hide by default */
  opacity: 1;
}

.annotationSecond:hover:after {
  display: block;
}

.keyboardTool {
  position: relative;
}

.keyboardTool:after {
  position: absolute;
  content: attr(data-text);
  color: var(--color-foreground);
  background-color: var(--color-background);
  width: max-content;
  border-radius: 0.25rem;
  padding: 0.75rem;
  display: none;
  /* hide by default */
  opacity: 1;
  right: 0;
  white-space: pre;
  z-index: 9;
  cursor: help;
}

.keyboardTool:hover:after {
  display: inline-block;
}

@media screen and (max-width: 600px) {
  .annotations {
    font-size: 0.8em;
  }

  .savePaste {
    padding: 0.75rem;
    font-size: 0.8em;
  }

  .deleteFile {
    padding: 0.5rem 1rem;
    font-size: 0.8em;
  }

  .deleteFile {
    padding: 1rem;
    font-size: 0.8em;
  }

  .footer {
    flex-direction: column;
    padding: 0 0 1rem 0;
  }

  .identifierHeaderSection {
    font-size: 0.8em;
  }

  .identifierHeader {
    gap: 1rem;
  }

  .filenameArea {
    font-size: 0.6em;
  }

  .content {
    padding: 1rem 0.5rem 1rem 0.5rem;
  }

  .header {
    padding: 1rem 0.5rem;
  }

  .pasteArea>textarea {
    font-size: 0.8em;
  }

  .langSelectContainer>label {
    max-width: 6rem;
    padding: 0;
  }

  .langSelectContainer>label>input {
    max-width: 6rem;
    font-size: 0.7em;
  }

  .pasteHeader {
    padding: 0.5rem;
  }
}

@media screen and (max-device-width: 480px){
  body {
    -webkit-text-size-adjust: 100%;
  }

  code {
    -webkit-text-size-adjust: 100%;
  }
}
