@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #108bff 100%);
  background-size: 400% 400%;
  /* animation: gradientShift 15s ease infinite; */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 20px;
}

/* animate the position, so the browser has to recalculate &
repaint every single pixel on users' screen 60 timesper second (60fps) LOL*/
/* @keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
} */

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

.title a {
  text-decoration: none;
  color: crimson;
}

.title a:hover {
  text-decoration: underline;
}

.quiz-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 600px;
  max-width: 95%;
  overflow: hidden;
  position: relative;
}

.quiz-header {
  padding: 3.5rem;
  margin-top: -50px;
}

.quiz-header h2 {
  text-align: center;
  margin: 5px 0;
  padding: 25px;
  color: white;
  border-radius: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.quiz-header ul {
  margin: 40px 0 -20px 0;
}

h2 {
  text-align: center;
}

ul {
  list-style-type: none;
  padding: 0;
}

ul li {
  font-size: 1.2rem;
  margin: 1rem 0;
}

ul li:last-child {
  margin-bottom: 50px;
}

ul li input,
label {
  cursor: pointer;
}

[type="radio"] {
  height: 10px;
  width: 10px;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  display: block;
  width: 100%;
  cursor: pointer;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 500;
  padding: 1.3rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button:active {
  transform: translateY(0);
}

button:focus {
  outline: none;
}

/* Welcome Screen Styles */
.welcome-screen {
  padding: 3rem 3rem 2rem;
  text-align: center;
  position: relative;
  min-height: 480px;
}

.welcome-screen a {
  text-decoration: none;
  background: linear-gradient(135deg, crimson, #ff375f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  position: relative;
  transition: all 0.3s ease;
}

.welcome-screen a::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(135deg, crimson, #ff375f);
  bottom: -2px;
  left: 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.welcome-screen a:hover::before {
  transform: scaleX(1);
}

.welcome-title {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 3.5rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
}

.form-step {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 6rem);
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.form-step.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}

.form-step.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

.form-step label {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #333;
}

.form-step input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  font-size: 1.1rem;
  border: 2px solid #e0e7ff;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #f8f9ff;
}

.form-step input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background-color: #fff;
}

/* Remove Arrows/Spinners for Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quiz-type-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.quiz-type-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 1.2rem;
  font-size: 1.2rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.quiz-type-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #764ba22a 0%, #f193fb32 100%);
  transition: left 0.3s ease;
}

.quiz-type-btn:hover::before {
  left: 0;
}

.quiz-type-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.quiz-type-btn span {
  position: relative;
  z-index: 1;
}

/* Quiz Screen Styles */
.quiz-screen {
  animation: fadeIn 0.5s ease-in;
}

.student-info {
  text-align: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #e0e7ff 0%, #f8f9ff 100%);
  border-radius: 15px;
  margin-bottom: 1.5rem;
  color: #333;
  border: 2px solid #e0e7ff;
}

.student-info p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Results Screen Styles */
.results-screen {
  padding: 3rem;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

.results-screen h2 {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.score-fraction {
  font-size: 1.3rem;
  color: #555;
  font-weight: 500;
}

.percentage-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 3rem;
  font-weight: 700;
  padding: 1.5rem 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  animation: scaleIn 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.percentage-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes scaleIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shine {
  0% {
    left: -50%;
  }
  100% {
    left: 150%;
  }
}

.results-screen p {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: #444;
  font-weight: 400;
}

#playAgainBtn {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  width: auto;
  display: inline-block;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

#playAgainBtn:hover {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media only screen and (max-width: 600px) {
  body {
    padding: 10px;
  }

  .quiz-container {
    width: 100%;
    border-radius: 15px;
  }

  .welcome-screen {
    padding: 2rem 1.5rem;
    min-height: 420px;
  }

  .welcome-title {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
  }

  .form-step {
    width: calc(100% - 3rem);
    top: 130px;
  }

  .form-step label {
    font-size: 1.1rem;
  }

  .form-step input {
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }

  ul li:last-child {
    margin-bottom: 25px;
  }

  .quiz-header {
    padding: 2rem 1.5rem;
  }

  .quiz-header h2 {
    padding: 1rem;
    font-size: 1.1rem;
  }

  .quiz-header ul {
    margin: 30px 0 10px 0;
  }

  ul li {
    font-size: 0.95rem;
    margin: 0.7rem 0;
  }

  .student-info p {
    font-size: 0.9rem;
  }

  .results-screen {
    padding: 2rem 1.5rem;
  }

  .results-screen h2 {
    font-size: 1.5rem;
  }

  .percentage-badge {
    font-size: 2.2rem;
    padding: 1rem 2rem;
  }

  .score-fraction {
    font-size: 1.1rem;
  }

  .results-screen p {
    font-size: 1rem;
  }

  .quiz-type-btn {
    font-size: 1.05rem;
    padding: 1rem;
  }

  button {
    font-size: 1rem;
    padding: 1.1rem;
  }
}
