@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

body {
  margin: 0;

  font-family: "Manrope", sans-serif;
  background-color: #ffffff;

  min-height: 100vh;
}

.quiz-container {
  background: #f4f7fb;

  width: 100%;
  max-width: 850px;

  margin: 40px auto;
  padding: 35px;

  border-radius: 20px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  box-sizing: border-box;
}

a {
  display: inline-block;
  margin-bottom: 15px;
}

.version-text {
  margin-bottom: 5px;
  font-size: 0.5rem;
  text-align: right;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.guide-btn {
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  background: #eef2ff;
  color: #111827;
  transition: all 0.2s ease;
}

.guide-btn:hover {
  transform: translateY(-2px);
  background: #dbeafe;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.review-navigation {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}

.review-navigation .button {
  min-width: 180px;
}

.export-actions {
  display: flex;
  gap: 10px;
}

.primary-actions {
  background-color: #2563eb;
  color: white;
  font-weight: 700;
}

.secondary-actions {
  background-color: #e5e7eb;
  color: #111827;
}

.danger-zone {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #444;
}

#clear-errors-btn {
  background-color: #ef4444;
  color: white;
}


h1 {
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -3px;
  margin-bottom: 20px;
}

select {
  height: 40px;  
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 13px;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-right-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

#question-text {
  line-height: 1.5;
  margin-bottom: 25px;
  font-size: 1.6rem;
  font-weight: 600;
}

#question-number {
  display: inline-block;
  padding: 8px 14px;
  background: #d8e7fb;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 15px;
}

#subject-display {
  display: inline-block;
  padding: 8px 14px;
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 10px;
  margin-bottom: 15px;
}

.answer-btn {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 16px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 12px;
  border: 2px solid #ddd;
  background: white;
  transition: all 0.2s ease;
}

.answer-btn:hover {
  border-color: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}


.answer-btn.correct {
  background-color: #ecfdf3;
  color: #166534;
  border-color: #86efac;
}

.answer-btn.wrong {
  background-color: #fff1f2;
  color: #991b1b;
  border-color: #fca5a5;
}

.answer-btn.selected {
  background-color: #dbeafe;
  color: #1f2937;
  border-color: #2563eb;
}

.action-buttons button {
  min-width: 220px;
}


#progress-bar {
  width: 100%;
  height: 25px;
  margin-bottom: 20px;
}

#error-log {
  max-height: 150px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}


.exam-summary h3 {
  margin-top: 20px;
  font-size: 24px;
}

.progress-container {
  width: 100%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  margin: 15px 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #22c55e;
  border-radius: 20px;
  transition: width 0.3s ease;
}


body.dark-mode {
  background-color: #121212;
  color: #f0f0f0;
}

body.dark-mode .quiz-container {
  background-color: #1e1e1e;
  color: #f0f0f0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

body.dark-mode .quiz-card {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border-color: #333;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

body.dark-mode .exam-timer {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border-color: #333;
}

body.dark-mode select {
  background-color: #2a2a2a;
  color: white;
  border: 1px solid #555;
  border-radius: 10px;
}

body.dark-mode button {
  background-color: #333;
  color: white;
}

body.dark-mode .answer-btn {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border-color: #444;
}

body.dark-mode .answer-btn.selected {
  background-color: #1e3a5f;
  color: #ffffff;
  border-color: #3b82f6;
}

body.dark-mode .exam-summary {
  background-color: #222;
  color: white;
}

body.dark-mode .exam-score-value {
  color: #f9fafb;
}

body.dark-mode .exam-score-label,
body.dark-mode .exam-summary-subtitle {
  color: #9ca3af;
}

body.dark-mode .exam-progress {
  background: #374151;
}

body.dark-mode .exam-result-item {
  background: #2a2a2a;
  border: 1px solid #3f3f46;
}

body.dark-mode .exam-result-item strong {
  color: #f9fafb;
}

body.dark-mode .exam-result-item span {
  color: #9ca3af;
}

body.dark-mode .correct-result strong,
body.dark-mode .correct-result span {
  color: #22c55e;
}

body.dark-mode .wrong-result strong,
body.dark-mode .wrong-result span {
  color: #ef4444;
}


body.dark-mode .exam-status {
  background: #2a2a2a;
  color: #f9fafb;
}

body.dark-mode .progress-container {
  background-color: #333;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode p,
body.dark-mode label {
  color: #f0f0f0;
}


body.dark-mode #question-text,
body.dark-mode #question-number,
body.dark-mode #subject-display {
  color: #f0f0f0;
}

body.dark-mode #question-number {
  background: #2a2a2a;
  color: white;
}

body.dark-mode .answer-btn.correct {
  background-color: #14532d !important;
  color: white !important;
  border-color: #22c55e !important;
}

body.dark-mode .answer-btn.wrong {
  background-color: #7f1d1d !important;
  color: white !important;
  border-color: #ef4444 !important;
}

body.dark-mode #subject-display {
  background: #2a2a2a;
  color: white;
}

