/* 
 * Основной файл стилей профориентационного квиза
 * Импортирует все модульные стили (кроме таймера)
 */
/* Базовые стили */
@import "../common/variables.css";
@import "../common/reset.css";
@import "../common/fonts.css";
@import "../common/buttons.css";

/* Импорт модульных стилей (исключаем таймер) */
@import url("quiz-header.css");
/* @import url("quiz-footer.css"); */
@import url("quiz-questions.css");
@import url("quiz-answers.css");
/* @import url("quiz-progress.css"); */
/* @import url("quiz-timer.css"); - отключен для профориентационного квиза */
@import url("quiz-preloader.css");
@import url("quiz-navigation.css");
@import url("quiz-results-proftest.css");


/* Общие стили для квиза */

body {
  overflow: hidden;
}

body main {
  opacity: 0;
}

body.page-loaded main {
  opacity: 1;
  transition: opacity 0.8s ease-out
}

.quiz-main-wrapper {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #294ea1;
  overflow-x: hidden;
  opacity: 0;
}

.quiz-main-wrapper.loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Фоновые элементы */
.quiz-person {
  position: fixed;
  bottom: -5px;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

.quiz-person-hard {
  left: -80px;
}

.quiz-person img {
  max-width: 300px;
  height: auto;
}

.quiz-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
  background-color: #294ea1;
  background-blend-mode: color-burn;
  background-position: 50% 100%;
  background-size: 4000px;
}

.quiz-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.05;
}

/* Скрытые элементы */
.question-card__text {
  display: none !important;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.question-card__content {
  max-width: 488px;
  height: 100%;

  .simplebar-wrapper {
    width: 100%;
  }
}

.question-answer:last-child {
  margin-bottom: 0;
}

.proftest-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;

  .quiz-progress__title {
    display: none;
  }
}

.proftest-footer__container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.proftest-footer__actions {
  display: flex;
  gap: 15px;
  margin: 0;
}

/* Прогресс-бар для профтеста */
.quiz-progress {
  backdrop-filter: blur(40px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  padding: 12px 24px;
  width: auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
}

.quiz-progress__title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  color: #fff;
  margin: 0 16px;
}

