/* === Global Page Layout === */
body {
  font-family: "Inter", sans-serif;
  background: #fafafa;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

/* === Main Page Container === */
.main-container {
  width: 100%;
  max-width: 700px;
  padding: 40px 20px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* === Header Section === */
.page-header {
  text-align: center;
  margin-bottom: 25px;
}

.page-header h1 {
  font-size: 1.8rem;
  color: #333;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.page-header em {
  color: #ff7a00;
  font-style: normal;
}

/* === Brain Icon === */
.brain-img {
  width: 55px;
  height: auto;
  display: block;
  margin: 0 auto 12px auto;
  background: transparent;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* === Quiz / Card Container (Intro + Quiz + Results) === */
.quiz-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  padding: 30px;
  text-align: center;
  box-sizing: border-box;
}

/* === Progress Bar === */
.progress {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 5px;
  margin-bottom: 25px;
  overflow: hidden;
}

#progress-bar {
  height: 8px;
  width: 0%;
  background: #ff7a00;
  transition: width 0.3s ease-in-out;
}

/* === Questions === */
.question {
  display: none;
  animation: fade 0.4s ease;
}

.question.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #333;
  line-height: 1.4;
  word-wrap: break-word;
}

/* === Answer Options === */
label {
  display: block;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

label:hover {
  background: #fff5ec;
  border-color: #ff7a00;
}

input[type="radio"] {
  margin-right: 10px;
}

/* === Buttons === */
.next-btn,
a.next-btn,
button.next-btn {
  background-color: #ff7a00;
  color: #fff !important;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 20px;
  display: inline-block;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.1s ease;
}

.next-btn:hover,
a.next-btn:hover,
button.next-btn:hover {
  background-color: #ff9433;
  transform: translateY(-1px);
}

/* === Loading Spinner Animation === */
.loader-brain {
  width: 70px;
  height: 70px;
  display: block;
  margin: 40px auto 25px auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  animation: spinBrain 2.5s linear infinite;
  transform-origin: center center;
}

@keyframes spinBrain {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* === Footer === */
.footer {
  text-align: center;
  margin-top: 60px;
  font-size: 0.9rem;
  color: #777;
}

.footer a {
  color: #ff7a00;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* === Start Button (Intro Page) === */
.start-btn {
  display: inline-block;
  background: #ff7a00 !important;
  color: #fff !important;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none !important;
  font-size: 1.1rem;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-top: 20px;
}

.start-btn:hover {
  background: #ff9433 !important;
  transform: translateY(-2px);
  color: #fff !important;
}

/* === Animated Brain Icon (Intro Page) === */
.brain-img {
  width: 65px;
  height: auto;
  display: block;
  margin: 0 auto 15px auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 122, 0, 0.4));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(255, 122, 0, 0.75));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 122, 0, 0.4));
  }
}

/* === Responsive Fine-Tuning (Mobile) === */
@media (max-width: 600px) {
  .brain-img {
    width: 50px;
    animation: pulseGlow 3s ease-in-out infinite;
  }
}

/* === Subtle Glow / Pulse Animation for Start Button === */
a.start-btn {
  animation: pulseGlowBtn 2.4s ease-in-out infinite;
  box-shadow: 0 0 0 rgba(255, 122, 0, 0.4);
}

@keyframes pulseGlowBtn {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 122, 0, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 122, 0, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 122, 0, 0.4);
  }
}

/* === Personal Learning Formula Section === */
.learning-formula {
  margin-top: 30px;
  text-align: center;
  background: #fffaf4;
  border: 1px solid #ffd5a3;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.learning-formula h3 {
  color: #ff7a00;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.learning-formula p {
  font-size: 1rem;
  color: #333;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* === Chart.js Graph Container === */
canvas#learningChart {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  margin: 0 auto;
  max-width: 400px;
  height: auto !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* === Edge/Browser Compatibility Fix: Start Button === */
a.start-btn {
  display: inline-block !important;
  background-color: #ff7a00 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  padding: 14px 28px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font-size: 1.1rem !important;
  text-align: center !important;
  margin-top: 25px !important;
  transition: background 0.3s ease, transform 0.2s ease;
}

a.start-btn:hover {
  background-color: #ff9433 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* === Animation === */
@keyframes riseUp {
  0% {
    height: 0;
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
