/**
 * Custom styles for the quiz plugin
 * by Ivy
 */

/* Custom orange colors */
.bg-orange-50 {
  background-color: #FFF5EB;
}

.bg-orange-500 {
  background-color: #E07B00;
}

.bg-orange-600 {
  background-color: #E07B00;
}

.bg-orange-700 {
  background-color: #C56E00;
}

.text-orange-500 {
  color: #E07B00;
}

.text-orange-600 {
  color: #E07B00;
}

.text-orange-700 {
  color: #C56E00;
}

.text-orange-200 {
  color: #FFD7A8;
}

.border-orange-500 {
  border-color: #E07B00;
}

.border-orange-600 {
  border-color: #E07B00;
}

.hover\:bg-orange-50:hover {
  background-color: #FFF5EB;
}

.hover\:bg-orange-700:hover {
  background-color: #C56E00;
}

.focus\:ring-orange-500:focus {
  --tw-ring-color: #E07B00;
  --tw-ring-opacity: 1;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

/* Fixed price container */
.fixed-price-container {
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Quiz min-height for proper layout */
.min-h-\[400px\] {
  min-height: 400px;
}

/* Quiz loading and image height */
.h-\[400px\] {
  height: 400px;
}

.h-\[300px\] {
  height: 300px;
}

/* Radio button styles */
.answer-option input[type="radio"]:checked + .radio-custom {
  border-color: #E07B00;
}

.answer-option input[type="radio"]:checked + .radio-custom .radio-dot {
  background-color: #E07B00;
  opacity: 1;
}

/* Selection feedback animation */
.answer-option.border-orange-500 {
  transition: all 0.3s ease;
}

.answer-option:active {
  transform: scale(0.98);
}

/* Animation keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.answer-option.border-orange-500 {
  animation: pulse 0.5s ease-in-out;
}

.question-item {
  animation: fadeIn 0.3s ease-in-out;
}

/* Loading animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.image-loading {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-image-container {
  position: relative;
  min-height: 300px;
}

.result-image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Двухколоночный layout для блока результатов */
.result-flex-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 768px) {
  .result-flex-container {
    flex-direction: row;
    align-items: flex-start;
  }
  .result-image-side {
    max-width: 400px;
    min-width: 260px;
    width: 100%;
  }
}
.result-image-side {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.result-image-container {
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-image {
  max-width: 100%;
  max-height: 340px;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(224, 123, 0, 0.10), 0 2px 4px rgba(0,0,0,0.06);
  transition: opacity 0.7s;
}

/* Красивая кнопка */
#quiz-contact-form button[type="submit"] {
  height: 72px !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  border-radius: 9999px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(224, 123, 0, 0.10);
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}
#quiz-contact-form button[type="submit"] svg {
  display: none !important;
}
#quiz-contact-form button[type="submit"]:hover {
  background: #C56E00;
  box-shadow: 0 4px 16px rgba(224, 123, 0, 0.18);
  transform: translateY(-2px) scale(1.03);
}

/* Плавные анимации для появления блоков */
.results-container, .result-details, .result-image-side, .result-image-container {
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
}

/* Fade-in для картинки */
.result-image.fade-in {
  opacity: 1 !important;
}

/* Плавные анимации для answer-option */
.answer-option {
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}
.answer-option:hover {
  box-shadow: 0 2px 8px rgba(224, 123, 0, 0.08);
  background: #FFF5EB;
}

/* Красивая анимация загрузки с затемнением */
.loading-blur {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  transition: opacity 0.3s;
}
.loading-blur .spinner {
  width: 56px;
  height: 56px;
  border: 6px solid #E07B00;
  border-top: 6px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* --- Современный двухколоночный layout для quiz-container --- */
.quiz-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.04);
  margin: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;
}
.quiz-content {
  width: 100%;
  padding: 0;
}
.quiz-main-flex {
  display: flex;
  flex-direction: row;
  gap: 48px;
  align-items: flex-start;
  padding: 40px 32px;
}
#questions-container {
  flex: 1 1 0;
  min-width: 320px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}