body.dark-mode .guide-btn {
  background: #333;
  color: white;
}

/*LANDING PAGE*/

.landing-body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #f4f7fb, #e8eef7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.landing-container {
  display: flex;
  justify-content: center;

  padding: 40px 20px;
}

.hero-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(20, 40, 80, 0.12);
}

.logo-circle {
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #eef4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
}

.hero-card h1 {
  margin: 0;
  font-size: 2.6rem;
  color: #1f2937;
}

.hero-subtitle {
  margin: 16px auto 8px;
  max-width: 620px;
  font-size: 1.15rem;
  color: #4b5563;
}

.hero-text {
  margin: 0 auto 36px;
  max-width: 680px;
  color: #6b7280;
  line-height: 1.6;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.exam-card {
  text-decoration: none;
  color: inherit;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 28px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  position: relative;
}

.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.12);
  border-color: #93c5fd;
}

.exam-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.exam-card h2 {
  margin: 0 0 8px;
  color: #111827;
}

.exam-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
}

.exam-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 700px) {
.landing-header-inner {
    padding: 8px 16px;
  }

  .landing-container {
    padding: 20px 12px;
  }

  .hero-card {
    padding: 36px 22px;
  }

  .hero-card h1 {
    font-size: 2rem;
  }

  .signup-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;

    width: 100%;
    padding: 18px;
  }

  .signup-banner-content {
    align-items: flex-start;
  }

  .signup-banner-button {
    width: 100%;
    text-align: center;
  }

  .exam-grid {
    grid-template-columns: 1fr;
  }
}

.landing-divider {
    width: 100%;
    margin: 45px 0 35px;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* =========================
   EXAM SUMMARY
========================= */

.exam-summary {
  max-width: 600px;
  margin: 35px auto;
  padding: 36px;

  background: #ffffff;

  border: 1px solid #e5e7eb;
  border-radius: 22px;

  text-align: center;

  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.exam-summary-icon {
  width: 64px;
  height: 64px;

  margin: 0 auto 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #dcfce7;
  color: #16a34a;

  font-size: 30px;
  font-weight: 700;
}

.exam-summary h2 {
  margin: 0;

  font-size: 2rem;
}

.exam-summary-subtitle {
  margin: 8px 0 28px;

  color: #6b7280;
}

.exam-score {
  display: flex;
  flex-direction: column;

  margin-bottom: 20px;
}

.exam-score-value {
  font-size: 3.2rem;
  font-weight: 700;

  color: #111827;
}

.exam-score-label {
  margin-top: 4px;

  color: #6b7280;
}

.exam-progress {
  width: 100%;
  height: 10px;

  margin-bottom: 30px;

  background: #e5e7eb;

  border-radius: 999px;

  overflow: hidden;
}

.exam-progress-fill {
  height: 100%;

  background: #2563eb;

  border-radius: 999px;

  transition: width 0.5s ease;
}

.exam-results-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 12px;

  margin-bottom: 28px;
}

.exam-result-item {
  padding: 16px 10px;

  background: #f9fafb;

  border-radius: 14px;
}

.exam-result-item strong {
  display: block;

  margin-bottom: 4px;

  font-size: 1.4rem;

  color: #111827;
}

.exam-result-item span {
  font-size: 0.9rem;

  color: #6b7280;
}

.correct-result strong,
.correct-result span {
  color: #16a34a;
}

.wrong-result strong,
.wrong-result span {
  color: #dc2626;
}

.exam-status {
  display: inline-block;

  padding: 10px 18px;

  border-radius: 999px;

  background: #f3f4f6;

  font-weight: 700;
}

@media (max-width: 600px) {

  .exam-summary {
    padding: 28px 20px;
  }

  .exam-results-grid {
    grid-template-columns: 1fr;
  }

}

/* =========================
   EXAM SUMMARY NAVIGATION
========================= */

.exam-summary-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;

  margin-top: 28px;

  flex-wrap: wrap;
}

