:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.octane-quiz-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.quiz-header {
  text-align: center;
  margin-bottom: 32px;
}

.quiz-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.quiz-mode-switcher {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
  padding: 4px;
  background: var(--bg-light);
  border-radius: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.mode-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.mode-switch-btn svg {
  flex-shrink: 0;
}

.mode-switch-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.mode-switch-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.quiz-header p {
  font-size: 0.938rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.progress-bar-container {
  max-width: 100%;
  margin: 0 auto 8px;
  background: var(--bg-light);
  border-radius: 9999px;
  height: 8px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 9999px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  display: block;
  text-align: center;
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.813rem;
}

.quiz-step {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.quiz-step.hidden-by-condition {
  display: none !important;
}

.quiz-step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.quiz-question {
  background: white;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.question-text {
  font-size: 1.125rem;
  margin-bottom: 20px;
  color: var(--text-dark);
  font-weight: 600;
  line-height: 1.5;
}

.form-check {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--bg-light);
  border-radius: 8px;
  transition: all 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}

.form-check:hover {
  background: #fef3f2;
  border-color: #fee2e2;
}

.form-check:has(input[type="radio"]:checked),
.form-check:has(input[type="checkbox"]:checked) {
  background: #eef2ff;
  border-color: var(--primary);
}

.form-check:has(input[type="radio"]:checked) .form-check-label,
.form-check:has(input[type="checkbox"]:checked) .form-check-label {
  color: var(--primary);
  font-weight: 600;
}

.form-check input[type="radio"],
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.form-check-label {
  cursor: pointer;
  font-size: 0.938rem;
  line-height: 1.5;
  margin-left: 12px;
  flex: 1;
  user-select: none;
}

.scale-container {
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
}

.scale-container input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #d1d5db;
  outline: none;
  -webkit-appearance: none;
}

.scale-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scale-container input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.813rem;
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 24px;
  font-size: 0.938rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--text-light);
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
}

.btn-outline:hover {
  background: var(--bg-light);
  border-color: var(--text-light);
}

.btn-skip {
  margin: 0 auto;
}

.octane-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.octane-loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.octane-loader-content {
  background: white;
  padding: 48px 40px;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.octane-loader-overlay.active .octane-loader-content {
  transform: scale(1);
}

.octane-loader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
  border: 4px solid var(--bg-light);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.octane-loader-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.octane-loader-text {
  font-size: 0.938rem;
  color: var(--text-light);
  line-height: 1.6;
}

.octane-loader-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.octane-loader-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.octane-loader-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.octane-loader-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.octane-results-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 16px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.octane-results-container h1 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
}

.results-intro {
  text-align: center;
  font-size: 1.063rem;
  color: var(--text-light);
  margin-bottom: 48px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.products-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-item {
  display: flex;
  animation: slideUp 0.5s ease forwards;
  opacity: 0;
}

.product-item:nth-child(1) {
  animation-delay: 0.1s;
}

.product-item:nth-child(2) {
  animation-delay: 0.2s;
}

.product-item:nth-child(3) {
  animation-delay: 0.3s;
}

.product-item:nth-child(4) {
  animation-delay: 0.4s;
}

.product-item:nth-child(5) {
  animation-delay: 0.5s;
}

.product-item:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  text-align: center;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.product-image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
  transform: scale(1.08);
}

.product-brand {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.688rem;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  z-index: 2;
}

