body {
  margin: 0;

  --tabs-height: 35px;
  --stats-height: 20px;

  --editor-background: #1E1E1E;

  --tabs-background: #121212;
  --tabs-inactive-border: #252525;
  --tabs-active-border: #313131;
  --tabs-disabled-border: rgb(60, 19, 19);

  --toolbar-background:rgb(35, 35, 35);
  --toolbar-border: rgb(46, 46, 46);

  --text: white;
  --text-low: rgb(190, 190, 190);

  font-family: Menlo, Monaco, "Courier New", monospace;

  overscroll-behavior: none;
  background-color: var(--tabs-background);
}

* {
  font-family: Menlo, Monaco, "Courier New", monospace;
}

.seo-hidden {
  position: absolute;
  left: -9999px;
}

input {
  border: 1px solid black;
  border-radius: 0px;
  color: var(--text);
  background-color: transparent;
}

input[type="file"] {
  border: none;
}

a {
  color: aqua;
}

code {
  opacity: 90%;
  background-color: #1212127d;
}

.scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;

  transition: .2s;
}
.scrollbar::-webkit-scrollbar-track {
  border-radius: 0;
  background: transparent;

  transition: .2s;
}
.scrollbar::-webkit-scrollbar-thumb {
  background: var(--editor-background);
  border-radius: 0;
  border: 1px solid var(--tabs-active-border);

  transition: .2s;
}
.scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--tabs-active-border);
}


#tabs {
  height: var(--tabs-height);

  display: flex;
  flex-direction: row;

  background-color: var(--tabs-background);

  overflow-x: auto;
  overflow-y: hidden;

  position: relative;
  z-index: 10;

  scrollbar-width: none;
  &::-webkit-scrollbar { display: none; }

  #tabs_container {
    height: 100%;
    display: flex;
    flex-direction: row;

    .tab {
      position: relative;

      height: 100%;
      width: fit-content;

      color: var(--text);
      font-size: 14px;

      box-sizing: border-box;

      background-color: var(--tabs-background);
      border: 1px solid var(--tabs-inactive-border);

      &.active {
        background-color: var(--editor-background);
        border: 1px solid var(--tabs-active-border);
        border-bottom: none;
      }

      .tab-name {
        display: block;

        width: 100%;
        height: 100%;
        min-width: 100px;
        box-sizing: border-box;

        padding: 0px 30px;

        text-align: center;
        line-height: var(--tabs-height);
      }

      .tab-close {
        position: absolute;
        right: 5px;
        top: calc( var(--tabs-height) / 2 - 10px );

        color: var(--text);
        background-color: transparent;
        border: none;
      }
    }
  }

  .add-tab-button-container {
    height: 100%;
    aspect-ratio: 1 / 1;
    position: relative;

    font-size: 16px;

    transition: .15s;

    &:hover {
      --shadow: 0px 4px 8px 4px rgba(0, 0, 0, 0.4);
      -webkit-box-shadow: var(--shadow);
      -moz-box-shadow: var(--shadow);
      box-shadow: var(--shadow);

      .new-tab-selector {
        animation: show 0.15s ease-out forwards;
        pointer-events: auto;
      }
    }

    &:not(:hover) {
      .new-tab-selector {
        animation: hide 0.15s ease-out forwards;
        pointer-events: none;
      }
    }

    #add_tab {
      background-color: var(--editor-background);
      border: 1px solid var(--tabs-active-border);
      border-bottom: none;

      width: 100%;
      height: 100%;

      color: var(--text);

      &:hover {
        opacity: 80%;
      }

      &:active {
        opacity: 50%;
      }
    }

    .new-tab-selector {
      position: fixed;

      top: var(--tabs-height);
      padding: 5px;
      width: 145px;

      background-color: var(--editor-background);
      border: 1px solid var(--tabs-active-border);

      -webkit-box-shadow: var(--shadow);
      -moz-box-shadow: var(--shadow);
      box-shadow: var(--shadow);

      z-index: 10;

      display: flex;
      flex-direction: column;
      gap: 5px;

      --move: -7px;
      --animOffset: 0px;
      transform: translateX(var(--move, 0px)) translateY(var(--animOffset, 0px));
      will-change: transform, opacity;

      &::before {
        content: "";

        position: absolute;
        top: calc(-1 * var(--tabs-height));
        right: 0;

        height: var(--tabs-height);
        width: calc(100% - var(--tabs-height) + 2px + var(--move));
      }

      &::after {
        content: "";

        position: absolute;
        top: calc(-1 * var(--tabs-height));
        left: 0;

        height: var(--tabs-height);
        width: calc(-1 * var(--move));
        max-width: calc(100% - var(--tabs-height) + 6px + 8px);
      }

      > button {
        background-color: var(--editor-background);
        border: 1px solid var(--tabs-active-border);

        color: var(--text);

        width: 100%;
        padding: 3px 10px 3px 5px;

        text-align: justify;

        --btn-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.4);
        -webkit-box-shadow: var(--btn-shadow);
        -moz-box-shadow: var(--btn-shadow);
        box-shadow: var(--btn-shadow);

        > span {
          vertical-align: bottom;
          margin-right: 3px;
        }


        transition: .15s;

        &:hover {
          transform: translateY(-2px);
          --btn-shadow: 0px 4px 6px 4px rgba(0, 0, 0, 0.4);
        }

        &:active {
          transform: translateY(1px);
          --btn-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.4);
        }
      }
    }
  }
}

