* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}
h1 {
  color:rgb(41, 216, 41) !important;
  font-weight: bold !important;
}
h2 {
  color:rgb(41, 216, 41) !important;
  font-weight: bold !important;
  text-align: center !important;
  margin-top: 2rem !important;
}
p {
  margin: 0 !important;
}
body {
  margin: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

nav,
footer {
  background-color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2vmin;
  font-size: 2vh;
  color: lightslategray;
}

nav a {
  text-decoration: none;
  color: slategray;
  background-color: white;
  padding: 1vmin;
  border-radius: 1vmin;

  &:hover {
    color: gray;
    background-color: lightslategray;
    color: white;
  }
}

nav span {
  font-size: 1.5vmin;
  color: lightslategray;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 5vmin;
  color:black;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  width: 80%;
  margin: 0 auto;
}

form * {
  font-size: 2vmin;
  padding: 1vmin;
  border-radius: 1vmin;
  box-sizing: border-box;
}

form label {
  display: block;
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 0.5rem;
}
input[type="url"] {
  width: 100%;
  max-width: 600px;
  border: 0.3vmin solid black;
  margin: 0 auto;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: auto;
  max-width: 600px;
  border: 0.3vmin solid black;
  margin: 0 auto;
}


button[type="submit"] {          
  margin: 1rem auto 0;   
  font-weight: bold;
  border-radius: 1vmin;
  color: black;
  border: 1px solid black;
  background-color: white;
}


form button[type='submit'] {
  margin: 1rem auto 0;   
  font-weight: bold; 
}


button:hover {
  background-color: lightslategray;
  color: rgb(20, 197, 232);
}
.error-msg {
  color: rgb(223, 116, 116);
}
.meaning-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7rem;
}

.word-block {
  width: 38%;
  padding: 1rem;
  text-align: center;
}

.word-block h2 {
  margin-top: 0;
  color: rgb(41, 216, 41);
}

.created-by {
  font-size: 1rem;
  color: black;
}

.meaning-block {
  width: 100%;
  max-width: 800px;
  text-align: center;
  margin: 1rem;   
}

.meaning-block img {
  width: 300px;
  height: 200px;
  margin: 0 auto;
  display: block;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.word-details-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;

}

/* Home page: search results list */
.search-results {
  list-style: none;
  padding: 0;
  width: 80%;
  max-width: 600px;
  margin: 0 auto;
}

.search-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid lightslategray;
  border-radius: 1vmin;
}

.search-results li a {
  font-size: 1.2rem;
  font-weight: bold;
  color: rgb(20, 197, 232);
  text-decoration: none;
}

.search-results li a:hover {
  text-decoration: underline;
}

.result-meta {
  font-size: 0.9rem;
  color: lightslategray;
}

/* Home page: onboarding + empty state */
.how-it-works,
.empty-state,
.explore {
  width: 80%;
  max-width: 600px;
  margin: 0 auto;
}

.how-it-works a,
.empty-state a,
.explore a {
  color: rgb(20, 197, 232);
  font-weight: bold;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step p {
  text-align: left !important;
  margin: 0 !important;
}

.step-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: rgb(41, 216, 41);
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Interactive onboarding: click steps to clear, then the guide dismisses */
.how-it-works {
  position: relative;
}

.onboard-skip {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 6px;
  background: transparent;
  border: 0;
  font-size: 0.85rem;
  font-weight: bold;
  color: lightslategray;
  cursor: pointer;
}

.onboard-skip:hover {
  background: transparent;
  color: rgb(41, 216, 41);
}

.onboard-hint {
  font-size: 0.9rem;
  color: lightslategray;
}

.steps .step {
  width: 100%;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.15s ease;
}

.steps .step:hover {
  background-color: rgba(41, 216, 41, 0.1);
  color: inherit;
}

.step--done .step-num {
  background-color: rgb(26, 160, 26);
}

.step--gone {
  opacity: 0;
  transform: translateX(24px);
}

.onboard--leaving {
  opacity: 0;
  transition: opacity 0.35s ease;
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
    text-align: center;
  }

  h2 {
    font-size: 1.2rem !important;
    text-align: center;
    margin-top: 1rem !important;
  }

  p,
  .created-by {
    font-size: 0.9rem;
    text-align: center;
  }

  nav,
  footer {
    flex-direction: column;
    text-align: center;
    font-size: 2.5vmin;
    gap: 1rem;
  }

  main {
    margin-top: 3vmin;
    padding: 0 1rem;
  }

  form {
    width: 80%;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select,
  input[type="url"] {
    width: 100%;
    font-size: 1rem;
  }

  .meaning-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .word-block {
    width: 90%;
    padding: 1rem;
  }

  .meaning-block img {
    width: 150px;
    height: 150px;
  }

  .word-details-container {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }

  button[type="submit"] {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
  .responsive-img {
    max-width: 100%;
    height: auto;
  }
}
