body {
  display: flex;
  justify-content: center;
  align-items: start; /* changed from center so content aligns from top */
  margin: 0;
  padding: 20px;
  font-family: "Times New Roman", Times, serif;
  font-size: 24px;
  background-color: #ffffff;
  flex-direction: column; /* important for stacking */
  min-height: 100vh;
}
div {
  margin: 30px;
  text-align: center;
}

.Instructions {
  position: relative; /* was absolute */
  top: auto; /* remove top: 50% */
  left: auto; /* remove left: 50% */
  transform: none; /* remove transform */
  max-width: 800px;
  margin: 40px auto; /* center horizontally with margin */
  text-align: left;
  font-size: 18px;
  line-height: 1.7;
  background-color: #fdfdfd;
  padding: 30px;
  border: 2px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.Instructions p {
  margin-bottom: 25px;
  line-height: 1.6;
}
.Instructions .button-next {
  display: block;
  margin: 40px auto 0 auto;
}

#rating1_inst,
#rating2_inst,
#rating3_inst,
#reading_inst,
#explain_inst,
#SelfRead_inst,
#math_distractor_inst,
#FinalTest_inst {
  display: none;
}

.button-next {
  background-color: #2666fd;
  border: 1px solid black;
  color: White;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 4px;
}

.button-next:hover {
  background-color: #0036b3;
}
.Time_prompt {
  font-weight: normal;
  font-size: 18px;
  text-align: justify;
  background-color: #f3f3f3;
  padding: 20px;
  width: 800px;
  border: 2px solid #ccc;
  margin: 0 auto 30px auto;
  border-radius: 8px;
  display: none;
}
.Rating_Prompt {
  font-weight: normal;
  font-size: 18px;
  text-align: justify;
  background-color: #f3f3f3;
  padding: 20px;
  width: 800px;
  border: 2px solid #ccc;
  margin: 0 auto 30px auto; /* center and space from list */
  border-radius: 8px;
  visibility: hidden;
}

.Ratingquestion {
  margin-bottom: 40px;
  text-align: left;
  font-family: "Times New Roman", Times, serif;
  font-weight: normal;
  font-size: 18px;
  background-color: #e5e5e5;
  padding: 20px;
  border: 2px solid #ccc;
  width: 800px;
  margin-left: auto; /* Add this to center */
  margin-right: auto; /* Add this to center */
}

.Ratingquestion h3 {
  margin-bottom: 10px;
  font-weight: normal;
  text-align: center;
}

.RatingAnswer {
  padding: 0;
  /* Remove default padding */
}

.Ratingbox {
  width: 80px;
  height: 30px;
  padding: 0 10px; /* Horizontal padding only */
  font-size: 12pt;
  font-family: "Times New Roman", Times, serif;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  white-space: nowrap;
  resize: none;
  line-height: 28px; /* Set line-height close to height minus borders */
  vertical-align: middle; /* Helps with vertical alignment */
}

#Rating {
  display: none; /* This hides the element but keeps its space */
}

#Stories {
  display: block;
  width: 100%;
  padding-top: 20px;
  text-align: justify !important;
}

#ShortTest {
  display: none;
}

.sa-timer {
  font-size: 36px;
  font-weight: normal;
  border-radius: 10px;
  color: #000000;
  text-align: center;
  margin: 10px auto 20px auto;
  border: solid 3px black;
  padding: 10px 20px;
  display: none;
}
.SAquestion {
  margin: 40px auto;
  text-align: left;
  font-family: "Times New Roman", Times, serif;
  font-weight: normal;
  font-size: 18px;
  background-color: #e5e5e5;
  padding: 20px;
  border: 2px solid #ccc;
  width: 800px;
}

.SAquestion h3 {
  margin-bottom: 10px;
  font-weight: normal;
}

.shortanswer {
  padding: 0;
  /* Remove default padding */
}

.SAbox {
  width: 100%;
  /* Make the textarea full width */
  padding: 10px;
  height: 200px;
  font-size: 12pt;
  font-family: "Times New Roman", Times, serif;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: auto;
  /* Add scrollbars if needed */
  resize: vertical;
  /* Allow vertical resizing */
  white-space: pre-wrap;
  /* Preserve whitespace and wrap text */
  word-wrap: break-word;
  /* Break long words if needed */
}