.match-score {
  position: absolute;
  top: 12px;
  right: 12px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-card:hover .match-score {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.product-name {
  font-size: 1rem;
  margin: 0;
  color: var(--text-dark);
  font-weight: 600;
  line-height: 1.4;
  padding: 16px 20px 8px;
  min-height: 64px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.product-name a:hover {
  color: var(--primary);
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  padding: 8px 20px 16px;
}

.product-card .btn-primary {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.938rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.3s;
}

.product-card .btn-primary:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.octane-quiz-home {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 64px 32px;
  border-radius: 20px;
  text-align: center;
  color: white;
  margin: 48px auto;
  max-width: 800px;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.octane-quiz-home::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.quiz-cta {
  position: relative;
  z-index: 1;
}

.quiz-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.quiz-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.quiz-cta h2 {
  font-size: 2.25rem;
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: white;
}

.quiz-cta p {
  font-size: 1.063rem;
  margin-bottom: 32px;
  opacity: 0.95;
  line-height: 1.7;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  color: white;
}

.quiz-features {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.feature:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.25rem;
}

.feature-text {
  font-size: 0.938rem;
  font-weight: 500;
}

.quiz-cta .btn {
  background: white;
  color: var(--primary);
  padding: 16px 48px;
  font-size: 1.063rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  display: inline-block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.quiz-cta .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  background: #f8f9ff;
  color: var(--primary);
}

.quiz-time {
  margin-top: 20px;
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 500;
}

@media (max-width: 768px) {
  .octane-quiz-container {
    padding: 24px 12px;
  }

  .quiz-header h1 {
    font-size: 1.5rem;
  }

  .quiz-question {
    padding: 20px;
  }

  .question-text {
    font-size: 1rem;
  }

  .quiz-navigation {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Améliorer les zones tactiles sur mobile */
  .form-check {
    padding: 16px;
    min-height: 52px;
  }

  .form-check input[type="radio"],
  .form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  /* Slider plus grand sur mobile */
  .scale-container input[type="range"]::-webkit-slider-thumb {
    width: 32px;
    height: 32px;
  }

  .scale-container input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
  }

  .scale-container input[type="range"] {
    height: 8px;
  }

  .octane-quiz-home {
    padding: 48px 24px;
    margin: 32px 16px;
  }

  .quiz-cta h2 {
    font-size: 1.75rem;
  }

  .quiz-cta p {
    font-size: 0.938rem;
  }

  .quiz-features {
    flex-direction: column;
    gap: 12px;
  }

  .feature {
    width: 100%;
    justify-content: center;
  }

  .quiz-icon {
    width: 64px;
    height: 64px;
  }

  .quiz-icon svg {
    width: 32px;
    height: 32px;
  }

  .octane-results-container h1 {
    font-size: 1.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
  }

  .product-image {
    height: 240px;
  }

  .product-name {
    font-size: 0.938rem;
    padding: 12px 16px 6px;
    min-height: 56px;
  }

  .product-price {
    font-size: 1.25rem;
    padding: 6px 16px 12px;
  }

  .product-card .btn-primary {
    margin: 0 16px 16px;
    width: calc(100% - 32px);
    padding: 10px 20px;
  }

  .product-brand {
    font-size: 0.625rem;
    padding: 4px 10px;
    top: 10px;
    left: 10px;
  }

  .match-score {
    font-size: 0.688rem;
    padding: 6px 10px;
    top: 10px;
    right: 10px;
  }

  .match-score svg {
    width: 10px;
    height: 10px;
  }

  .octane-loader-content {
    margin: 0 16px;
    padding: 32px 24px;
  }
}

.octane-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.octane-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.octane-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.octane-modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.octane-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-light);
}

.octane-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
  color: var(--text-dark);
}

.octane-modal .octane-quiz-container {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
}

.octane-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.octane-widget-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.octane-widget-trigger:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.widget-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-icon svg {
  width: 24px;
  height: 24px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.widget-text {
  white-space: nowrap;
}

.widget-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid white;
}

.octane-product-quiz-cta {
  background: linear-gradient(135deg, #fef3f2 0%, #fee2e2 100%);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}

.octane-product-quiz-cta h3 {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 600;
}

.octane-product-quiz-cta p {
  color: var(--text-light);
  margin-bottom: 16px;
  font-size: 0.938rem;
}

.octane-header-quiz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.octane-header-quiz:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .octane-modal-content {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .octane-widget {
    bottom: 16px;
    right: 16px;
  }

  .octane-widget-trigger {
    padding: 14px 20px;
    font-size: 0.875rem;
  }

  .widget-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Chatbot Styles - Floating Window (Non-invasive) */
#octane-quiz-chatbot {
  /* Override modal for floating behavior */
  display: none;
  position: fixed;
  top: auto;
  left: auto;
  bottom: 100px;
  right: 24px;
  width: auto;
  height: auto;
  z-index: 9998;
  pointer-events: none;
}

#octane-quiz-chatbot.active {
  display: block;
  pointer-events: auto;
}

/* Hide widget trigger when chatbot is open */
#octane-quiz-chatbot.active~#octane-chatbot-widget,
body:has(#octane-quiz-chatbot.active) #octane-chatbot-widget {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* No overlay for chatbot - allow background interaction */
#octane-quiz-chatbot .octane-modal-overlay {
  display: none;
}

.octane-chatbot-content {
  position: relative;
  width: 400px;
  height: 550px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: chatbotSlideIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes chatbotSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.octane-chatbot-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chatbot-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 20px 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Mode switcher styles removed - no longer needed */

.chatbot-avatar {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}

.chatbot-avatar svg {
  width: 28px;
  height: 28px;
}

.chatbot-info {
  flex: 1;
}

.chatbot-info h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: white;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.813rem;
  opacity: 0.9;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.user-message .message-avatar {
  background: var(--text-light);
}

.message-avatar svg {
  width: 20px;
  height: 20px;
}

.message-content {
  flex: 1;
}

.message-text {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.938rem;
  line-height: 1.5;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
}

.user-message .message-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.message-time {
  font-size: 0.688rem;
  color: var(--text-light);
  margin-top: 4px;
  padding: 0 4px;
}

.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  width: fit-content;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) {
  animation-delay: -0.32s;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  40% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.chatbot-thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
  border-radius: 12px;
  border-left: 3px solid var(--primary);
  width: fit-content;
  max-width: 320px;
}

.thinking-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.thinking-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thinking-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.thinking-subtitle {
  font-size: 0.75rem;
  color: var(--text-light);
}

.thinking-message {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.chatbot-input-container {
  padding: 16px 24px;
  background: white;
  border-top: 1px solid var(--border);
}

/* Chatbot loader specific styles */
.octane-chatbot-container .octane-loader-overlay {
  position: absolute;
  z-index: 100;
}

.chatbot-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 0.938rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: all 0.2s;
  line-height: 1.5;
}

.chatbot-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fafbff;
}

.chatbot-input:disabled {
  background: var(--bg-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.chatbot-send-btn {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.chatbot-send-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  opacity: 0.5;
}

.chatbot-send-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {

  /* Floating chatbot on mobile */
  #octane-quiz-chatbot {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .octane-chatbot-content {
    width: 100%;
    height: 70vh;
    max-height: calc(100vh - 100px);
    border-radius: 16px;
  }

  .chatbot-messages {
    padding: 16px;
  }

  .message {
    max-width: 90%;
  }

  .chatbot-input-container {
    padding: 12px 16px;
  }

  /* Améliorer le bouton d'envoi sur mobile */
  .chatbot-send-btn {
    width: 48px;
    height: 48px;
  }
}

/* ============================================
   Dialog d'accroche pour les flâneurs
   ============================================ */

.octane-help-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.octane-help-dialog.active {
  opacity: 1;
  pointer-events: all;
}

.octane-help-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.octane-help-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  text-align: center;
  transition: transform 0.3s ease;
}

.octane-help-dialog.active .octane-help-content {
  transform: translate(-50%, -50%) scale(1);
}

.octane-help-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: pulse-icon 2s ease-in-out infinite;
}

