body {
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  display: flex;
  justify-content: center;
  align-items: center;
  /* height: 50vh; */
}

.quiz-container {
  background: #fff;
  margin:50px;
  padding: 20px 3px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  width: 80em;
  height : 40em;
  margin: 0;
}

h1 {
  text-align: center;
  color: #333;
}

.question-palette {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
  /* margin-bottom: 15px; */
}

.palette-item {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  cursor: pointer;
  border: 1px solid #ccc;
}

.palette-item.not-visited {
  background: #ccc;
}

.palette-item.visited {
  background: #2196F3;
  color: #fff;
}

.palette-item.answered {
  background: #4CAF50;
  color: #fff;
}

.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 20px;
}
.legend-item-group {
  display: flex;
  align-items: center; 
  gap: 0.4rem; 
  min-width: 3rem;
  /* padding-left: 0.5rem; */
}


.legend-item {
  display: flex;
  align-items: center;
  /* gap:0.5rem; */
  width: 0.5rem;
  height:0.5rem;
  border-radius: 50%;
}
/* .legend-text {
    word-wrap: break-word; 
    /* text-align: left; */
/* } */ 
.legend-item.not-visited {
  background: #ccc;
}

.legend-item.visited {
  background: #2196F3;
}

.legend-item.answered {
  background: #4CAF50;
}
.legend-item.visited-not-answered {
  background: #ca62dc; 
}

.question-box {
  width: 50%;
  margin: 0 auto 20px;
  text-align: left;
}
.navigation-buttons {
  display: flex;
  justify-content:space-between;
  width: 50%;
  /* margin: 0 auto; */
  margin: 20px auto 0;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
}

button {
  flex: 1 1 45%;
  max-width: 200px;
  min-width: 100px;
  text-align: center;
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#result {
  text-align: center;
  font-weight: bold;
  margin-top: 20px;
}

#options-container label {
  display: block;          
  margin: 10px 0;          
  padding: 10px;           
  border: 1px solid #ccc;  
  border-radius: 5px;     
  cursor: pointer;         
  background-color: #f9f9f9; 
  transition: background-color 0.2s ease;
}
#options-container label:hover {
  background-color: #e0f0ff; 
}

/* Style the radio buttons */
#options-container input[type="radio"] {
  margin-right: 10px; 
}
.palette-item.current-question {
  border: 3px double #000; 
  background: #7eb3df; 
  color: #fff;
}

.palette-item.not-visited {
  background: #ccc;
}

.palette-item.visited {
  background: #7eb3df; 
  color: #fff;
}

.palette-item.answered {
  background: #85c587; 
  color: #fff;
}
.palette-item.visited-not-answered {
  background: #ca62dc; 
  color: #fff;
}
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  width: 90%;
  margin: 20px auto 0;
  position: relative;
}

#prev-btn {
  /* background: #68bade; */
  background: #2196F3;
  color: #fff;
  position: absolute;
  left: 0;
  bottom: 0;
}

#next-btn {
  background: #2196F3;
  color: #fff;
  position: absolute;
  left: 0;
  top:50px;
  padding: 10px 20px;
  margin-left: 40px;
  /* bottom: 0; */
}
#submit-btn {
  background: #2196F3;
  color: #fff;
  position: absolute;
  right: 0;
  top:50px;
  /* bottom: 0; */
  background: #4CAF50;
  color: #fff;
  padding: 10px 20px;
  margin-right: 40px;
}

/* #submit-btn {
  display: block;
  margin: 60px auto 0;
  background: #4CAF50;
  color: #fff;
  padding: 10px 20px;
} */
button:disabled {
  background: #888 !important; 
  color: black !important;         
  cursor: not-allowed;            
  opacity: 0.4;                   
}
/* Modal container */
.modal {
  display: none; 
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5); 
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* Modal content */
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 40%;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: slideDown 0.4s;
}

@keyframes slideDown {
  from {transform: translateY(-50px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}

/* Close button */
.close {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #000;
}

/* Emoji and Text */
.modal-emoji {
  font-size: 50px;
  margin-bottom: 10px;
}

.modal-text {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 5px;
}

.modal-message {
  font-size: 18px;
  color: #666;
}
#timer {
  font-size: 1.2rem;
  /* text-align: end; */
  /* margin-bottom: 6rem; */
  color: #e53935; 
  text-align: right;
  margin-left: auto;
  position: absolute;
  padding-right: 1.5rem;
  right: 7rem;
}
.palette-item.time-expired {
  background: #e53935; 
  color: #fff;
  
}
#palette-time{
    display: flex;
    flex-direction: row;
    gap:2rem;
    align-items: center;
    justify-content:center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    position: relative;
    /* padding-left: 33rem; */
}
@media (max-width: 600px) {
  .navigation-buttons {
    flex-direction: column; 
    align-items: center;
  }
  .navigation-buttons button {
    width: 20%; 
  }
}

@media (max-width: 768px) {
  #palette-time {
    flex-direction: column; 
    /* align-items: center;    */
  }
  
  #timer {
    margin: 1rem 0 5rem 0; 
    text-align: center;
    /* padding: 1rem 0 1rem 0; */
    /* right: 0rem; */
  }
  .question-box {
  width: 90%;
  margin: auto ;
  /* text-align: left; */
  font-size: small;
  }
   h2{
    font-size: 1rem;
   }
}
@media (max-width: 768px) {
  .legend {
    flex-direction: row;
    flex-wrap: wrap; 
    gap: 0.5rem 1rem;
    /* gap: 1rem 3rem;  */
    /* text-align: center; */
    justify-content: center;
  }
  
  .legend-item {
    margin: 5px;
  }
  .legend-item-group {
    flex: 1 1 45%; /* each group takes 45% width */
    min-width: unset;
    justify-content: flex-start; /* align text nicely */
  }
  .legend-item-group:nth-child(1),
  .legend-item-group:nth-child(3) {
    margin-left: 1rem;
  }
}