.quiz-progress__info {
  display: flex;
  align-items: center;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.quiz-progress__bar {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 100%;
}

.quiz-progress__step {
  background: #fff;
  opacity: 0.2;
  border-radius: 100px;
  min-width: 8px;
  height: 8px;
  flex: 1;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
  display: block;
}

/* В профтесте шаги просто заливаются белым цветом по мере прохождения */
.quiz-progress__step.active {
  opacity: 1;
  background: #fff;
}

/* Отладочные стили для проверки видимости (можно убрать в продакшене) */
/* .quiz-progress__step[data-step] {
  border: 1px solid rgba(255, 255, 255, 0.3);
} */

/* В профтесте нет правильных/неправильных ответов, поэтому убираем эти классы */

.quiz-progress__step::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Управление видимостью текстов кнопок для профтеста */
.quiz-btn__text--answer {
  display: block;
}

.quiz-btn__text--next,
.quiz-btn__text--finish {
  display: none;
}

/* Показываем нужный текст в зависимости от состояния кнопки */
.quiz-btn--next .quiz-btn__text--answer,
.quiz-btn--next .quiz-btn__text--finish {
  display: none;
}

.quiz-btn--next .quiz-btn__text--next {
  display: block;
}

.quiz-btn--finish .quiz-btn__text--answer,
.quiz-btn--finish .quiz-btn__text--next {
  display: none;
}

.quiz-btn--finish .quiz-btn__text--finish {
  display: block;
}

.quiz-btn[data-step-action="finish-quiz"] .quiz-btn__text--answer {
  display: none;
}

.quiz-btn[data-step-action="finish-quiz"] .quiz-btn__text--finish {
  display: block;
}

/* Адаптивность для общих стилей */
@media (max-width: 768px) {
  .quiz-person img {
    max-width: 200px;
  }

  .proftest-footer__container {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .proftest-footer__actions {
    order: 3;
    justify-content: center;
  }

  .quiz-btn {
    padding: 14px 24px;
    font-size: 14px;
  }

  /* Анимация появления вопросов на мобильных устройствах */
  .step-content .proftest-question {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: 0.2s;
  }

  .step-content .proftest-question.active {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
  }

  /* Анимация ухода вопроса */
  .step-content .proftest-question.leaving {
    opacity: 0;
    transition: opacity 0.4s ease-in, transform 0.4s ease-in;
  }

  /* Анимация появления для вопроса при переключении */
  .step-content .proftest-question.entering {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .step-content .proftest-question.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: 0.2s;
  }

  /* Обеспечиваем плавность для всех состояний */
  .step-content .proftest-question:not(.active):not(.entering):not(.leaving) {
    opacity: 0;
  }

  /* Улучшаем плавность анимации для контейнера */
  .step-content {
    transition: transform 0.1s ease-out;
  }

  /* Предотвращаем скачки при анимации */
  .step-content .proftest-question {
    will-change: opacity, transform;
    backface-visibility: hidden;
    perspective: 1000px;
  }
}

@media (max-width: 480px) {

  .proftest-question .question-card__explanation .question-card__image {
    max-width: 320px;
    margin-top: 0;
  }

  .step-content .proftest-question {
    padding-left: 20px;
    padding-right: 20px;
  }

  .quiz-person img {
    max-width: 150px;
  }

  .proftest-footer__container {
    padding: 0 15px;
  }

  .quiz-btn {
    padding: 12px 20px;
    font-size: 13px;
  }
}

/* Стили для индикатора загрузки */
.quiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.quiz-loading__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.quiz-loading__text {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Стили для объяснений вопросов */
.question-explanation {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border-left: 4px solid #007bff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.explanation-content h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.explanation-content h4:before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.explanation-text {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
}

/* Анимация появления объяснения */
.question-explanation {
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 450px) {
  body.page-template-page-quiz-proftest, html:has(.page-template-page-quiz-proftest) {
    overflow: hidden;
  }

  .proftest-footer {
    .quiz-progress {
      margin: 0 auto;
      width: 100%;
      background: #0E317F;

    }

    .quiz-btn {
      width: 100%;
      max-width: 100%;
    }

    .proftest-footer__actions {
      width: 100%;
      max-width: 100%;
    }
  }

  .proftest-footer__container {
    flex-direction: column-reverse;
  }

  .step-content .proftest-question {
    height: 100%;
    overflow-x: hidden;
    padding-top: 0px;
    opacity: 0;
  }

  .step-content .proftest-question.active {
    opacity: 1;
    transition-delay: 0.3s;

    .question-card__content {
      opacity: 1;
      transition-delay: 0.3s;
    }

    .question-card__explanation {
      opacity: 1;
      transition-delay: 0.3s;
    }
  }

  .page-template-page-quiz-proftest .step-content {
    height: calc(100vh - 190px);
    height: calc(100dvh - 190px);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100vw;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
  }


  .step-content .proftest-question {
    .question-card__content {
      opacity: 0;
      transition-delay: 0.3s;
      transition: opacity 0.3s ease-out;
    }

    .question-card__explanation {
      opacity: 0;
      transition-delay: 0.3s;
      transition: opacity 0.3s ease-out;
    }
  }


  .step-content .proftest-question .simplebar-content {
    display: flex;
    flex-direction: column;
    /* padding-bottom: 0 !important; */

    .question-card__content {
      order: 2;
      opacity: 0;
      transition-delay: 0.3s;
      transition: opacity 0.3s ease-out;
    }

    .question-card__explanation {
      order: 1;
      opacity: 0;
      transition-delay: 0.3s;
      transition: opacity 0.3s ease-out;
    }
  }

  .step-content .proftest-question.active .simplebar-content {
    .question-card__content {
      opacity: 1;
      transition-delay: 0.3s;
    }

    .question-card__explanation {
      opacity: 1;
      transition-delay: 0.3s;
    }
  }

  .proftest-footer__container {
    &:after {
      content: '';
      position: absolute;
      top: -10px;
      left: 0;
      right: 0;
      height: 70px;
      z-index: -1;
      background: linear-gradient(180deg, rgba(41, 78, 161, 0) 0%, #294ea1 100%);
    }
  }

}