:root {
  --bg-color: #fffbac;
  --shadow-color: #915228;
  --btn-bg: #f0a675;
  --suggestion-bg: #d88c59;
  --suggestion-div-bg: #b17a56;
  --btn-shadow: #a37150;
  --text-color: #fcf5ed;
  --container-shadow: 0 20px 40px var(--btn-bg);
  --mode-btn: #5f5f5f;
}
* {
  margin: 0;
  padding: 0;
  font-family: "Space Mono", monospace;
  /* outline: 1px solid; */
}

body {
  background-color: var(--bg-color);
  height: 90vh;
}
body.dark {
  --bg-color: #15191d;
  --shadow-color: #212529;
  --btn-bg: #000000;
  --btn-shadow: #000000;
  --text-color: #f3f3f3;
  --suggestion-bg: #262626;
  --suggestion-div-bg: #252323;
  --container-shadow: 0 20px 4px var(--btn-bg);
  --mode-btn: #bbb;
}
nav {
  background-color: var(--bg-color);
  height: 70px;
  width: 100vw;
  box-shadow: 0 2px 8px var(--shadow-color);
}
button {
  cursor: pointer;
}
main {
  display: flex;
  height: 90%;
  align-items: center;
  justify-content: center;
}

nav ul {
  margin: 0px 50px;
  display: flex;
  list-style: none;
  justify-content: space-between;
  align-items: center;
}
nav img {
  margin: 5px;
  height: 60px;
  cursor: pointer;
}
nav div {
  height: 100%;
}
nav ul div {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
}
nav ul div .toggle-switch {
  display: flex;
  position: relative;
  top: -10px;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
nav button {
  margin: 15px 0;
  padding: 10px 10px;
  text-align: center;
  border-radius: 5px;
  border: transparent;
  background-color: var(--btn-bg);
  box-shadow: 2px 1px 5px var(--btn-shadow);
  color: var(--text-color);
}

.container {
  background-color: var(--btn-bg);
  position: relative;
  padding: 80px 50px;
  border-radius: 10px;
  box-shadow: var(--container-shadow);
  transition: 0.5s;
  width: 35%;
  z-index: 1;
}

.input-box {
  width: 100%;
  display: flex;
  align-items: self-start;
  justify-content: center;
}
.input-box input {
  padding: 5px;
  background-color: var(--btn-bg);
  outline: none;
  border: none;
  color: var(--text-color);
  border-bottom: 3px solid var(--text-color);
  transition: 1s;
}
.dark-mode {
  color: var(--mode-btn);
  cursor: pointer;
}
.input-box input:focus {
  border-bottom: 3px solid var(--suggestion-bg);
}
.input-box div {
  display: flex;
  flex-direction: column;
}
.input-box input::placeholder {
  color: var(--text-color);
  opacity: 0.7;
}
.input-box button {
  padding: 10px;
  /* width: 50%; */
  /* height: 5%; */
  background-color: var(--text-color);
  border: none;
  border-radius: 25px;
  outline: transparent;
  color: var(--btn-bg);
  font-size: 18px;
  display: inline-block;
  /* aspect-ratio: 9/1; */
  margin: 6px;
}
.input-box button:hover {
  background-color: #f5f19a;
  transition: 0.4s;
}
ul.suggestion-container {
  width: 100%;
  margin-block: 5px;
  list-style: none;
  border-end-end-radius: 5px;
  border-bottom-left-radius: 5px;
}

.suggestion-container li {
  background-color: var(--btn-shadow);
  cursor: pointer;
  border: 1px solid white;
  border-top: none;
  color: var(--text-color);
}

.result {
  overflow-x: auto;
  position: relative;
  transition: 0.5s;
  z-index: 999;
}
.result .word {
  display: flex;
  justify-content: space-between;
  margin-top: 70px;
}

.result h3 {
  font-size: 30px;
  color: var(--text-color);
}

.result button img {
  height: 16px;
  width: 16px;
}
.result button {
  border: none;
  outline: transparent;
  background: none;
}
.result .details {
  display: flex;
  gap: 10px;
  color: var(--text-color);
  margin: 5px 0 20px 0;
  font-size: 14px;
  transition: 0.5s;
}

.word-meaning {
  color: var(--text-color);
  font-size: 16px;
}
.word-example {
  color: var(--text-color);
  font-style: italic;
  border-left: 5px solid var(--bg-color);
  padding-left: 20px;
  margin-top: 30px;
  font-size: 14px;
}
.error {
  margin-top: 80px;
}

aside {
  position: absolute;
  width: 90%;
  z-index: 22;
  display: none;
  align-self: center;
  top: 50%;
  right: 50%;
  transform: translate(55%, -500%);
}

.before {
  position: absolute;
  top: 25%;
  background-color: var(--btn-bg);
  width: 90%;
  min-height: 45vh;
  height: 60vh;
  max-height: 80vh;
  display: flex;
  align-items: center;
  transform: translateY(15px);
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  z-index: 22;
  outline: 1px solid white;
}
.container-tab div {
  display: flex;
  justify-content: space-between;
}
.before .container-tab {
  max-width: 25vw;
  border-radius: 10px;
  padding: 10px;
  width: 200px;
  height: 80%;
  max-height: 100%;
  box-shadow: var(--container-shadow);
  margin: 20px;
  object-fit: fill;
  overflow: auto;
  border: 1px solid;
  color: var(--text-color);
}
.before .container-tab h1 {
  margin-bottom: 20px;
}
.before .container-tab p {
  object-fit: contain;
  padding: 5px;
}
.cross-container {
  position: relative;
  background-color: blue;
  width: 100%;
  height: 100%;
  z-index: inherit;
}
.cross {
  position: absolute;
  z-index: 22;
  right: 10px;
  top: 10px;
  cursor: pointer;
}
.before i {
  cursor: pointer;
  color: var(--text-color);
}
aside h2 {
  position: relative;
  font-size: 25px;
  z-index: 24;
  background-position-x: right;
  background-color: var(--btn-bg);
  display: inline-block;
  color: white;
  text-decoration: underline;
}
@media screen and (max-width: 768px) {
  .before {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  nav {
    width: 100vw;
  }
  .before .container-tab {
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 20px 40px var(--shadow-color);
    object-fit: fill;
    overflow: auto;
    width: 100%;
  }
}

@media screen and (max-width: 425px) {
  nav {
    width: 100%;
    position: relative;
    z-index: 88;
    height: auto;
  }
  nav ul {
    margin: 0 10px;
  }
  nav img {
    width: 5rem;
    margin-left: 0;
    height: auto;
  }
  nav button {
    box-shadow: 0px 2px 5px var(--btn-shadow);
    margin: 0.3rem;
    font-size: 0.6rem;
  }
  nav div {
    display: flex;
  }
  main {
    /* margin-top: 50px; */
    width: 100vw;
    overflow: auto;
  }
  .container {
    margin-top: 50px;

    min-width: 60%;
    /* aspect-ratio: 7/1; */
    height: auto;
    padding: 50px 40px 70px 40px;
    display: flex;
    flex-direction: column;
    overflow: auto;
    position: relative;
  }
  .container .input-box {
    flex-direction: column;
    align-items: center;
  }
  .container .input-box input {
    width: 100%;
  }
  .container .input-box button {
    width: 40%;
    margin-top: 10px;
    display: inline;
    font-size: 12px;
    font-weight: bold;
  }
  .result {
    position: relative;
    z-index: 998;
  }
  .result .details {
    font-size: 0.8rem;
  }
  .word h3 {
    font-size: 1rem;
  }
  .word-meaning,
  .word-example {
    font-size: 0.6rem;
  }

  aside {
    position: absolute;
    width: 90vw;
    z-index: 22;
    display: none;
    align-self: center;
    top: 20%;
    right: 43%;
    transform: translate(55%, -500%);
  }
  .before {
    position: absolute;
    top: 0;
    background-color: var(--btn-bg);
    width: 90vw;
    left: -40px;
    /* margin: 0; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* z-index: 22; */
  }

  .before .container-tab {
    margin: 0;
  }

  .container-tab div {
    font-size: 0.5rem;
  }
  .before .container-tab h1 {
    font-size: 1rem;
  }
  .before .container-tab p {
    font-size: 0.5rem;
  }
  aside div {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .cross {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  aside h2 {
    background-color: var(--btn-bg);
    font-size: 1rem;
    position: absolute;
    left: -20px;
  }
}