#live-preview-container {
  flex: 1 1 0;
  min-width: 400px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #faf8f6;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  padding: 32px 24px 24px 24px;
  margin-top: 0;
  border: none;
}
#live-preview-image {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.quiz-header {
  border-radius: 24px 24px 0 0;
  font-size: 2.2rem;
}
.answer-option {
  border: none !important;
  background: #f7f7f7;
  border-radius: 12px !important;
  margin-bottom: 16px;
  padding: 18px 20px !important;
  transition: background 0.2s;
  font-size: 1.25rem;
}
.answer-option:hover, .answer-option input:checked + .answer-text {
  background: #fff3e0;
}
.quiz-navigation {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}
#update-preview-btn {
  background: #ff9800;
  color: #fff;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  border: none;
  margin-top: 12px;
  transition: background 0.2s;
}
#update-preview-btn:hover {
  background: #fb8c00;
}
/* Results modern look */
#results-container {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.04);
  margin-top: 32px;
}
.result-details {
  background: #faf8f6;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  padding: 32px 24px 24px 24px;
  font-size: 1.15rem;
}
.result-image-side {
  max-width: 420px;
  min-width: 260px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.result-image-container img, #result-image {
  max-width: 100%;
  max-height: 340px;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(224, 123, 0, 0.10), 0 2px 4px rgba(0,0,0,0.06);
  transition: opacity 0.7s;
}
.question-item h3 {
  font-size: 2rem;
}
.progress-text, .progress-percent {
  font-size: 1.15rem;
}
@media (max-width: 900px) {
  .quiz-main-flex {
    flex-direction: column;
    gap: 24px;
    padding: 20px 8px;
  }
  #live-preview-container, #questions-container, .result-image-side {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 16px 4px;
  }
  .quiz-header {
    font-size: 1.3rem;
  }
  .question-item h3 {
    font-size: 1.1rem;
  }
  .answer-option {
    font-size: 1rem;
  }
  .result-details, .quiz-navigation, .progress-text, .progress-percent {
    font-size: 1rem;
  }
}

/* --- Мультиответы (checkbox) --- */
.answer-option.selected {
  background: #fff7ed !important;
  border-color: #fb923c !important;
  box-shadow: 0 2px 8px 0 rgba(251,146,60,0.07);
  transition: background 0.2s, border-color 0.2s;
}
.answer-option {
  transition: background 0.2s, border-color 0.2s;
}
.answer-option input[type="checkbox"] {
  display: none !important;
}

/* Убираем стандартные чекбоксы и маркеры */
.answer-option input[type="checkbox"]:focus + .answer-text {
  outline: none;
}

/* Слегка затемняем текст выбранного варианта */
.answer-option.selected .answer-text {
  color: #b45309;
  font-weight: 500;
}

/* Кнопка Далее для мультиответов */
#next-btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.3);
}

.btn-next {
  background: #ff9800 !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  border: none !important;
  margin-top: 12px;
  transition: background 0.2s;
  box-shadow: none !important;
  outline: none !important;
}
.btn-next:hover {
  background: #fb8c00 !important;
  color: #fff !important;
}

.btn-prev-custom {
  background: #f5f5f5 !important;
  color: #222 !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  transition: background 0.2s;
}
.btn-prev-custom:hover {
  background: #e0e0e0 !important;
}

#quiz-contact-form button[type="submit"] {
  background: #ff9800 !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  transition: background 0.2s;
}
#quiz-contact-form button[type="submit"]:hover {
  background: #fb8c00 !important;
  color: #fff !important;
}

.result-form-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
}
@media (min-width: 768px) {
  .result-form-side {
    width: 50%;
    max-width: 420px;
  }
}

.form-wrapper {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}
.form-wrapper h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.consultation-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.consultation-form input {
  padding: 12px 16px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  transition: border 0.3s;
}
.consultation-form input:focus {
  outline: none;
  border-color: #ff9000;
}
.consultation-form button {
  padding: 14px 20px;
  background-color: #ff9000;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}
.consultation-form button:hover {
  background-color: #e48100;
}
.project-cost {
  margin-top: 24px;
  color: #d36100;
  font-weight: 600;
  font-size: 16px;
}
.project-cost strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

.quiz-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.quiz-image-block img {
  max-width: 500px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.quiz-form-wrapper {
  flex: 1;
  max-width: 450px;
}
.quiz-form-wrapper h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.quiz-consultation-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.quiz-consultation-form input {
  padding: 12px 16px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  transition: border 0.3s;
}
.quiz-consultation-form input:focus {
  outline: none;
  border-color: #ff9000;
}
.quiz-consultation-form button {
  padding: 14px 20px;
  background-color: #ff9000;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}
.quiz-consultation-form button:hover {
  background-color: #e48100;
}
.quiz-project-cost {
  margin-top: 24px;
  color: #d36100;
  font-weight: 600;
  font-size: 16px;
}
.quiz-project-cost strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

+html, body { overflow-x: hidden; }