/* ======================================================
  1.  Base / Reset 
====================================================== */
html {
  scroll-behavior: smooth;
	scroll-padding-top: 80px; /* height of sticky header */
}

.single-post .entry-meta {
  font-size: 1rem;
  color: #888;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.seo-intro {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ======================================================
  2. Utilities
====================================================== */

.hidden {
  display: none;
}

.errorMsg {
  color: #5c4242;
}

.align-center {
  text-align: center;
}

.soft-note {
  font-style: italic;
  font-size: 0.875rem;
  color: #777;
  margin-top: 20px;
  margin-bottom: 30px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;

    border: 2px solid rgba(255,255,255,0.35);
    border-top: 2px solid #fff;
    border-radius: 50%;

    animation: spin 0.8s linear infinite;

    vertical-align: middle;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ======================================================
  3. Landing - Intro Screen
====================================================== */

#quiz-app {
	width:100%;
	margin: 0 auto 10px;
	padding:0 16px;
	box-sizing:border-box;
	font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}

/* Heading styles */
#quiz-app h1,
#quiz-app h2 {
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
  margin-bottom: 20px;
}

.intro-screen {
  text-align: center;
}

.screen {
	padding: 10px 0;
	display: none;
}

.screen.active {
  display: block;
}

.screen-intro .quiz-header {
  display: none;
}

/* ======================================================
  4. Practice Library
====================================================== */

#practice-library {
  background-color: #f5f7fc;
  padding: 30px 0 20px;
  margin: 20px 0;
  text-align: center;
  border-radius: 10px;
}

/* Style the search-box the input and button */
#practice-library .search-box {
  display: flex;
  justify-content: center;
  margin: 20px auto 0;
  background-color: #f1f3f5;
  border-radius: 30px; /* Makes the corners round */
  width: 80%;
  padding: 5px;
  border: 1px solid #6f7788;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07); /* Adds a soft 3D shadow */
}

/* Style the text box */
#practice-library input[type="search"] {
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 20px;
  font-size: 16px;
  width: 100%;
}

/* Practice List Scroll */
#practice-library .cards-scroll-container {
  width: 100%;
  max-height: 300px;
  margin: 2px auto 30px;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; /* Smooth iOS momentum scrolling */
}

.scroll-item {
  flex: 0 0 auto; /* Prevents items from shrinking */
}

#practice-library .card {
  /* Add shadows to create the "card" effect */
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  width: 100%;
  margin: 0 auto;
  padding: 10px 0;
  background-color: #fbfbfb;
  border-radius: 20px;
  cursor: pointer;
}

/* On mouse-over, add a deeper shadow */
#practice-library .card:hover {
  border-color: #888;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Selected state active class */
#practice-library .card.selected {
  border-color: #007bff;
  background-color: #e7f1ff;
}

#practice-library .scroll-item-container h6 {
  width: 100%;
  text-align: left;
  margin: 0 auto;
  padding: 5px 16px;
  font-size: 1.125rem;
  line-height: 1.5;
}

/* Add some padding inside the card container */
#practice-library .scroll-item-container p {
  width: 100%;
  text-align: left;
  margin: 0 auto;
  padding: 5px 16px;
  font-size: 1rem;
  line-height: 1.2;
}

/* ======================================================
  5. Instructions Screen
====================================================== */

.instructions-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

.instructions-container h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.instructions-container p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
}

/* ======================================================
  6. Quiz - Question & Options Screen
====================================================== */

.quiz-header {
  margin-bottom: 20px;
}

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

  font-size: 0.8rem;
  color: #6b7280;

  min-height: 32px; /* reserves space */
	margin-bottom: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quiz-header.active .quiz-header-row {
  opacity: 1;
}

.progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #2f6fed;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.quiz-title {
  font-weight: 500;
	letter-spacing: 0.01em;
}

.quiz-progress {
  font-variant-numeric: tabular-nums;
	font-size: 0.75rem;
  opacity: 0.8;
}

/* Question topic */
.question-topic {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

/* Question text */
#quiz-app h2.question-text {
  white-space: pre-line;
  font-size:1.2rem;
  line-height:1.6;
}