.exam-action-primary,
.exam-action-secondary,
.exam-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 150px;

  padding: 11px 18px;

  border-radius: 10px;

  text-decoration: none;

  font-size: 0.95rem;
  font-weight: 600;

  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

/* Primary action */

.exam-action-primary {
  background: #2563eb;
  color: white;

  border: 1px solid #2563eb;
}

/* Secondary actions */

.exam-action-secondary,
.exam-action-link {
  background: white;
  color: #374151;

  border: 1px solid #d1d5db;
}

.exam-action-primary:hover {
  transform: translateY(-2px);
  background: #1d4ed8;
}

.exam-action-secondary:hover,
.exam-action-link:hover {
  transform: translateY(-2px);
  background: #f9fafb;
  border-color: #9ca3af;
}

@media (max-width: 650px) {

  .exam-summary-actions {
    flex-direction: column;
  }

  .exam-action-primary,
  .exam-action-secondary,
  .exam-action-link {
    width: 100%;
  }

}

.exam-action-link:hover {
  color: #111827;
}

/* °°°°°°° FOOTER °°°°°°°° */



.footer{
    margin-top:60px;
    padding:40px 20px;

    text-align:center;

    color:#6b7280;

    font-size:0.95rem;
}

.footer-author{
    margin-bottom:8px;
}

.footer-text{
    max-width:520px;
    margin:0 auto 20px;
    line-height:1.6;
}

.coffee-btn{

    display:inline-block;

    padding:12px 22px;

    border-radius:10px;

    background:#ffdd00;

    color:#222;

    font-weight:600;

    text-decoration:none;

    transition:all .2s ease;
}

.coffee-btn:hover{

    transform:translateY(-2px);

    box-shadow:0 8px 18px rgba(0,0,0,.15);
}

.footer-version{

    margin-top:20px;

    font-size:.85rem;

    color:#9ca3af;
}

.footer-version a {
  color: inherit;
  text-decoration: none;
  font: inherit;
}

.footer-version a:hover {
  color: #16a34a;
}

.footer-links{

    display:flex;

    justify-content:center;

    align-items:center;

    gap:14px;

    margin-top:20px;

    flex-wrap:wrap;
}

.github-btn{

    display:inline-flex;

    align-items:center;

    gap:8px;

    padding:10px 18px;

    border-radius:10px;

    border:1px solid #d1d5db;

    background:white;

    color:#24292f;

    text-decoration:none;

    font-weight:600;

    transition:.2s;
}

.github-btn:hover{

    transform:translateY(-2px);

    background:#f5f5f5;

    border-color:#9ca3af;
}

.exam-timer {
  margin: 12px 0;
  padding: 10px 14px;

  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;

  font-weight: 600;
  text-align: center;
  color: #374151;
}

/* =========================
   QUIZ CARD
========================= */

.quiz-card {
  width: 100%;
  max-width: 850px;

  margin: 24px auto;
  padding: 30px;

  background: #ffffff;

  border: 1px solid #e5e7eb;
  border-radius: 20px;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);

  box-sizing: border-box;
}

.quiz-card #question-number {
  margin: 0 0 6px;

  font-size: 0.9rem;
  font-weight: 600;

  color: #6b7280;
}

.quiz-card #subject-display {
  margin: 0 0 14px;

  font-size: 0.9rem;

  color: #9ca3af;
}

.quiz-card #question-text {
  margin: 0 0 26px;

  font-size: 1.35rem;
  line-height: 1.55;

  color: #111827;
}

.quiz-card #answers-container {
  margin-top: 20px;
}