@keyframes show {
  0% {
    transform: translateX(var(--move, 0px)) translateY(10px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateX(var(--move, 0px)) translateY(0px);
  }
}

@keyframes hide {
  0% {
    transform: translateX(var(--move, 0px)) translateY(0px);
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateX(var(--move, 0px)) translateY(10px);
    opacity: 0;
  }
}


#stats {
  height: var(--stats-height);

  font-size: 12px;
  line-height: var(--stats-height);
  padding: 0px 36px;

  background-color: var(--editor-background);

  color: var(--text-low);


  display: flex;
  flex-direction: row;
  gap: 20px;


  #breadcrumbs {
    flex-grow: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }

    > a {
      text-decoration: none;

      > i {
        display: inline;
        font-size: 12px;
        line-height: var(--stats-height);
        vertical-align: bottom;

        &::before {
          text-decoration: none !important;
        }
      }

      > span {
        padding-left: 2px;
      }
    }

    > a:hover {
      > span {
        text-decoration: underline;
      }
    }

    > a:not(:last-child)::after {
      content: " > ";
    }
  }

  > * {
    white-space: nowrap;
  }
}

#stats {
  height: var(--stats-height);

  font-size: 12px;
  line-height: var(--stats-height);
  padding: 0px 36px;

  background-color: var(--editor-background);

  color: var(--text-low);


  display: flex;
  flex-direction: row;
  gap: 20px;


  #breadcrumbs {
    flex-grow: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }

    > a {
      text-decoration: none;

      > i {
        display: inline;
        font-size: 12px;
        line-height: var(--stats-height);
        vertical-align: bottom;

        &::before {
          text-decoration: none !important;
        }
      }

      > span {
        padding-left: 2px;
      }
    }

    > a:hover {
      > span {
        text-decoration: underline;
      }
    }

    > a:not(:last-child)::after {
      content: " > ";
    }
  }

  > * {
    white-space: nowrap;
  }
}

#editor {
  width: 100vw;
  height: calc(100vh - var(--tabs-height) - var(--stats-height));
}

#toolbar {
  position: fixed;
  z-index: 5;

  left: 20px;
  bottom: 20px;

  display: flex;
  flex-direction: row;
  gap: 10px;

  .button {
    --extend: 0fr;

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

    --shadow: 0px 4px 8px 4px rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: var(--shadow);
    -moz-box-shadow: var(--shadow);
    box-shadow: var(--shadow);

    padding: 10px;

    cursor: pointer;

    display: grid;
    align-items: center;
    grid-template-columns: 24px var(--extend);

    transition: .15s;


    &:hover {
      --extend: 1fr;

      --shadow: 0px 8px 16px 8px rgba(0, 0, 0, 0.3);
      transform: translateY(-4px);
    }

    &:active {
      --shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.3);
      transform: translateY(2px);
    }

    i {
      color: var(--text);

      font-size: 22px;
    }

    span {
      min-width: 0px;
      overflow-x: hidden;

      color: var(--text);

      box-sizing: border-box;

      white-space: nowrap;
    }

    --blink-color: lime;
  }
}

