:root {
  --bg: #ffffff;
  --main: #f1f1f1;
  --compliment: #35355c;
}

html {
  padding: 0px;
  margin: 0px;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: black;
  font-family: "Montserrat", sans-serif;
  padding: 0px;
  margin: 0px;
}

nav {
  border-bottom: 5px solid #5d5da0;
  padding: 1.5rem;
  box-shadow: 0px 1px 10px #999;
}

.nav-contents {
  display: flex;
  justify-content: space-between;
  margin: 0rem 4rem;
  font-weight: bold;
}

a {
  margin: 15px;
  text-decoration: none;
  color: #414170;
}

a:hover {
  text-decoration: underline;
}

.calculator-link {
  text-decoration: underline;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  height: 100vh;
  margin-top: 50px;
}

.form-container {
  display: flex;
  gap: 1rem;
}

.title-container {
  width: 75rem;
}

h1 {
  color: black;
  letter-spacing: 1px;
  margin: 2px;
  font-size: 25px;
}

.instructions {
  font-size: 14px;
  color: #686868;
  margin: 2px;
}

form {
  width: 25rem;
  height: 30rem;
  border: 1.5px solid #c9c9c9;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.11);
}

fieldset {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 90%;
  gap: 1rem;
  border: none;
  padding: 25px;
  position: relative;
}

.inquiry {
  text-align: center;
}

p {
  font-size: 17px;
  margin: 0px;
  color: black;
}

.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: absolute;
  top: 35%; 
  width: 100px;
}

.calculate-btn {
  width: 14rem;
  margin: 2px;
  padding: 4px;
  height: 2.5rem;
  background-color: var(--compliment);
  color: white;
  border: none;
  border-radius: 3px;
  font-family: "Montserrat", sans-serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 0.4s;
}

.result-row {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
}

.result {
  width: 6rem;
}

.calculate-btn:hover,
.calculate-btn:focus {
  background-color: #5d5da0;
  font-weight: bold;
}

input {
  width: 4rem;
  height: 1.8rem;
  padding: 4px;
  margin: 8px 5px;
  background-color: var(--bg);
  color: var(--compliment);
  font-size: 18px;
  border: 1.5px solid #c9c9c9;
  border-radius: 4px;
  text-align: center;
}

input::placeholder {
  font-size: 13px;
}

input:focus {
  outline: 1px solid var(--compliment);
}

.reset {
  border: none;
  background-color: transparent;
  color: var(--compliment);
  font-size: 30px;
  padding: 0px;
  cursor: pointer;
}

.formula-container {
  display: flex;
  flex-direction: row;
  font-size: 12px;
  color: #575757;
}

.equals p {
  padding: 10px;
  font-size: 12px;
  color: #575757;
}

.multiply p {
  font-size: 12px;
  color: #575757;
}

.fraction {
  display: inline-block;
  text-align: center;
  vertical-align: middle;
}

.fraction .numerator,
.fraction .denominator {
  display: block;
}

.fraction .numerator {
  border-bottom: 1px solid #575757; /* Adjust thickness of the fraction line here */
  padding-bottom: 2px; /* Adjust spacing between numerator and fraction line */
}

.fraction .denominator {
  margin-top: 2px; /* Adjust spacing between fraction line and denominator */
}

.multiply {
  padding: 10px;
  vertical-align: middle;
  text-align: center;
}

@media (max-width: 1262px) {
  form {
    width: 22rem;
  }

  form p {
    font-size: 14px;
  }

  .title-container {
    width: 68rem;
  }
}

@media (max-width: 1126px) {
  .title-container {
    width: 40rem;
  }

  .form-container {
    flex-direction: column;
  }

  fieldset {
    justify-content: center;
    height: auto;
    gap: 10px;
  }

  form {
    width: 40rem;
    height: auto;
  }

  form p {
    font-size: 18px;
  }

  .result-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .result-row p {
    font-size: 16px;
  }

  .calculate-btn {
    width: 12rem;
    margin: 2px;
    padding: 4px;
    height: 2.5rem;
  }

  .result {
    width: 5rem;
  }
 
}

@media (max-width: 1015px) {
  .nav-contents {
    margin: 0rem 1rem;
    font-size: 15px;
  }

  @media (max-width: 925px) {
    .links {
      font-size: 13px;
    }

    .nav-contents p {
      font-size: 13px;
    }

    h1 {
      font-size: 20px;
    }
  }

  @media (max-width: 740px) {
    nav {
      padding: 1rem 0rem;
    }

    .web-name-container {
      width: 13rem;
      text-align: center;
    }

    .links {
      text-align: center;
    }
  }

  @media (max-width: 680px) {
    .links {
      display: flex;
      flex-direction: column;
      width: 15rem;
      gap: 1rem;
    }

    .title-container {
      width: 35rem;
    }

    form {
      width: 35rem;
    }

    a {
      margin: 0px;
    }
  }

  @media (max-width: 570px) {
    .title-container {
      width: 30rem;
    }

    form {
      width: 30rem;
    }

    form p {
      font-size: 15px;
    }

    fieldset {
      padding: 35px;
    }

    .result-row p {
      font-size: 15px;
    }
  }

  @media (max-width: 490px) {
    .web-name-container {
      width: 10rem;
      font-size: 12px;
    }

    .links {
      width: 12rem;
      font-size: 10px;
      gap: 0.5rem;
    }

    .title-container {
      width: 25rem;
    }

    form {
      width: 25rem;
    }

    fieldset {
      padding: 25px;
      flex-direction: column;
      gap: 1rem;
    }

    .inquiry {
      text-align: center;
    }

    input {
      width: 4rem;
      height: 1.5rem;
      font-size: 12px;
    }

    .result-container {
      justify-content: center;
    }
  }

  @media (max-width: 415px) {
    html {
      width: 100%;
    }

    nav {
      width: 100%;
    }

    .links {
      gap: 0rem;
      padding: 5px;
      width: 8rem;
    }

    .calculator-link {
      display: none;
    }

    .title-container {
      width: 98%;
    }

    h1 {
      font-size: 15px;
    }

    .instructions {
      font-size: 12px;
    }

    form {
      width: 98%;
    }

    fieldset {
      padding: 15px;
      flex-direction: column;
      gap: 1rem;
    }

    .result-row p {
      font-size: 13px;
    }

    .calculate-btn {
      width: 9rem;
      font-size: 12px;
      height: 2.5rem;
    }

    .reset {
      font-size: 25px;
    }
  }

  @media (max-width: 395px) {
    fieldset {
      padding: 15px;
    }

    form p {
      font-size: 13px;
    }

    .result-container {
      gap: 0.5rem;
    }

    .formula-container {
      font-size: 10px;
    }
  }

  @media (max-width: 345px) {
    .web-name-container p{
      font-size: 10px;
      width: 8rem;
    }

    .instructions {
      font-size: 10px;
    }

    fieldset {
      padding: 10px;
    }

    form p {
      font-size: 12px;
    }

    input {
      width: 3rem;
      height: 1rem;
      margin: 6px 8px;
    }

    input::placeholder {
      font-size: 10px;
    }

    .calculate-btn {
      width: 9rem;
      height: 2rem;
      font-size: 10px;
    }

    .result-container {
      gap: 0.5rem;
    }

    .formula-container {
      font-size: 8px;
    }
  }
}

@media (max-width: 300px) {
  .formula-container {
    font-size: 7px;
  }
}
