:root {
  --black-1: #050505;
  --black-2: #1f1f1f;
  --black-3: #2d2d2d;
  --black-4: #3a3a3a;
  --gray-1: #757575;
  --white-1: #e9e9e9;
  --white-2: #f4f4f4;
  --white-3: #ffffff;
  --purple-1: #a445ed;
  --orange-1: #ff5252;

  --body-bg-color: var(--white-2);
  --text-color: var(--black-2);
  --container-bg-color: var(--white-3);
  --text-gray-color: var(--gray-1);
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter/static/Inter-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter/static/Inter-Bold.ttf");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "Inconsolata";
  src: url("../assets/fonts/inconsolata/static/inconsolata-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Inconsolata";
  src: url("../assets/fonts/inconsolata/static/inconsolata-Bold.ttf");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "Lora";
  src: url("../assets/fonts/lora/static/lora-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Lora";
  src: url("../assets/fonts/lora/static/lora-Bold.ttf");
  font-weight: bold;
  font-style: normal;
}

html {
  /* This makes 1rem = 10px. I am going to use rem in this page. */
  font-size: 62.5%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--body-bg-color);
  color: var(--text-color);
}

/* Utility classes */

/* Sans Serif family */
.heading-lg-sans-serif {
  font-family: "Inter", sans-serif;
  font-size: 6.4rem;
}

.heading-md-sans-serif {
  font-family: "Inter", sans-serif;
  font-size: 2.4rem;
}

.heading-sm-sans-serif {
  font-family: "Inter", sans-serif;
  font-size: 2rem;
}

.body-md-sans-serif {
  font-family: "Inter", sans-serif;
  font-size: 1.8rem;
}

.body-sm-sans-serif {
  font-family: "Inter", sans-serif;
  font-size: 1.4rem;
}

/* Serif family */
.heading-lg-serif {
  font-family: "Lora", sans-serif;
  font-size: 6.4rem;
}

.heading-md-serif {
  font-family: "Lora", sans-serif;
  font-size: 2.4rem;
}

.heading-sm-serif {
  font-family: "Lora", sans-serif;
  font-size: 2rem;
}

.body-md-serif {
  font-family: "Lora", sans-serif;
  font-size: 1.8rem;
}

.body-sm-serif {
  font-family: "Lora", sans-serif;
  font-size: 1.4rem;
}

/* Mono family */
.heading-lg-mono {
  font-family: "Inconsolata", sans-serif;
  font-size: 6.4rem;
}

.heading-md-mono {
  font-family: "Inconsolata", sans-serif;
  font-size: 2.4rem;
}

.heading-sm-mono {
  font-family: "Inconsolata", sans-serif;
  font-size: 2rem;
}

.body-md-mono {
  font-family: "Inconsolata", sans-serif;
  font-size: 1.8rem;
}

.body-sm-mono {
  font-family: "Inconsolata", sans-serif;
  font-size: 1.4rem;
}

.text-center {
  text-align: center;
}

.py-1 {
  padding: 1rem 0;
}

.py-2 {
  padding: 2rem 0;
}

.py-3 {
  padding: 3rem 0;
}

.py-4 {
  padding: 4rem 0;
}

.my-1 {
  margin: 1rem 0;
}

.my-2 {
  margin: 2rem 0;
}

.my-3 {
  margin: 3rem 0;
}

.my-4 {
  margin: 4rem 0;
}

a {
  text-decoration: none;
}

img {
  width: 100%;
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 1rem 50px;
  background-color: var(--container-bg-color);
  transition: background-color 0.9s;
}

/* Settings bar */
.settings-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  height: 6rem;
}

/* Dictionary logo */
.logo {
  width: 3.2rem;
  height: 3.7rem;
}

.vertical-separator {
  width: 1px;
  height: 20px;
  margin-left: 16px;
  background-color: var(--white-1);
}

