/* Base styles */
body {
  background-color: #1e1e1e;
  color: #cfcfcf;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

h1 {
  color: #ffffff;
  font-size: 2em;
  margin-bottom: 20px;
}

.number-selection p {
  margin-bottom: 10px;
  font-size: 1.2em;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.number {
  background-color: #333;
  border: 2px solid #555;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  font-size: 1.2em;
  height: 50px;
  line-height: 50px;
  width: 50px;
  text-align: center;
  transition: background-color 0.3s, border-color 0.3s;
}

.number:hover {
  background-color: #444;
}

.number.selected {
  border-color: #00bfff;
}

#start-test {
  background-color: #00bfff;
  border: none;
  border-radius: 5px;
  color: #1e1e1e;
  cursor: pointer;
  font-size: 1.2em;
  margin-top: 20px;
  padding: 10px 20px;
  transition: background-color 0.3s;
}

#start-test:hover {
  background-color: #009acd;
}

#timer {
  margin-top: 20px;
  font-size: 1.2em;
}

#test-area {
  margin-top: 30px;
}

#question-area {
  font-size: 2em;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#answer-input {
  font-size: 1.5em;
  padding: 10px;
  width: 150px;
  text-align: center;
}

#submit-answer {
  background-color: #00bfff;
  border: none;
  border-radius: 5px;
  color: #1e1e1e;
  cursor: pointer;
  font-size: 1.2em;
  padding: 10px 20px;
  transition: background-color 0.3s;
}

#submit-answer:hover {
  background-color: #009acd;
}

#error-message {
  color: #ff0000;
  margin-top: 10px;
  font-size: 1em;
}

.hidden {
  display: none;
}

#result-area {
  margin-top: 30px;
  text-align: center;
}

.result-item {
  font-size: 1.2em;
  margin-bottom: 10px;
}

.final-grade {
  font-size: 1.5em;
  margin-top: 20px;
}

/* Style for the correct and incorrect symbols */
.correct {
  color: #00ff00; /* Green color for correct answers */
  font-weight: bold;
}

.incorrect {
  color: #ff0000; /* Red color for incorrect answers */
  font-weight: bold;
}

/* Styles for the tables */
.result-table, .summary-table, .legend-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 1em;
}

.result-table th, .result-table td,
.summary-table td, .legend-table th, .legend-table td {
  border: 1px solid #555;
  padding: 10px;
  text-align: center;
}

.result-table th, .legend-table th {
  background-color: #333;
  color: #fff;
}

.summary-table td {
  background-color: #2a2a2a;
  color: #fff;
}

.summary-table td:first-child {
  text-align: right;
  width: 60%;
  font-weight: bold;
}

.summary-table td:last-child {
  text-align: left;
  width: 40%;
}

.legend-table td {
  background-color: #2e2e2e;
  color: #fff;
}

/* Row colors for better readability */
.result-table tr:nth-child(even),
.summary-table tr:nth-child(even),
.legend-table tr:nth-child(even) {
  background-color: #2e2e2e;
}

.result-table tr:hover {
  background-color: #3e3e3e;
}

/* Style for the "Retake Test" button */
#retake-test {
  background-color: #00bfff;
  border: none;
  border-radius: 5px;
  color: #1e1e1e;
  cursor: pointer;
  font-size: 1.2em;
  margin-top: 20px;
  padding: 10px 20px;
  transition: background-color 0.3s;
}

#retake-test:hover {
  background-color: #009acd;
}

/* Responsive Design */
@media (max-width: 600px) {
  .number {
      font-size: 1em;
      height: 40px;
      line-height: 40px;
      width: 40px;
  }

  #start-test, #submit-answer {
      font-size: 1em;
      padding: 8px 16px;
  }

  #answer-input {
      font-size: 1.2em;
      width: 120px;
  }

  h1 {
      font-size: 1.5em;
  }

  #question-area {
      font-size: 1.5em;
  }

  .input-group {
      flex-direction: column;
      gap: 10px;
  }

  .result-table, .summary-table, .legend-table {
      font-size: 0.9em;
  }

  .container {
      padding: 10px;
  }
}

#correct-answer-display {
  font-size: 2em;
  margin-top: 10px;
  color: #fdfd43e0;
  min-height: 30px; /* Ensure space is reserved */
  top: 50px; /* Adjust as needed */
  right: 10px; /* Adjust as needed */
  border-radius: 5px;
}

/* Flash effect for the correct answer */
.flash-correct-answer {
  animation: flash-correct-answer 2s;
}

@keyframes flash-correct-answer {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.user-info {
  margin-bottom: 20px;
  margin-top: 20px;
}

.user-info label {
  margin-right: 10px;
}

.user-info input {
  padding: 5px;
  font-size: 1em;
}