.octane-help-icon svg {
  width: 32px;
  height: 32px;
}

@keyframes pulse-icon {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }
}

.octane-help-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.octane-help-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.octane-help-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
}

.octane-help-btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.octane-help-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.octane-help-btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.octane-help-btn-secondary:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

@media (max-width: 768px) {
  .octane-help-content {
    padding: 24px;
    width: 85%;
  }

  .octane-help-title {
    font-size: 1.125rem;
  }

  .octane-help-icon {
    width: 56px;
    height: 56px;
  }

  .octane-help-icon svg {
    width: 28px;
    height: 28px;
  }
}

/* History Page Styles */
.octane-history-container {
  max-width: 1200px;
  /* Wider container for history */
  margin: 0 auto;
  padding: 32px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.history-header {
  margin-bottom: 32px;
  text-align: center;
}

.history-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.history-subtitle {
  font-size: 1.063rem;
  color: var(--text-light);
}

/* Tabs */
.history-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.history-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.history-tab:hover {
  color: var(--primary);
  background: var(--bg-light);
}

.history-tab.active {
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Panels */
.history-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.history-panel.active {
  display: block;
}

/* History List Grid */
.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Cards */
.history-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.history-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-header {
  padding: 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-weight: 500;
}

.card-badge {
  background: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-badge {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body {
  padding: 20px;
  flex: 1;
}

.card-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  text-align: right;
}

/* Quiz Card Specifics */
.answers-summary {
  color: var(--text-dark);
  font-size: 0.938rem;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.products-preview {
  display: flex;
  gap: 8px;
  align-items: center;
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.product-thumb:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-products {
  font-size: 0.813rem;
  color: var(--text-light);
  font-weight: 600;
  padding: 0 8px;
}

/* Conversation Card Specifics */
.conversation-preview {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.conversation-preview .avatar {
  width: 40px;
  height: 40px;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-content {
  flex: 1;
  overflow: hidden;
}

.preview-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 2px;
}

.preview-text {
  color: var(--text-dark);
  font-size: 0.938rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.813rem;
  color: var(--text-light);
}

/* Empty State */
.history-empty {
  text-align: center;
  padding: 64px 20px;
  background: white;
  border-radius: 16px;
  border: 2px dashed var(--border);
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.history-empty h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.history-empty p {
  color: var(--text-light);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Conversation Detail Modal */
.conversation-detail-modal {
  max-width: 600px;
  width: 100%;
  height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  /* Override default padding */
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: white;
  z-index: 10;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.modal-date {
  font-size: 0.875rem;
  color: var(--text-light);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-light);
}

.conversation-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--text-light);
}

.message.assistant .message-avatar {
  color: var(--primary);
}

.message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.message.user .message-content {
  background: var(--primary);
  color: white;
  border-radius: 12px 12px 0 12px;
}

.message.assistant .message-content {
  border-radius: 12px 12px 12px 0;
}

.message-role {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  opacity: 0.7;
  font-weight: 600;
}

.message-text {
  margin: 0;
  line-height: 1.5;
  font-size: 0.938rem;
  white-space: pre-wrap;
}

/* Loading Spinner for Modal */
.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 40px auto;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
  .history-card {
    margin: 0;
  }

  .history-tabs {
    flex-direction: column;
    gap: 8px;
  }

  .conversation-detail-modal {
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
}

/* ==================== PRODUCT CARDS IN CHAT ==================== */

.product-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.message .product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  width: 200px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.message .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.message .product-card.removed {
  opacity: 0;
  transform: scale(0.8) translateY(10px);
  transition: all 0.3s ease;
}

.product-card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--bg-light);
}

.product-card-info {
  padding: 10px;
}

.product-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 4px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-brand {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.product-card-price {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card-upsell-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

.product-card-recommend-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.message .product-card.product-card-recommend {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), var(--shadow-sm);
}

.message .product-card.product-card-recommend:hover {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), var(--shadow-md);
}

.product-card-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}

.product-card-actions button,
.product-card-actions a {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
}

.btn-add-cart {
  background: var(--primary);
  color: white !important;
}

.btn-add-cart:hover {
  background: var(--primary-dark);
}

.btn-add-cart.added {
  background: var(--success);
  cursor: default;
}

.btn-remove-cart {
  background: #ef4444;
  color: white !important;
}

.btn-remove-cart:hover {
  background: #dc2626;
}

.btn-view-product {
  background: var(--bg-light);
  color: var(--text-dark) !important;
  border: 1px solid var(--border) !important;
}

.btn-view-product:hover {
  background: #e5e7eb;
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.octane-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.938rem;
  font-weight: 500;
  z-index: 100001;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 90vw;
  text-align: center;
}

.octane-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.octane-toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.octane-toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.octane-toast-info {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

/* Mobile responsive for product cards */
@media (max-width: 768px) {
  .product-cards {
    flex-direction: column;
  }

  .message .product-card {
    width: 100%;
  }

  .octane-toast {
    bottom: 80px;
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(20px);
  }

  .octane-toast.show {
    transform: translateX(0) translateY(0);
  }
}