.quiz-card #next-btn {
  display: block;
  margin: 40px auto 0;
}

@media (max-width: 600px) {
  .quiz-card {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .quiz-card #question-text {
    font-size: 1.15rem;
  }
}

.new-badge {
  position: absolute;
  top: 14px;
  right: 14px;

  padding: 7px 14px;

  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.8px;

  color: white;
  background: #22c55e;

  border-radius: 999px;

  animation: newPulse 2s ease-in-out infinite;
}

@keyframes newPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.exam-tools-toggle {
  display: block;
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;

  margin-top: 16px;
  padding: 11px 18px;

  border: 1px solid #d1d5db;
  border-radius: 10px;

  background: #f3f4f6;
  color: #374151;

  font-size: 0.95rem;
  font-weight: 600;

  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.exam-tools-toggle:hover {
  background: #e5e7eb;
}

.exam-tools-toggle:active {
  transform: scale(0.99);
}




/* ==============================
TOGGLE CARD
============================== */


.exam-tools-panel {
  margin-top: 14px;
  padding: 18px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;

  border: 1px solid #d1d5db;
  border-radius: 14px;

  background: #fafafa;
}

.exam-tool-card,
.exam-tool-danger {
  min-height: 120px;
  padding: 18px;

  display: flex;
  align-items: flex-start;
  gap: 14px;

  text-align: left;

  border-radius: 12px;
  box-sizing: border-box;
}

.exam-tool-card {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
}

.exam-tool-card:hover {
  background: #f9fafb;
}

.exam-tool-icon {
  flex-shrink: 0;
  font-size: 24px;
  line-height: 1;
}

.exam-tool-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exam-tool-content strong {
  font-size: 16px;
  font-weight: 700;
}

.exam-tool-content small {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
  color: #6b7280;
}

.exam-tool-danger {
  grid-column: 1 / -1;

  min-height: 84px;

  align-items: center;
  justify-content: center;

  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.exam-tool-danger .exam-tool-content {
  text-align: center;
}

.exam-tool-danger .exam-tool-content small {
  color: #dc2626;
}

@media (max-width: 768px) {

  .exam-tools-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .exam-tool-danger {
    grid-column: 1;
  }

  .exam-tool-card,
  .exam-tool-danger {
    min-height: auto;
    padding: 14px;
  }

}





/* ==============================
   MOBILE QUIZ LAYOUT
   ============================== */

@media (max-width: 768px) {

  body {
    padding: 0;
    background: #f4f6f9;
  }

  .quiz-container {
    width: 100%;
    max-width: none;
    padding: 16px;
    box-sizing: border-box;
  }

  .top-bar {
    margin-bottom: 12px;
  }

  .header-row {
    align-items: center;
    gap: 10px;
  }

  #appTitle {
    font-size: 22px;
    margin: 0;
  }

  .version-text {
    display: none;
  }

  .top-controls {
    gap: 8px;
    flex-wrap: wrap;
  }

  .top-controls button,
  .top-controls select {
    font-size: 14px;
  }

  .progress-container {
    margin: 12px 0 16px;
  }

  .quiz-card {
    padding: 22px 18px 100px;
    border-radius: 18px;
  }

  #question-number {
    font-size: 14px;
    margin-bottom: 6px;
  }

  #subject-display {
    font-size: 14px;
    margin-bottom: 16px;
  }

  #question-text {
    font-size: 24px;
    line-height: 1.45;
    margin-bottom: 24px;
  }

  #answers-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #answers-container button {
    width: 100%;
    min-height: 56px;
    padding: 11px 14px;
    font-size: 17px;
    line-height: 1.35;
    text-align: left;
    border-radius: 14px;
  }

  .exam-timer {
    position: sticky;
    top: 8px;
    z-index: 20;
    width: fit-content;
    margin-left: auto;
    margin-bottom: 10px;

    padding: 8px 12px;
    border-radius: 999px;

    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    font-size: 15px;
    font-weight: 700;
  }

  #next-btn {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;

    width: calc(100% - 32px);
    min-height: 58px;

    z-index: 50;

    font-size: 18px;
    font-weight: 700;

    border-radius: 14px;
  }

  #feedback,
  #score,
  #stats,
  #error-count,
  .action-buttons,
  .danger-zone {
    margin-left: 4px;
    margin-right: 4px;
  }
}

