/* Import Google Font once at the top */
@import url("https://fonts.googleapis.com/css2?family=Luckiest+Guy&display=swap");

body {
  background: linear-gradient(to right, #6a0dad, #e75480);
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Container for quiz questions */
.questionsContainer {
  background-color: #2e004f;
  width: 90vw; /* Full width on mobile */
  max-width: 600px; /* Max width on bigger screens */
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 100px auto 50px; /* Vertical margin reduced for mobiles */
  border-radius: 20px;
  border: 3px solid rgba(231, 84, 128, 0.6);
  box-shadow: 0 0 12px 4px rgba(231, 84, 128, 0.7);
  padding: 20px;
  box-sizing: border-box;
}

/* Answers grid container */
.answersContainer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 20px 0;
}

/* Question text styling */
.question-text {
  font-size: 1.25rem; /* Responsive font size */
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 1rem;
  line-height: 1.4;
  text-align: center;
}

/* Heading */
h1 {
  font-weight: 500;
  font-size: 2.5rem;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5em;
}

/* Options/buttons */
.options {
  background-color: #e75480;
  color: #ffffff;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.1s ease;
  text-align: center;
  user-select: none;
}

.options:active {
  transform: scale(0.97);
}

/* Question number */
.question-number {
  text-align: right;
  margin-right: 5vw;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 500;
}

/* Correct answer styling */
.correct-answer {
  background-color: #28a745;
  color: #ffffff;
  position: relative;
  padding-left: 36px;
  transition: background-color 0.3s ease;
}

.correct-answer::before {
  content: "✔";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

/* Wrong answer styling */
.wrong-answer {
  background-color: #dc3545;
  color: #ffffff;
  position: relative;
  padding-left: 36px;
  transition: background-color 0.3s ease;
}

.wrong-answer::before {
  content: "✖";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

/* Quiz completion box */
.quizComplete {
  background: radial-gradient(circle at top left, #2e003e, #000000 70%);
  width: 90vw; /* Full width on mobile */
  max-width: 400px; /* Max width for bigger screens */
  min-height: 60vh;
  margin: 100px auto;
  padding: 30px 20px;
  border-radius: 20px;
  border: 3px solid #fff;
  box-shadow: 0 0 20px 6px rgba(255, 0, 128, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-family: "Luckiest Guy", cursive;
  text-align: center;
  animation: popIn 0.5s ease-out;
}

.restart-button {
  background-color: #e75480;
  color: white;
  padding: 14px 28px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(231, 84, 128, 0.6);
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.restart-button:hover {
  background-color: #fd94b7;
}

.restart-button:active {
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .answersContainer {
    grid-template-columns: 1fr; /* Single column on smaller screens */
    margin: 30px 10px 0;
    gap: 15px;
  }

  .questionsContainer {
    margin: 80px auto 40px;
    min-height: auto;
  }

  h1 {
    font-size: 2rem;
  }

  .question-text,
  .question-number {
    font-size: 1.05rem;
  }

  .options {
    padding: 14px 16px;
    font-size: 1.1rem;
  }
}

@media (max-width: 400px) {
  .quizComplete {
    width: 90vw;
    padding: 20px 15px;
    min-height: 50vh;
  }

  h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 600px) {
  .restart-button {
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 10px;
    width: 90%;
    max-width: 300px;
    display: flex; /* added */
    justify-content: center; /* added */
    align-items: center; /* added */
    margin: 0 auto;
    text-align: center; /* keep it, no harm */
  }
}