.modal {
  position: fixed;
  display: none;
  z-index: 15;

  top: 0;
  left: 0;

  width: 100vw;
  height: 100vh;

  background-color: rgba(0, 0, 0, 0.4);

  .container {
    width: min(400px, calc(100% - 120px));
    position: absolute;

    background-color: var(--editor-background);
    box-shadow: 0px 8px 15px 12px rgba(0, 0, 0, 0.2);

    color: var(--text);
    font-size: 14px;



    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    padding: 10px 20px;

    .close {
      position: absolute;
      right: -25px;
      top: 0;

      cursor: pointer;

      font-size: 20px;

      color: var(--text);
      background-color: transparent;
      border: none;
    }
  }
}


#import_modal_container {
  label[for="imported_file"] {
    border: 1px solid var(--tabs-active-border);
    background-color: var(--editor-background);
    border-radius: 0px;
    color: var(--text);
    text-align: center;

    width: 100%;
    display: block;
    padding: 5px;
    box-sizing: border-box;

    box-shadow: 0px 4px 4px 2px rgba(0, 0, 0, 0.2);
    transition: .15s;

    &:hover {
      box-shadow: 0px 6px 6px 3px rgba(0, 0, 0, 0.2);
      transform: translateY(-2px);
    }

    &:active {
      box-shadow: 0px 2px 2px 1px rgba(0, 0, 0, 0.2);
      transform: translateY(2px);
    }
  }

  #imported_file {
    display: none;
  }

  .line { 
    margin: 5px 0px 5px 0px;

    span {
      font-size: 12px;
      vertical-align: text-top;
    }
  }

  #import_errors {
    background-color: rgba(255, 0, 0, 0.4);
    margin-bottom: 20px;
    box-shadow: 0px 4px 4px 2px rgba(0, 0, 0, 0.2);
    opacity: 0;
  }

  #import_errors:not(:empty) {
    padding: 10px 20px;
    opacity: 1;
  }

  #imported_craft_specs {
    padding: 5px 10px;
    border: 1px solid var(--tabs-active-border);
    box-shadow: 0px 4px 4px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;

    &:empty {
      display: none;
    }

    h2 {
      margin: 5px 0px;
    }

    .tags {
      display: flex;
      flex-direction: row;
      gap: 5px;
      flex-wrap: wrap;

      span {
        background-color: var(--tabs-active-border);
        border-radius: 0px;
        box-shadow: 0px 2px 2px 1px rgba(0, 0, 0, 0.2);

        padding: 3px 5px;
        font-size: 12px;
      }
    }

    p {
      margin: 2px 0px;
    }

    .size {
      margin-top: 15px;
    }
  }

  #import_craft {
    border: 1px solid var(--tabs-active-border);
    background-color: var(--editor-background);
    border-radius: 0px;
    color: var(--text);

    width: 100%;
    padding: 5px;

    box-shadow: 0px 4px 4px 2px rgba(0, 0, 0, 0.2);
    transition: .15s;

    &:hover {
      box-shadow: 0px 6px 6px 3px rgba(0, 0, 0, 0.2);
      transform: translateY(-2px);
    }

    &:active {
      box-shadow: 0px 2px 2px 1px rgba(0, 0, 0, 0.2);
      transform: translateY(2px);
    }

    &:disabled {
      opacity: 70%;
      pointer-events: none;
      border-color: var(--tabs-disabled-border);
    }
  }
}


.copyVarBtn {
  background: url("./assets/icons/copy_3_line.svg") center center no-repeat;
  background-size: 16px;
  padding-left: 10px;
  cursor: pointer;

  position: relative;

  transition: .15s;

  opacity: 80%;

  &:hover {
    opacity: 60%;
  }

  &:active {
    opacity: 30%;
  }
}

#change_logs_modal_container {
  transition: .3s ease-in-out;
}

