@import url("https://fonts.googleapis.com/css2?family=Inconsolata:wght@500&@800display=swap");
:root {
  --background-color: #ffffff;
  --caret-color: #ff9d00;
  --text-primary: black;
  --text-correct: #0c7c59;
  --text-incorrect: #d64933;
  --icon-filter: invert(0.1);
  --navbar-border-color: #e6e8e8;
}

.dark-mode {
  --background-color: #1b1f23;
  --text-primary: #94938f;
  --text-correct: #dddddb;
  --icon-filter: invert(0.5);
  --navbar-border-color: #424444;
}

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  font-family: "Inconsolata", monospace;
  box-sizing: border-box;
}

body {
  width: 100%;
  background-color: var(--background-color);
  color: var(--text-primary);
  display: flex;
}

.navbar {
  display: flex;
  position: relative;
  width: 5%;
  flex-direction: column;
  padding-top: 2rem;
  height: 100vh;
  align-items: center;
  border-left: 1px solid var(--navbar-border-color);
}

.navbar a {
  text-decoration: none;
  width: 2.2rem;
  display: block;
}

.setting {
  display: none;
  background-color: var(--background-color);
  position: absolute;
  border: 1px solid var(--text-primary);
  top: 1rem;
  width: 12rem;
  right: 4.2rem;
  padding: 1rem;
  border-radius: 5px;
  animation: fade-in 0.6s;
  color: var(--text-primary);
  text-align: left;
  z-index: 10;
}

.setting::before {
  content: "";
  position: absolute;
  bottom: 60%;
  left: 100%;
  border: 10px solid transparent;
  border-left: 10px solid var(--text-primary);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
.setting-item:first-child {
  padding-top: 0;
  border-bottom: 1px solid var(--text-primary);
}

.setting-item:last-child {
  padding-bottom: 0;
}

.container {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 95%;
  padding: 5rem 6rem 0;
}

.quote-display {
  display: flex;
  flex-wrap: wrap;
}

.quote-display.filter {
  filter: blur(4px);
}

.quote-display .char {
  word-spacing: -5px;
  font-size: 30px;
  white-space: pre-wrap;
  user-select: none;
  line-height: 1.5;
  position: relative;
}
.current::before {
  content: "";
  height: 32px;
  border-left: 2px solid var(--caret-color);
  position: absolute;
  top: 0;
  bottom: 0;
}

.quote-input {
  width: 1px;
  cursor: default;
  background: none;
  border: none;
  position: absolute;
  color: rgba(241, 236, 206, 0%);
  outline: none;
}

.correct {
  color: var(--text-correct);
}

.incorrect {
  color: var(--text-incorrect);
  text-decoration: underline;
}

.info {
  position: absolute;
  top: 7rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  z-index: 10;
}

.control {
  display: flex;
  justify-content: center;
  margin-top: 3.5rem;
}

.btn {
  border: none;
  background: none;
  padding: 0;
  width: 1.5rem;
  cursor: pointer;
}

.btn-copy {
  margin-right: 1rem;
}
.btn-setting {
  margin-bottom: 0.5rem;
  width: 2.2rem;
}

.btn-next {
  margin-left: 1rem;
  position: relative;
  top: 3px;
}

.icon {
  filter: var(--icon-filter);
  width: 100%;
}

.icon:hover {
  opacity: 0.6;
}

.skeleton {
  width: 100%;
  height: 1.2rem;
  margin-bottom: 0.5rem;
  border-radius: 3px;
  animation: skeleton-loading 1s linear infinite alternate;
}

.skeleton:last-child {
  width: 50%;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background-color);
  border: 2px solid #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 4px;
  bottom: 2px;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

input:checked + .slider {
  border-color: #0c7c59;
}

input:focus + .slider {
  box-shadow: 0 0 1px #0c7c59;
}

input:checked + .slider:before {
  -webkit-transform: translateX(22px);
  -ms-transform: translateX(22px);
  transform: translateX(22px);
  background-color: #0c7c59;
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 70%);
  }
  100% {
    background-color: hsl(200, 20%, 95%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