/* Compact mobile controls */

.top-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.top-controls .controls {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 4px;
}

#subjectFilter {
  width: 100%;
}

.top-controls button {
  width: 100%;
  min-width: 0;
  padding: 10px 4px;
  font-size: 13px;
  min-height: 44px;
}

/* Restore only the emoji/icon */
#homeBtn::before {
  content: "🏠";
  font-size: 20px;
}

#homeBtn.exit-exam-btn::before {
  content: none;
  display: none;
}

#stats-btn::before {
  content: "📊";
  font-size: 20px;
}

/* Tutorial is currently the remaining button */
.top-controls button[onclick*="guide"]::before{
  content: "🎓";
  font-size: 20px;
}

/* ==============================
   MOBILE EXAM SUMMARY ACTIONS
   ============================== */

.exam-summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

  width: 100%;
  max-width: 100%;

  margin-top: 20px;
  margin-left: 0;
  margin-right: 0;

  box-sizing: border-box;
}

.exam-action-primary {
  grid-column: 1 / -1;

  width: 100%;
  height: 54px;
  min-height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 0 18px;

  box-sizing: border-box;

  font-size: 17px;
  font-weight: 700;
}

.exam-action-secondary,
.exam-action-link {
  width: 100%;
  min-height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 10px 8px;

  font-size: 14px;
  line-height: 1.2;
  text-align: center;

  box-sizing: border-box;
}





/* Extra-small mobile screens */
@media (max-width: 430px) {

  .exam-summary-actions {
    grid-template-columns: 1fr;
  }

  .exam-action-primary,
  .exam-action-secondary,
  .exam-action-link {
    grid-column: 1;
    width: 100%;
  }

}



/* =========================
   LANDING TOP BAR
========================= */

.landing-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  width: 100%;

  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e5e7eb;

  backdrop-filter: blur(10px);
}

.landing-header-inner {
  max-width: 1180px;
  margin: 0 auto;

  padding: 8px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ---------- BURGER ---------- */

.menu-toggle {
  width: 42px;
  height: 42px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  padding: 0;

  background: transparent;
  border: none;

  cursor: pointer;
}

.menu-toggle span {
  width: 20px;
  height: 2px;

  background: #374151;
  border-radius: 999px;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}


/* Burger → X */

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ---------- ACCOUNT ---------- */

.header-account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: #374151;
  text-decoration: none;

  font-size: 0.9rem;
  font-weight: 600;

  transition: color 0.2s ease;
}

.header-account-link:hover {
  color: #16a34a;
}

.header-account-icon {
  font-size: 1rem;
}

/* Menu panel */

.landing-menu {
  position: absolute;

  top: calc(100% + 8px);
  left: max(24px, calc((100% - 1180px) / 2 + 24px));

  width: 230px;

  padding: 8px;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;

  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.landing-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/* Menu items */

.landing-menu a,
.menu-item-disabled {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 14px;

  border-radius: 9px;

  font-size: 0.9rem;
  font-weight: 600;

  text-decoration: none;
}

.landing-menu a {
  color: #374151;
}

.landing-menu a:hover {
  background: #f0fdf4;
  color: #16a34a;
}


/* Disabled items */

.menu-item-disabled {
  color: #9ca3af;
  cursor: default;
}

.menu-item-disabled small {
  font-size: 0.65rem;
  font-weight: 700;

  color: #9ca3af;
}

/* =========================
   ACCOUNT BUTTON
========================= */

.account-link {
  position: fixed;
  top: 22px;
  right: 26px;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  text-decoration: none;
  font-size: 1.1rem;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);

  z-index: 999;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.account-link:hover {
  transform: translateY(-1px);
  border-color: #16a34a;
}

.hidden-old-stats {
  display: none !important;
}

/* =========================
   SIGN UP BANNER
========================= */

.signup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;

  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 22px 26px;

  background: #eef5ff;
  border: 1px solid #dbe7f7;
  border-radius: 18px;
}

.signup-banner-content {
  display: flex;
  align-items: center;
  gap: 18px;
}