#change_logs_modal_logs {
  display: flex;
  flex-direction: column;

  max-height: 40px;
  transition: .3s ease-in-out;

  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-snap-stop: always;

  padding-bottom: 40px;

  .change-logs {
    scroll-snap-align: start;
    padding-top: 40px;

    .change-logs-header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;

      font-size: 16px;

      .change-logs-name {
        font-weight: 700;
      }

      .change-logs-date {
        opacity: 40%;
      }
    }

    .tags {
      opacity: 40%;
      font-size: 12px;
    }
  }
}


#share_modal_container {
  width: 200px;

  p {
    margin: 0;
    margin-bottom: 10px;
  }

  > button:not(.close) {
    background-color: var(--editor-background);
    border: 1px solid var(--tabs-active-border);

    color: var(--text);

    width: 100%;
    padding: 3px 10px 3px 5px;

    text-align: justify;

    --btn-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: var(--btn-shadow);
    -moz-box-shadow: var(--btn-shadow);
    box-shadow: var(--btn-shadow);

    > span {
      vertical-align: bottom;
      margin-right: 3px;
    }


    transition: .15s;

    &:hover {
      transform: translateY(-2px);
      --btn-shadow: 0px 4px 6px 4px rgba(0, 0, 0, 0.4);
    }

    &:active {
      transform: translateY(1px);
      --btn-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.4);
    }

    &:last-child {
      margin-top: 5px;
    }
  }
}


#shared_modal_container {
  display: flex;
  gap: 5px;

  #shared_input {
    flex-grow: 1;

    border: 1px solid var(--tabs-active-border);

    --btn-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: var(--btn-shadow);
    -moz-box-shadow: var(--btn-shadow);
    box-shadow: var(--btn-shadow);

    transition: .15s;

    &:focus {
      transform: translateY(1px);
      --btn-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.4);
    }
  }

  #shared_add {
    background-color: var(--editor-background);
    border: 1px solid var(--tabs-active-border);

    color: var(--text);

    padding: 3px 10px 3px 10px;

    text-align: justify;

    --btn-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: var(--btn-shadow);
    -moz-box-shadow: var(--btn-shadow);
    box-shadow: var(--btn-shadow);


    transition: .15s;

    &:hover {
      transform: translateY(-2px);
      --btn-shadow: 0px 4px 6px 4px rgba(0, 0, 0, 0.4);
    }

    &:active {
      transform: translateY(1px);
      --btn-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.4);
    }
  }
}


#loader {
  position: fixed;
  /* display: none; */
  z-index: 99;

  top: 0;
  left: 0;

  width: 100vw;
  height: 100vh;

  background-color: var(--tabs-background);

  .loader-container {
    position: absolute;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;

    div {
      background-color: var(--text);
      width: 20px;
      height: 20px;
      opacity: 50%;

      box-shadow: 0px 3px 3px 3px rgba(0, 0, 0, 0.8);
    }

    > div:nth-child(1) {
      animation: loader 1.4s ease-in-out 0s infinite;
    }

    > div:nth-child(2) {
      animation: loader 1.4s ease-in-out 0.2s infinite;
    }

    > div:nth-child(3) {
      animation: loader 1.4s ease-in-out 0.4s infinite;
    }

    > div:nth-child(4) {
      animation: loader 1.4s ease-in-out 0.6s infinite;
    }
  }

  p {
    position: absolute;

    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 0);

    background-color: var(--editor-background);
    box-shadow: 0px 4px 8px 4px rgba(0, 0, 0, 0.6);

    color: var(--text);
    font-size: 14px;
    text-align: center;

    padding: 10px 20px;

    transition: .3s;
  }
}

@keyframes loader {
  0% {
    height: 20px;
    box-shadow: 0px 3px 3px 3px rgba(0, 0, 0, 0.8);
  }

  20% {
    height: 100px;
    opacity: 100%;
    box-shadow: 0px 0px 4px 4px rgba(255, 255, 255, 0.9);
  }

  100% {
    height: 20px;
    box-shadow: 0px 3px 3px 3px rgba(0, 0, 0, 0.8);
  }
}

@keyframes blink {
  0% {
    box-shadow: none;
  }
  5% {
    box-shadow: 0 0 0 4px var(--blink-color);
  }
  100% {
    box-shadow: none;
  }
}