.SA_Prompt {
  font-weight: normal;
  font-size: 18px;
  width: 800px;
  text-align: justify;
  margin: 0 auto 30px auto;
  padding: 20px;
  background-color: #f3f3f3;
  border: 2px solid #ccc;
  display: none; /* Hidden by default, shown in JS */
}

/*story CSS*/
.story {
  width: 300px;
  height: 120px;
  position: absolute;
  font-size: 24px;
  font-weight: bold;
  border-radius: 20px;
  background: #e0e0e0;
  color: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  cursor: pointer;
}

.story:hover {
  background: #a4a4a4;
}
#story1 {
  top: 5%;
  left: 25%;
}
#story2 {
  top: 5%;
  left: 65%;
}

#story3 {
  top: 23%;
  left: 25%;
}
#story4 {
  top: 23%;
  left: 65%;
}

#story5 {
  top: 41%;
  left: 25%;
}
#story6 {
  top: 41%;
  left: 65%;
}

#story7 {
  top: 59%;
  left: 25%;
}
#story8 {
  top: 59%;
  left: 65%;
}

#story9 {
  top: 77%;
  left: 25%;
}
#story10 {
  top: 77%;
  left: 65%;
}

.timer {
  position: absolute;
  width: 250px;
  height: 80px;
  background: white;
  border-radius: 10px;
  top: 5%;
  left: 5%;
  font-size: 40px;
  font-weight: bold;
  display: flex;
  text-align: center;
  justify-content: center; /* Center horizontally */
  align-items: center;
  border: solid 8px black;
  visibility: hidden;
}
.dialog {
  max-width: 1100px;
  height: 900px;
}
.dialog::backdrop {
  background-color: hsla(0, 0%, 73%, 0);
}
.dialog h1 {
  text-align: center;
}
.dialog p {
  text-align: justify;
  font-size: 20px;
}
.dialogButton {
  display: block;
  margin: 0 auto; /* Centers button horizontally */
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
}

.order_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 20px auto;
  display: none;
}

.sortable-list {
  list-style: none;
  padding: 20px;
  width: 800px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 10px;
  border: 2px solid #ccc;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.sortable-item {
  padding: 15px 20px;
  margin-bottom: 12px;
  background: #f9f9f9;
  border-radius: 8px;
  font-size: 16px;
  font-family: "Times New Roman", Times, serif;
  color: #333;
  font-weight: normal;
  cursor: grab;
  border: 1px solid #ddd;
  transition: background 0.2s, transform 0.2s;
}

.sortable-item:hover {
  background: #e8f0ff;
  transform: scale(1.03);
}

.dragging {
  opacity: 0.7;
  transform: rotate(-2deg);
}

.over {
  border: 2px dashed #ff8c42;
  background: #fff3e0;
}

.Order_prompt {
  font-weight: normal;
  font-size: 18px;
  text-align: justify;
  background-color: #f3f3f3;
  padding: 20px;
  width: 800px;
  border: 2px solid #ccc;
  margin: 0 auto 30px auto; /* center and space from list */
  border-radius: 8px;
}

.multiquestion {
  width: 800px;
  margin: 40px auto;
  background-color: #fdfdfd;
  padding: 25px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.6;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  text-align: left;
}

.multiquestion h3 {
  margin-bottom: 15px;
  text-align: left;
  font-weight: bold;
}

.multichoices {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.multichoices li {
  margin-bottom: 10px;
}

.choice-btn {
  background: rgb(249, 249, 249);
  border: 2px solid #d8d8d8;
  border-radius: 6px;
  padding: 10px 15px;
  font-size: 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: "Times New Roman", Times, serif;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.choice-btn:hover {
  background-color: #d1d1d1;
  border-color: #007bff;
}

.choice-btn.selected {
  background-color: #007bff;
  color: rgb(255, 255, 255);
  font-weight: bold;
  border-color: #0056b3;
}

#exam {
  display: none; /* initial hidden state */
  width: 100%;
  margin: 0 auto;
  padding-top: 0;
  text-align: center;
}

.consentForm {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto;
  font-size: 18px;
  line-height: 1.6;
  background-color: #fdfdfd;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: justify;
}

.consent-title {
  text-align: center;
  font-size: 25px;
}

.buttonConsentClass {
  text-align: center;
  margin-top: 20px;
}

.buttonConsent {
  padding: 15px 30px;
  font-size: 18px;
  background-color: #007bff;
  color: white;
  border: black solid 1px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.buttonConsent:hover {
  background-color: #0056b3;
}

#time-counter {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
  color: limegreen;
}

#Rating,
#ShortTest {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto; /* center block-level container */
}