.signup-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 72px;
  height: 72px;
  flex-shrink: 0;

  color: #3b82f6;

  background: #e2edff;
  border-radius: 16px;
}

.signup-banner-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.signup-banner-text strong {
  font-size: 18px;
  color: #111827;
}

.signup-banner-text span {
  font-size: 14px;
  line-height: 1.5;
  color: #667085;
}

.signup-banner-button {
  flex-shrink: 0;

  padding: 13px 18px;

  background: #16a34a;
  color: #ffffff;

  border-radius: 12px;

  font-size: 14px;
  font-weight: 700;
  text-decoration: none;

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.signup-banner-button:hover {
  background: #15803d;
  transform: translateY(-1px);
}


/* Mobile */

@media (max-width: 700px) {

  .signup-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;

    padding: 20px;
  }

  .signup-banner-content {
    align-items: flex-start;
  }

  .signup-banner-button {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }
}

.exit-exam-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: #fff1f2 !important;
  color: #dc2626 !important;

  border: 1px solid #fecaca !important;
}

.exit-exam-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}

.exit-exam-btn svg {
  display: block;
}

.ai-explanation-box {
  margin-top: 20px;
  padding: 24px;

  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.ai-explanation-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;

  margin-bottom: 20px;
}

.ai-section {
  margin-bottom: 20px;
}

.ai-section h4,
.ai-key-concept h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.ai-section p,
.ai-key-concept p {
  margin: 0;
  line-height: 1.6;
  color: #374151;
}

.ai-key-concept {
  margin-top: 20px;
  padding: 16px 18px;

  background: #fffbea;
  border: 1px solid #fde68a;
  border-radius: 12px;
}

.ai-key-concept h4 {
  color: #92400e;
}

.ai-key-concept p {
  color: #78350f;
}

/* =========================
   QUESTION HEADER + AI BUTTON
   ========================= */

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.question-header .ai-explain-btn {
  margin-left: auto;
  flex-shrink: 0;
}


/* Mobile */

@media (max-width: 700px) {

  .question-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .question-header .ai-explain-btn {
    margin-left: 0;
  }

}

.ai-explanation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-close-btn {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 8px;
}

.ai-close-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

/* =========================
   NEXT QUESTION / CONFIRM ANSWER - DESKTOP
========================= */

@media (min-width: 1200px) {

  .quiz-card #confirmAnswerBtn,
  .quiz-card #next-btn {
    position: sticky;
    bottom: 20px;

    width: 180px;
    min-height: 56px;

    margin: 32px 0 0 auto;

    z-index: 20;
  }

}

/* =========================
   CONFIRM ANSWER
   ========================= */

#confirmAnswerBtn {
  border: none;

  background: linear-gradient(
    135deg,
    #4f46e5,
    #6366f1
  );

  color: #ffffff;

  font-size: 16px;
  font-weight: 700;

  border-radius: 14px;

  cursor: pointer;

  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.25);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

#confirmAnswerBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);

  box-shadow: 0 9px 24px rgba(79, 70, 229, 0.32);
}



/* =========================
   CONFIRM ANSWER MOBILE
   ========================= */

@media (max-width: 1199px) {

  #confirmAnswerBtn {
    position: fixed;

    left: 16px;
    right: 16px;
    bottom: 16px;

    width: calc(100% - 32px);
    min-height: 58px;

    z-index: 50;
  }

}


/* =========================
   AI EXPLAIN BUTTON
   ========================= */

#aiExplainBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 11px 18px;

  border: none;
  border-radius: 14px;

  background: linear-gradient(
    135deg,
    #7c3aed 0%,
    #a855f7 45%,
    #3b82f6 100%
  );

  color: #ffffff;

  font-size: 15px;
  font-weight: 700;

  cursor: pointer;

  box-shadow:
    0 5px 16px rgba(124, 58, 237, 0.28),
    0 2px 6px rgba(59, 130, 246, 0.18);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

#aiExplainBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);

  box-shadow:
    0 8px 24px rgba(124, 58, 237, 0.38),
    0 3px 10px rgba(59, 130, 246, 0.25);
}

#aiExplainBtn:active {
  transform: translateY(0) scale(0.98);
}

#aiExplainBtn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}