body {
  background: #F1F0E9;
  font-family: "Roboto Mono", monospace;
  font-optical-sizing: auto;
  font-style: normal;

}
h1, h2 {
  text-align: center;
}
.steps {
  display: flex;
  flex-direction: column;
  margin: 3rem;
  align-items: center;
  justify-content: center;
}
.step {
  display: flex;
  justify-content: center;
  padding: 15px;
  margin: 10px;
  border: 2px solid #0D4715;
  font-size: 1.2em;
  transition: background-color 0.3s ease-in-out;
  background-color: #41644A;
  text-align: center;
  display: flex;
  width: 80%;
  height: auto;
  color: #F1F0E9;
  border-radius: .5rem;
}

.active {
  background-color: #16C47F;
  color: black;
}

/* Define unique colors for different event loop stages */
.microtask {
  background-color: #16C47F !important;
}
.callstack {
  background-color: gold !important;
}
.pending-promise {
  background-color: #EB5353 !important;
}
.task {
  background-color: orange !important;
}



#currentTask {
  font-size: 1.5em;
  padding: 2rem;
  background-color: #E9762B;
  border: 2px solid #0D4715;
  border-radius: .5rem;
  width: 20rem;
  height: 10rem;
  text-align: center;
}

.loopSteps {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem;
  border: 2px solid #0D4715;
  background-color: #f4f4f4;
  font-size: 1.2em;
  border-radius: 1rem;
  min-height: 3rem;
  max-width: 90%;
  overflow-x: auto;  /* Prevents breaking layout */
  word-wrap: break-word;
}


.stackContainer {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

button {
  margin: auto;
  background-color: #E9762B;
  border-radius: 1rem;
  padding: 1rem;
  color: #f4f4f4;
  border: #0D4715 2px solid;
}
button:hover{
  background-color: #2ebe52ae;
}

.bttnContainer {
  display: flex;
  margin-top: 4rem;
  align-items: center;
  justify-content: center;
}

.currentContainer,
.visualizer {
  max-width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 3rem;
}
.currentContainer{
  display: flex;
  justify-content: center;
  align-items: center;
}

nav {
  overflow: hidden;
  background-color: #41644A;
  padding: 0;
  margin: 0;
  border-radius: 1rem;
  padding-bottom: 1rem;
}
ul {
  list-style-type: none;
}
nav a {
  float: left;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

nav a:hover {
  background-color: #2ebe52ae;
  color: black;
  border-radius: 1rem;
}

nav a.active {
  background-color: #E9762B;
  color: white;
  border-radius: 1rem;
}
@media (max-width: 768px) {
  .visualizer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%; /* Ensures it doesn’t break layout */
  }

  .loopSteps {
    width: 100%;
  }
}
@media (max-width: 960px) {
  .stackContainer{
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}