*,
*::before,
*::after {
  box-sizing: border-box;
}

/* I'll leave my CSS as it is, even tho I can make it better and optimize */

html,
body,
#root {
  height: 100%;
  margin: 0;
}

body,
#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  margin: 0;
  font-family: Inter, sans-serif;
  background-color: #fafaf8;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  height: 76px;
  background-color: white;
  box-shadow:
    0px 1px 3px 0px rgba(0, 0, 0, 0.1),
    0px 1px 2px 0px rgba(0, 0, 0, 0.06);
  padding: 0 20px;
  z-index: 100;
}

header > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  height: 50px;
  font-size: 0.75rem;
}

header > img {
  width: 50px;
}

header > h1 {
  font-weight: 400;
  font-size: 1.75rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 30px 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-top: 76px;
  flex-grow: 1;

  align-items: stretch;
}

.add-ingredient-form {
  display: flex;
  justify-content: center;
  gap: 12px;
  height: 38px;
  margin: 2em 0;
}

.add-ingredient-form > button::after {
  content: "Add Ingredient";
}

.add-ingredient-form > input {
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 9px 13px;

  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
  flex-grow: 1;
  font-size: 1rem;

  width: 0;
  min-width: 50px;
  max-width: 280px;
}

.add-ingredient-form > button {
  font-family: Inter, sans-serif;
  border-radius: 6px;
  border: none;
  background-color: #141413;
  color: #fafaf8;
  min-width: 150px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.add-ingredient-form > button:hover {
  background-color: #1f1f1eb9;
  font-weight: 800;
  padding: 9px 15px;
}

.add-ingredient-form > button:active {
  animation: buttonClick 0.3s ease;
}

.add-ingredient-form > button::before {
  content: "+";
  margin-right: 5px;
}

ul.ingredients-list {
  margin-bottom: 48px;
}

.get-recipe-container button {
  border: none;
  border-radius: 6px;
  background: #d17557;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
  color: #fafaf8;
  padding: 9px 17px;
  font-family: Inter, sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 120px;
}

.get-recipe-container button:hover {
  background: #d17557b9;
  padding: 9px 20px;
}

.get-recipe-container button {
  transition: all 0.2s ease;
}

.suggested-recipe-container {
  color: #475467;
  line-height: 1.7;
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 60px;
  padding-bottom: 30px;
  border-bottom: 2px solid #e5e7eb;
  width: 70%;
  margin: 2em auto;
}

.suggested-recipe-container ul li,
.suggested-recipe-container ol li {
  margin-bottom: 8px;
}

.ingredients-section {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
}

.ingredients-section > h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.ingredients-column > h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.ingredients-section.with-recipe {
  flex-direction: row;
  gap: 40px;
  align-items: flex-start;
  max-width: 80%;
  margin: 40px auto;
}

.ingredients-column {
  flex: 1;
  width: 60%;
  margin: 0 auto;
}

.ingredients-section.with-recipe .ingredients-column {
  min-width: 50%;
}

.get-recipe-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border-radius: 8px;
  background: #f0efeb;
  padding: 20px 28px;
  margin-top: 20px;
  height: 100%;
  width: 100%;
  min-width: 260px;
}

.get-recipe-container h3 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 24px;
  margin-top: 0;
}

.get-recipe-container p {
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 20px;
  margin-bottom: 20px;
}

.get-recipe-container button {
  align-self: flex-start;
}

@media (max-width: 768px) {
  .ingredients-section.with-recipe {
    flex-direction: column;
    gap: 30px;
  }
}

