@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap");

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* CSS RESET */
/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* CSS RESET */
/* ------------- */

:root {
  /* Font */
  --default-font: "DM Sans", sans-serif;

  /* Neutral */
  --neutral-900: #12131a;
  --neutral-800: #21222c;
  --neutral-700: #2a2b37;
  --neutral-600: #404254;
  --neutral-200: #e4e4ef;
  --neutral-100: #f2f2f7;
  --neutral-000: #ffffff;

  /* Purple */
  --purple-400: #d3a0fa;
  --purple-500: #c27cf8;

  /* Yellow */
  --yellow-500: #ff9f00;

  /* Orange */
  --orange-500: #fe8159;
  --orange-800: #da3701;
}

.text-preset-1 {
  font-family: var(--default-font);
  font-optical-sizing: auto;
  font-weight: bold;
  font-style: normal;
  font-size: 64px;
  line-height: 100%;
  letter-spacing: -1px;
}

.text-preset-1-mobile {
  font-family: var(--default-font);
  font-optical-sizing: auto;
  font-weight: bold;
  font-style: normal;
  font-size: 40px;
  line-height: 100%;
  letter-spacing: -1px;
}

.text-preset-2 {
  font-family: var(--default-font);
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  font-size: 64px;
  line-height: 130%;
  letter-spacing: -1px;
}

.text-preset-3 {
  font-family: var(--default-font);
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 140%;
  letter-spacing: -0.6px;
}

.text-preset-4 {
  font-family: var(--default-font);
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  line-height: 130%;
  letter-spacing: -0.6px;
}

/* Start of App */

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--neutral-900);
}

.project-container {
  padding: 2rem;
  /* width: 990px; */
  /* min-width: 375px;
  width: calc(300px + 30vw); */
  width: 990px;
  min-width: 375px;

  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
}

.project-container > * {
  flex-shrink: 2;
}

/* There's 4 divs inside the project container */

.header {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;

  margin-top: 2rem;
}

.logo {
}

.theme-toggle {
}
/* ------------------------------------- */

.title {
  /* text-align: center; */
  width: 100%;
  display: flex;
  justify-content: center;
  color: var(--neutral-000);
}

.title h1 {
  width: 700px;
  text-align: center;
}

/* ------------------------------------- */

.text-input-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.text-input-container textarea {
  appearance: none;
  width: 100%;
  min-height: 200px;
  border-radius: 12px;
  background-color: var(--neutral-800);
  outline: 1px solid var(--neutral-700);
  padding: 20px;
  color: var(--neutral-000);
}

textarea {
  transition: border 0.5s ease-in;
}

textarea:focus {
  border: 3px solid var(--purple-500);
}

.text-input-info {
  color: var(--neutral-000);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-input-options {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: ceter;
  gap: 1rem;
}

.checkbox-options {
  display: flex;
  gap: 3rem;
}

/* ------------------------------------- */

.results {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.results-cards {
  display: flex;
  flex-direction: row;
  gap: 16px;
}
.results-cards > * {
  width: 100%;
}

.box {
  flex: 1;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;

  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  z-index: 1;
}

.box img {
  position: absolute;
  right: -30px;
  top: 0;
  z-index: -1;
}

.total-characters {
  background-color: var(--purple-400);
}

.word-count {
  background-color: var(--yellow-500);
}

.sentence-count {
  background-color: var(--orange-500);
}

.letter-density-container {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  color: var(--neutral-000);
}

.bar-container {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.bar {
  position: relative;
  background-color: var(--neutral-800);
  height: 70%;
  border-radius: 8px;
  overflow: hidden;
}

.bar-percent-A,
.bar-percent-E,
.bar-percent-I,
.bar-percent-O,
.bar-percent-U {
  position: absolute;
  width: 50%;
  height: 100%;
  background-color: var(--purple-400);
  border-radius: 8px;
}

.letter1,
.letter2,
.letter3,
.letter4,
.letter5 {
  text-align: center;
}

/* input[type="checkbox"] {
  appearance: none;
}

input[type="checkbox"]::before {
  content: "";
  background-color: white;
  appearance: none;
  min-width: 40px;
  height: 20px;
  border: 1px solid blue;
} */

/* *Utilities */

.hide-me {
  display: none;
}

/* !Extras */
#character-limit-input {
  appearance: none;
  color: white;
  background-color: #12131a;
  outline: none;
  border: 1px solid var(--neutral-600);
  border-radius: 6px;
  width: 55px;
  height: 29px;
  font-family: var(--default-font);
  text-align: center;
  height: 100%;

  /* border: 1px solid red; */
}

.checkbox2 {
  /* border: 1px solid red; */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

/* !That thang start breaking 743 pixels */

@media (width < 640px) {
  .results-cards {
    display: flex;
    flex-direction: column;
  }

  .text-input-info {
    color: var(--neutral-000);
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    gap: 1rem;
  }

  .text-input-options {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

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

  .title h1 {
    font-size: 40px;
  }
}

/** Light Theme **/

.body-light {
  background-color: white;
}

.project-container-light {
  background-color: white;
}

.project-container-light label,
.project-container-light p,
.project-container-light h2,
.project-container-light h1 {
  color: black;
}

.project-container-light .bar,
.project-container-light textarea {
  background-color: var(--neutral-100);
}

.project-container-light textarea {
  border: 1px solid var(--neutral-200);
}

.dark-toggle {
  background-color: var(--neutral-700);
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.light-toggle {
  background-color: var(--neutral-100) !important;
  padding: 0.5rem;
  border-radius: 0.5rem;
}