/* Answer Options */
.option {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 14px 16px;
  font-size:1.05rem;
  line-height:1.5;
  text-align: left;
  white-space: normal;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* Selected state */
.option.selected {
  border-color: #2f6fed;
  background: #f0f5ff;
  color: #111827;
}

/* Desktop hover only */
@media (hover: hover) and (pointer: fine) {
  .option:hover:not(.selected) {
    color: #ffffff;
    background-color: #045cb4;
    border-color: #9db5ff;
  }
}

/* Primary / Secondary / Neutral Buttons */
.primary-btn {
  width: 100%;
  background: #2f6fed;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.primary-btn:hover {
  background: #2458c6;
}

.primary-btn:focus,
.primary-btn:focus-visible,
.primary-btn:active {
  outline: none;
  background: #2458c6;   /* same as hover */
  color: #ffffff;
}

/* Secondary button — stable in all states */
.secondary-btn {
  width: 100%;
  background: #ffffff;
  color: #2f6fed;
  border: 1px solid #2f6fed;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* Lock background — prevents primary bleed */
.secondary-btn,
.secondary-btn:hover,
.secondary-btn:active,
.secondary-btn:focus,
.secondary-btn:focus-visible {
	color: #2f6fed;
  background: #ffffff;
}

/* Hover — soft, readable */
.secondary-btn:hover {
  background: #eef2ff;
  color: #2f6fed;
  border-color: #2f6fed;
}

/* Active (mouse down) */
.secondary-btn:active {
  background: #e0e7ff;
  color: #2f6fed;
}

/* Focus ring — keyboard accessibility */
.secondary-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}

/* Disabled — no hover confusion */
.secondary-btn:disabled,
.secondary-btn[disabled] {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
}

/* Disabled hover safeguard */
.secondary-btn:disabled:hover,
.secondary-btn[disabled]:hover {
  background: #f3f4f6;
  color: #9ca3af;
}

.neutral-btn {
  width: 100%;
  background: #f9fafb;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.neutral-btn:hover {
  color: #111827;
  background: #f3f4f6;
}

.neutral-btn:focus,
.neutral-btn:focus-visible,
.neutral-btn:active {
  outline: none;
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.neutral-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.neutral-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}

/* Nav / Final Actions */
.nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.nav-buttons button {
  flex: 1;
}

.nav-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ======================================================
  7. Result Screen
====================================================== */

#result-screen {
  width: 100%;
  max-width: 100%;      /* override any Elementor container limits */
  padding: 0;        /* optional, for some breathing space */
  margin: 0 auto;       /* center if any leftover constraints */
  box-sizing: border-box; /* ensures padding doesn’t push it out */
	text-align: left;
}

.result-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 5px;
  text-align: center;
}

#result-title {
  font-size: 1.6rem;
  margin: 24px 0 32px;
  font-weight: 600;
}

/* quiz */
.quiz-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

/* Reflection */
.reflection {
  text-align: left;
  margin-top: 2rem;
}

#quiz-review .reflection-block {
  margin-bottom: 1.2rem;
}

#quiz-review .reflection-block h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
	color: #111;
}

#quiz-review .reflection-block .soft-note {
  margin-bottom: 0 0 px;
}

#quiz-review h5.review-question-no {
    line-height: 2;
    margin: 25px 0 10px;
}
#quiz-review .review-question {
    font-size: 1.15rem;
    line-height: 1.4;
    color: #333;
    margin: 0 0 10px;
}
#quiz-review .review-answer {
    font-size: 1.15rem;
    line-height: 1.3;
}
#quiz-review .review-reveal {
    font-size: 1.15rem;
    line-height: 1.3;
}
#quiz-review .review-result {
    font-size: 1.15rem;
    line-height: 1.4;
    margin: 15px 0;
}
#quiz-review .review-explanation {
    font-size: 1.15rem;
    line-height: 1.4;
    margin: 0 0 25px;
}

.final-actions {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ======================================================
  8. Media Query - Tablet & Desktop
====================================================== */

@media (min-width: 768px) {
    #quiz-app {
        max-width: 760px;
        padding: 0 20px;
    }

    #quiz-app h1 {
        white-space: nowrap;
    }
    
    #practice-library .cards-scroll-container {
        width: 80%;
    }
  
    #practice-library .scroll-item-container h6 {
        width: 80%;
    }
    
    #practice-library .scroll-item-container p {
        width: 80%;
    }
	
    .option {
        padding: 16px 18px;
        line-height: 1.55;
    }

    /* Primary / Secondary / Neutral Buttons */
    #start-btn.primary-btn, #chosen-Btn.secondary-btn {
        width: 320px;
        margin: 0 auto;
    }
}

/* ======================================================
  9. Mobile
====================================================== */

@media (max-width: 480px) {
  #quiz-app{
		padding: 0 12px;
	}

	.intro-screen, .instructions-container {
		padding-top: 20px;
	}
	
  .question-text{
    font-size:1rem;
  }

  .option {
    font-size:1rem;
  }

	#result-title {
    font-size: 1.35rem;
    margin: 20px 0 24px;
  }
}