/* ----------------------------------------------- */
/* Select dropdown */
/* ----------------------------------------------- */
.settings-b {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Style for the dropdown */
select {
  padding: 1rem 3.5rem;
  border-radius: 4px;
  border: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Style for the options */
option {
  padding: 1rem;
  font-size: 5rem;
}

/* Adding a custom arrow to the dropdown */
select {
  background-image: url("../assets/images/icon-arrow-down.svg");
  background-repeat: no-repeat;
  background-position: right 10px top 50%;
  background-size: 12px 12px;
}

/* ----------------------------------------------- */
/* Switch */
/* ----------------------------------------------- */

/* Hide the default checkbox */
input[type="checkbox"] {
  visibility: hidden;
}

/* Style for the Switch (lever) */
.lever {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: var(--gray-1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 1s;
}

/* Style for the Circle inside the Switch */
.lever::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 13px;
  height: 13px;
  background-color: white;
  border-radius: 50%;
  transition: all 1s;
}

/* Change styles when the Checkbox is Checked */
input[type="checkbox"]:checked + .lever {
  background-color: var(--purple-1);
}

input[type="checkbox"]:checked + .lever::before {
  transform: translateX(20px); /* Move the circle to the right */
  transition: all 5s;
}

/* ----------------------------------------------- */
/* Theme icon */
/* ----------------------------------------------- */
.icon-moon {
  width: 19.99px;
  height: 20px;
  margin-top: 0rem;
  margin-left: 1rem;
}

.icon-moon path {
  transition: all 0.5s;
}

/* Switch & Moon icon will be on same line */
.switch label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ----------------------------------------------- */
/* Search box */
/* ----------------------------------------------- */
.search-line {
  position: relative;
  width: 100%;
}

.search-line img {
  width: 15px;
  height: 15px;
  position: absolute;
  top: 30%;
  right: 1rem;
  display: inline-block;
  cursor: pointer;
}

.dict-input-word {
  width: 100%;
  height: 4rem;
  background-color: var(--white-1);
  border-radius: 1rem;
  padding: 1rem 1rem;
  font-size: 1.3rem;
  letter-spacing: 1px;
  border: 1px solid var(--white-1);
  outline: none;
  transition: all 0.4s;
}

.dict-input-word:focus,
.dict-input-word:active {
  border: 1px solid var(--white-1);
}

/* ----------------------------------------------- */
/* Result */
/* ----------------------------------------------- */
#data-container h1 {
  font-size: 4rem;
}

.phonetic-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem 0;
}

.phonetic-line p {
  font-size: 1.3rem;
  color: var(--purple-1);
  letter-spacing: 1px;
  font-style: italic;
}

.part-of-speech-wrapper {
  padding: 1rem 0;
}

.part-of-speech-wrapper .part-of-speech {
  padding-right: 1rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  color: var(--gray-1);
  position: relative;
}

.part-of-speech-wrapper .part-of-speech h3 {
  padding-right: 0.5rem;
}

.h-line {
  width: 100%;
  height: 0.1rem;
  background-color: var(--white-1);
}

.part-of-speech-wrapper .meaning {
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  color: var(--gray-1);
}

ul {
  margin-left: 2rem;
}

.part-of-speech-wrapper li {
  margin-left: 2rem;
  font-size: 1.5rem;
  margin: 1rem;
}

.part-of-speech-wrapper ul li p {
  line-height: 1.5;
}

.example {
  margin-top: 1rem;
  font-size: 1.3rem;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  color: var(--gray-1);
}

/* ----------------------------------------------- */
/* Error message */
/* ----------------------------------------------- */
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: 2rem 0;
}

#data-container .error-container h1 {
  font-size: 1.5rem;
  padding-bottom: 2rem;
}

#data-container .error-container p {
  font-size: 1.2rem;
  padding-bottom: 2rem;
  text-align: center;
}

.audio-small-screen {
  display: none;
}

/* ----------------------------------------------- */
/* Tablet */
/* ----------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    width: 736px;
    max-width: 1024px;
    margin: auto;
    padding: 1rem 2rem;
  }

  audio {
    display: none;
  }

  .playButton:hover {
    cursor: pointer;
  }

  .audio-small-screen {
    display: block;
    width: 35px;
    height: 35px;
  }
}

/* ----------------------------------------------- */
/* Mobile */
/* ----------------------------------------------- */
@media (max-width: 768px) {
  .container {
    width: 100%;
    margin: auto;
    padding: 1rem 2rem;
  }

  audio {
    display: none;
  }

  .playButton:hover {
    cursor: pointer;
  }

  .audio-small-screen {
    display: block;
    width: 35px;
    height: 35px;
  }
}

/* ----------------------------------------------- */
/* Loading spinner */
/* ----------------------------------------------- */
#spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--purple-1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 2s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
