/* ===================================
   BSQuiz - "Выбери свой Путь"
   Bamboo Monk theme integration
   =================================== */

/* ========== NOSCRIPT ========== */
.quiz-noscript {
  max-width: 560px;
  margin: 80px auto;
  padding: 24px 32px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: #5a7562;
  background: rgba(61, 122, 84, 0.05);
  border: 1px solid rgba(200, 213, 204, 0.6);
  border-radius: 10px;
  text-align: center;
  line-height: 1.6;
}

/* ========== CONTAINER ========== */
.quiz-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

/* ========== SCREEN BASE ========== */
.quiz-screen {
  opacity: 1;
}

/* ========== FADE-IN ANIMATION ========== */
.quiz-fade-in {
  animation: quizFadeIn 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes quizFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== STAGGERED REVEAL (result screen) ========== */
.quiz-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quiz-reveal.quiz-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== SHARED BUTTON BASE ========== */
.quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  line-height: 1.4;
}

.quiz-btn:focus-visible {
  outline: 3px solid rgba(61, 122, 84, 0.3);
  outline-offset: 2px;
}

/* ========== INTRO SCREEN ========== */
#quizIntro h1 {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 600;
  color: #1e2e25;
  line-height: 1.3;
  margin-bottom: 16px;
}

.quiz-intro-text {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: #5a7562;
  line-height: 1.6;
  margin-bottom: 32px;
}

.quiz-btn-start {
  padding: 12px 32px;
  background: #3d7a54;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.quiz-btn-start::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.quiz-btn-start:hover {
  background: #2d5e3f;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(45, 94, 63, 0.25);
}

.quiz-btn-start:hover::before {
  left: 100%;
}

.quiz-btn-start:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(45, 94, 63, 0.2);
}

/* ========== INTRO FORM (name + gender) ========== */
.quiz-intro-form {
  margin-bottom: 28px;
}

.quiz-name-field {
  margin-bottom: 20px;
}

.quiz-name-field label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e2e25;
  margin-bottom: 8px;
}

.quiz-name-field input {
  width: 100%;
  padding: 12px 16px;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color: #1e2e25;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(200, 213, 204, 0.6);
  border-radius: 10px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

.quiz-name-field input:focus {
  border-color: #3d7a54;
  box-shadow: 0 0 0 3px rgba(61, 122, 84, 0.15);
}

.quiz-name-field input.quiz-input-error {
  border-color: #c44;
  box-shadow: 0 0 0 3px rgba(204, 68, 68, 0.15);
}

.quiz-gender-options.quiz-input-error .quiz-gender-btn {
  border-color: #c44;
}

.quiz-gender-field label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e2e25;
  margin-bottom: 4px;
}

.quiz-gender-note {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  color: #5a7562;
  margin-bottom: 10px;
}

.quiz-gender-options {
  display: flex;
  gap: 8px;
}

.quiz-gender-btn {
  flex: 1;
  padding: 10px 0;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #5a7562;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(200, 213, 204, 0.6);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.quiz-gender-btn:hover {
  border-color: #3d7a54;
  color: #1e2e25;
}

.quiz-gender-btn.selected {
  background: rgba(61, 122, 84, 0.1);
  border-color: #3d7a54;
  color: #1e2e25;
  font-weight: 500;
}

/* ========== CARD SECTION (result screen) ========== */
.quiz-card-section {
  margin: 24px 0;
  text-align: center;
}