ul.ingredients-list > li {
  color: #475467;
  line-height: 28px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

ul.ingredients-list > li:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

.add-ingredients-prompt {
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  margin: 20px 0;
}

.prompt-text {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0 0 20px 0;
}

.add-more-text {
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  margin: 16px 0;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 24px 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.dot.empty {
  background-color: #e5e7eb;
}

.dot.filled {
  background-color: #d17557;
}

.add-ingredients-placeholder {
  color: #9ca3af;
  font-style: italic;
  padding: 30px 0;
  text-align: center;
}

.clear-all-btn {
  background: none;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: Inter, sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.clear-all-btn:hover {
  border-color: #9ca3af;
  color: #475467;
}

.clear-all-btn:active {
  animation: buttonClick 0.3s ease;
}

svg {
  width: 54px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes buttonClick {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.get-recipe-container button {
  transition: all 0.2s ease;
}

.get-recipe-container button:active:not(:disabled) {
  animation: buttonClick 0.3s ease;
}

.loading-btn {
  opacity: 0.8;
  cursor: not-allowed !important;
  position: relative;
}

.loading-btn::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid #fafaf8;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

/* Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  padding: 20px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  margin: auto auto;
  width: 100%;
}

.start-prompt {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  margin-top: 100px;
  gap: 0px;
}

.start-prompt img {
  height: 250px;
  width: 250px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
}

.instructions-heading {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #111111;
  text-align: left;
}

.instructions-section {
  flex: 1;
  max-width: 250px;
  margin-right: 4em;
  min-width: 150px;
}

.instructions-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
  font-size: 14px;
  color: #333333;
}

.instructions-list li {
  margin-bottom: 8px;
}

.lightsite {
  position: absolute;
  right: 20px;
  background-color: #141413;
  color: #fafaf8;
  border: none;
  border-radius: 6px;
  padding: 9px 17px;
  font-family: Inter, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.lightsite:hover {
  background-color: #1f1f1eb9;
  font-weight: 800;
}

.lightsite::before {
  content: "Back?";
}

@media screen and (max-width: 528px) {
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 11px;
    height: 76px;
    background-color: white;
    box-shadow:
      0px 1px 3px 0px rgba(0, 0, 0, 0.1),
      0px 1px 2px 0px rgba(0, 0, 0, 0.06);

    padding: 0 20px;
  }
  header div > h1 {
    font-size: 1.25rem;
  }
  .start-prompt img {
    height: 160px;
    width: 160px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
  }
  .start-prompt {
    margin-top: 120px;
    min-width: 0;
  }

  .add-ingredient-form > button::after {
    content: "";
  }

  .add-ingredient-form > button {
    padding: 9px 5px;
    max-width: 40px;
    padding-left: 10px;
    text-align: center;
    padding-right: 10px;
  }

  .add-ingredient-form {
    height: auto; /* height to adapt */
    gap: 8px;
    width: 60%;
    margin: 2em auto;
  }

  .add-ingredient-form > input {
    width: 100%;
  }

  .add-ingredient-form > button {
    width: 100%;
    min-width: 0;
  }

  .app-container {
    margin-top: -20px;
  }
}

@media (max-width: 400px) {
  .lightsite::before {
    content: ">";
  }

  .lightsite {
    padding: 9px 14px;
  }

  header {
    padding: 0 14px;
    height: 50px;
  }

  svg {
    width: 40px;
  }

  header div > h1 {
    font-size: 1rem;
  }

  .start-prompt img {
    display: none;
  }

  .app-container {
    padding-left: 3em;
    margin-top: -40px;
  }

  .instructions-heading {
    width: 190px;
  }

  .get-recipe-container {
    min-width: 0;
    max-width: 200px;
  }
}

@media screen and (max-width: 280px) {
  header div > h1 {
    display: none;
  }

  .instructions-heading {
    width: 90px;
  }

  .get-recipe-container {
    min-width: 0;
    max-width: 170px;
  }

  .app-container {
    margin-top: -40px;
  }
}

.suggested-recipe-container h1 {
  font-size: clamp(17px, 3vw + 8px, 28px);
}

.suggested-recipe-container h2 {
  font-size: clamp(11px, 3vw + 8px, 26px);
}

.suggested-recipe-container p {
  font-size: clamp(17px, 2vw + 6px, 18px);
}