.StoryCard {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto;
  font-size: 20px;
  line-height: 1.8;
  background-color: #fdfdfd;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  text-align: justify;
}

.StoryCard h2 {
  text-align: center;
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 20px;
}

.StoryCard .story-text {
  font-size: 20px;
  white-space: pre-wrap;
  margin-top: 20px;
  text-align: justify;
}

.StoryCard button.button-next {
  display: block;
  margin: 30px auto 0 auto;
}

.demo-form-container {
  background-color: #f8f8f8;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 25px;
  width: 500px;
  margin: 50px auto;
  font-family: Arial, sans-serif;
  font-size: 16px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.demo-form-container h2 {
  text-align: center;
  margin-bottom: 20px;
}

.demo-form-container label {
  margin-top: 10px;
  font-weight: bold;
}

.demo-form-container input,
.demo-form-container select,
.demo-form-container textarea {
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #aaa;
  border-radius: 5px;
  width: 100%;
  box-sizing: border-box;
}

.demo-submit-btn {
  background-color: #2666fd;
  border: 1px solid black;
  color: White;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 4px;
}

.demo-submit-btn:hover {
  background-color: #0036b3;
}

#credit-screen {
  text-align: center;
  font-family: Arial, sans-serif;
  margin-top: 50px;
}

#final-demo-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  max-height: 100vh;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 999;
  overflow-y: auto; /* <-- enable scrolling */
  padding: 20px 0;
}

#demo-prompt-box {
  background-color: #fffbcc;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  width: 520px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
#postStudyFormContainer {
  width: 800px;
  margin: 40px auto;
  background-color: #f9f9fb;
  padding: 30px;
  border: 2px solid #c0c0c0;
  border-radius: 12px;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.7;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  text-align: left;
}

#postStudyFormContainer h3 {
  margin-bottom: 12px;
  font-weight: normal;
  color: #2a2a2a;
}

#postStudyFormContainer select,
#postStudyFormContainer textarea,
#postStudyFormContainer input[type="text"] {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 20px;
  padding: 10px;
  font-size: 16px;
  font-family: "Times New Roman", Times, serif;
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  box-sizing: border-box;
}

#postStudyFormContainer textarea {
  resize: vertical;
  min-height: 80px;
}

#postStudyFormContainer .button-next {
  display: block;
  margin: 30px auto 0 auto;
  padding: 12px 25px;
  font-size: 16px;
  border-radius: 6px;
}

#attention-check {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fffdfa;
  border: 4px solid #333;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  padding: 50px;
  border-radius: 12px;
  z-index: 1000;
  display: none;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

#attention-check {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fffdfa;
  border: 4px solid #333;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  padding: 50px;
  border-radius: 12px;
  z-index: 1000;
  display: none;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.attention-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.attention-btn {
  padding: 15px 30px;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.attention-orange {
  background-color: #ff9f00;
  color: white;
}

.attention-orange:hover {
  background-color: #e08900;
}

.attention-blue {
  background-color: #007bff;
  color: white;
}

.attention-blue:hover {
  background-color: #005dcf;
}

.attention-green {
  background-color: #28a745;
  color: white;
}

.attention-green:hover {
  background-color: #218838;
}

.attention-red {
  background-color: #dc3545;
  color: white;
}

.attention-red:hover {
  background-color: #b52a36;
}
#math_wrapper {
  display: none;
  width: 100%;
  text-align: center;
  margin-top: 40px;
}

#math_distractor {
  text-align: center;
}

@media (max-width: 1600px) {
  .dialog {
    max-width: 1000px;
    height: 800px;
  }
  .timer {
    width: 150px;
    height: 80px;
    font-size: 40px;
    left: 3%;
  }
}