.quiz-card-image {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.quiz-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.quiz-btn-action {
  flex: 1;
  max-width: 200px;
  padding: 12px 16px;
  background: #3d7a54;
  color: #fff;
  text-decoration: none;
  text-align: center;
}

.quiz-btn-action:hover {
  background: #2d5e3f;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(45, 94, 63, 0.25);
}

/* ========== QUESTION SCREEN ========== */

/* Progress */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.quiz-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(200, 213, 204, 0.4);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3d7a54, #5a9a6e, #3d7a54);
  border-radius: 2px;
  transition: width 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quiz-progress-text {
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: #8a9e90;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* Question content */
.quiz-question-content {
  margin-bottom: 24px;
}

.quiz-question-content p {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #1e2e25;
  line-height: 1.6;
  margin-bottom: 0;
}

.quiz-question-content .quiz-hint {
  font-size: 0.85rem;
  font-weight: 300;
  color: #8a9e90;
  font-style: italic;
  margin-top: 8px;
}

/* Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: #1e2e25;
  line-height: 1.5;
  background: #fff;
  border: 1px solid rgba(200, 213, 204, 0.6);
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quiz-option:hover {
  border-color: #3d7a54;
  background: rgba(61, 122, 84, 0.03);
}

.quiz-option.selected {
  border-color: #3d7a54;
  background: rgba(61, 122, 84, 0.08);
  font-weight: 400;
}

.quiz-option:focus-visible {
  outline: 3px solid rgba(61, 122, 84, 0.3);
  outline-offset: 2px;
}

/* Inline option tooltip (e.g. Abhidhamma) */
.quiz-option-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #a0b8a8;
  background: transparent;
  color: #5a7562;
  font-family: "Inter", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
  transition:
    background 0.2s,
    color 0.2s;
}

.quiz-option-hint:hover,
.quiz-option-hint.is-active {
  background: #3d7a54;
  color: #fff;
  border-color: #3d7a54;
}

.quiz-option-tooltip {
  font-size: 0.8rem;
  font-weight: 300;
  color: #5a7562;
  background: rgba(200, 213, 204, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
  line-height: 1.5;
}

/* Question navigation */
.quiz-question-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Back button */
.quiz-btn-back {
  padding: 8px 0;
  background: none;
  color: #5a7562;
  font-size: 0.85rem;
}

.quiz-btn-back:hover {
  color: #3d7a54;
}

/* Restart button (on question screen) */
.quiz-btn-restart {
  padding: 8px 0;
  background: none;
  color: #8a9e90;
  font-size: 0.8rem;
}

.quiz-btn-restart:hover {
  color: #c44;
}

/* Wikipedia link on result page */
.quiz-wiki-link {
  display: block;
  margin-top: 14px;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #3d7a54;
  text-decoration: none;
  transition: color 0.2s;
}

.quiz-wiki-link:hover {
  color: #2d5e3f;
  text-decoration: underline;
}

/* ========== CALCULATING SCREEN ========== */
#quizCalculating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.quiz-spinner {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
}

.quiz-spinner svg {
  width: 100%;
  height: 100%;
  animation: quizSpin 2s linear infinite;
  color: #3d7a54;
  fill: #3d7a54;
}

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

.quiz-calculating-text {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: #5a7562;
}

/* ========== RESULT SCREEN ========== */
.quiz-result-title {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #5a7562;
  margin-bottom: 8px;
}

.quiz-result-school {
  text-align: center;
  margin-bottom: 28px;
  margin-top: 24px;
}

.quiz-result-school .quiz-school-name {
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e2e25;
  line-height: 1.3;
  margin: 0 0 6px;
}

.quiz-result-school .quiz-school-branch {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.quiz-result-school .quiz-school-branch[data-branch="theravada"] {
  color: #8b6914;
}
.quiz-result-school .quiz-school-branch[data-branch="mahayana"] {
  color: #8b5a2b;
}
.quiz-result-school .quiz-school-branch[data-branch="vajrayana"] {
  color: #6b2d5b;
}
.quiz-result-school .quiz-school-branch[data-branch="reformist"] {
  color: #2d5b6b;
}
.quiz-result-school .quiz-school-branch[data-branch="secular"] {
  color: #5b5b5b;
}

.quiz-result-school .quiz-school-desc {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #3a5442;
  line-height: 1.7;
  margin: 0;
}

/* Branch badges */
.quiz-result-branch {
  display: inline-block;
  padding: 4px 12px;
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.quiz-branch-theravada {
  background: rgba(196, 154, 60, 0.15);
  color: #8b6914;
}

.quiz-branch-mahayana {
  background: rgba(139, 69, 19, 0.15);
  color: #8b4513;
}

.quiz-branch-vajrayana {
  background: rgba(107, 47, 160, 0.15);
  color: #6b2fa0;
}

.quiz-branch-reformist {
  background: rgba(46, 125, 110, 0.15);
  color: #2e7d6e;
}

.quiz-branch-secular {
  background: rgba(74, 111, 165, 0.15);
  color: #4a6fa5;
}

/* Result description */
.quiz-result-description {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: #1e2e25;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Result explanation */
.quiz-result-explanation {
  margin-bottom: 32px;
}

.quiz-result-explanation h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e2e25;
  margin-bottom: 16px;
}

/* Scale cards */
.quiz-scale-card {
  border-left: 3px solid #3d7a54;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(61, 122, 84, 0.03);
  border-radius: 0 8px 8px 0;
}

.quiz-scale-card:last-child {
  margin-bottom: 0;
}

.quiz-scale-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.quiz-scale-name {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e2e25;
}

.quiz-scale-pct {
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: #5a7562;
  margin-left: auto;
}

/* Direction badges */
.quiz-direction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 12px;
  line-height: 1;
}

.quiz-direction-high {
  background: rgba(210, 140, 50, 0.15);
  color: #b8751a;
}

.quiz-direction-low {
  background: rgba(74, 111, 165, 0.15);
  color: #4a6fa5;
}

.quiz-direction-match {
  background: rgba(61, 122, 84, 0.15);
  color: #3d7a54;
}

/* Strengths & Explanation rows */
.quiz-result-strengths {
  margin-top: 28px;
}

.quiz-result-explanation {
  margin-top: 24px;
}

.quiz-explain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(200, 213, 204, 0.4);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
}

.quiz-explain-row:last-child {
  border-bottom: none;
}

.quiz-explain-scale {
  color: #1e2e25;
  font-weight: 500;
  flex-shrink: 1;
  min-width: 0;
}

.quiz-explain-right {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #5a7562;
  font-size: 0.8rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.quiz-explain-dir {
  font-size: 0.9rem;
  width: 1em;
  text-align: center;
}

.quiz-explain-pct {
  font-weight: 500;
  min-width: 32px;
  text-align: right;
}

.quiz-explain-vals {
  color: #8a9e90;
  font-size: 0.75rem;
}

/* Analysis heading: school name + ? */
.quiz-analysis-heading {
  margin-top: 28px;
}

.quiz-analysis-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e2e25;
  margin-bottom: 8px;
}

/* Section subtitles */
.quiz-section-subtitle {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e2e25;
  margin: 0 0 10px;
}

.quiz-explain-help {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #a0b8a8;
  background: transparent;
  color: #5a7562;
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 0.2s,
    color 0.2s;
}

.quiz-explain-help:hover,
.quiz-explain-help.is-active {
  background: #3d7a54;
  color: #fff;
  border-color: #3d7a54;
}

.quiz-explain-tooltip {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #5a7562;
  background: rgba(200, 213, 204, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

/* Stat line */
.quiz-stat-line {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #5a7562;
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.5;
}

/* Share tooltip */
.quiz-btn-action.quiz-copied {
  background: #2d5e3f;
}

/* Result actions - handled by .quiz-result-actions + .quiz-btn-action above */

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .quiz-page {
    padding: 24px 0 40px;
  }

  #quizIntro h1 {
    font-size: 1.6rem;
  }

  .quiz-intro-text {
    font-size: 0.95rem;
  }

  .quiz-btn-start {
    width: 100%;
    padding: 14px 32px;
  }

  .quiz-result-actions {
    flex-direction: row;
  }

  .quiz-btn-action {
    flex: 1;
    max-width: none;
    padding: 14px 8px;
    font-size: 0.82rem;
  }

  .quiz-option {
    min-height: 48px;
    padding: 14px 16px;
  }

  .quiz-question-content p {
    font-size: 1rem;
  }

  .quiz-btn-back {
    text-align: center;
    padding: 12px 0;
  }

  .quiz-result-school .quiz-school-name {
    font-size: 1.4rem;
  }

  .quiz-result-title {
    font-size: 1.1rem;
  }

  .quiz-result-school .quiz-school-desc {
    font-size: 0.85rem;
  }

  .quiz-progress {
    gap: 8px;
  }
}

/* ========== PRIVACY NOTICE ========== */
.quiz-privacy-notice {
  font-size: 0.8rem;
  color: #5a7562;
  margin-top: 1rem;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}
.quiz-privacy-notice a {
  color: inherit;
  text-decoration: underline;
}

/* ========== SEO TEXT SECTION ========== */
.quiz-seo-text {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(61, 122, 84, 0.15);
  color: #666;
  font-size: 0.9rem;
  line-height: 1.7;
}
.quiz-seo-text h2 {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 1rem;
}
.quiz-seo-text a {
  color: #3d7a54;
  text-decoration: none;
}
.quiz-seo-text a:hover {
  text-decoration: underline;
}
.quiz-seo-text ul {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0;
}
.quiz-seo-text li {
  padding: 0.3rem 0 0.3rem 1.2rem;
  position: relative;
}
.quiz-seo-text li::before {
  content: "·";
  position: absolute;
  left: 0.4rem;
  color: #3d7a54;
  font-weight: bold;
}
.quiz-seo-text strong {
  color: #333;
  font-weight: 600;
}
.quiz-seo-links {
  margin-top: 1rem;
  font-size: 0.85rem;
}

/* School page links on result screen */
.quiz-school-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.quiz-school-link {
  color: #2d5016;
  font-weight: 600;
}
.quiz-school-link:hover {
  text-decoration: underline;
}
