/**
 * Fence Recommendation Chatbot Styles
 * Styling for the recommendation question flow and results
 * Matches the existing chatbot message styling
 */

/* Recommendation Question Container - matches bot message style */
.recommendation-question {
  padding: 16px;
  background: transparent;
  margin: 0;
  width: 100%;
}

/* Progress Bar */
.question-progress {
  margin-bottom: 16px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #2196F3);
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* Question Text - matches chatbot message style */
.question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 6px;
  line-height: 1.4;
}

.question-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  margin-left: 0;
  padding-left: 0;
  line-height: 1.5;
}

/* Question Options */
.question-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 12px 0;
}

.recommendation-option {
  display: block;
  padding: 14px 16px;
  background: white;
  border: 1px solid #a5a6a6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  /* Ensure the button is clickable */
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.recommendation-option:hover {
  border-color: #4CAF50;
  background: #f8fff9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.recommendation-option:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.option-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  /* Prevent content from blocking clicks */
  pointer-events: none;
}

.option-label {
  font-weight: 500;
  color: var(--text-primary, #111827);
  display: block;
  font-size: 15px;
}

.option-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
  margin-left: 0;
  padding-left: 0;
  text-align: left;
}

/* Question Actions */
.question-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #a5a6a6;
  display: flex;
  justify-content: flex-start;
}

.recommendation-back-button {
  padding: 8px 14px;
  background: white;
  border: 1px solid #a5a6a6;
  border-radius: 5px;
  color: var(--text-primary, #111827);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recommendation-back-button:hover {
  background: var(--bg-secondary, #f8f9fa);
  border-color: #adb5bd;
  color: var(--text-primary, #111827);
}

/* Recommendation Results */
.fence-recommendation {
  background: white;
  border: 1px solid #a5a6a6;
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* Primary vs Secondary Recommendation Styling */
.recommendation-primary {
  border: 2px solid var(--primary-color, #4CAF50);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
}

.recommendation-secondary {
  border: 1px solid #a5a6a6;
  opacity: 0.95;
}

/* Recommendation Badge */
.recommendation-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.badge-primary {
  background: linear-gradient(135deg, var(--primary-color, #4CAF50), #45a049);
  color: white;
}

.badge-secondary {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
}

.recommendation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #a5a6a6;
}

.recommendation-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0;
}

.recommendation-score {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--primary-color, #4CAF50), var(--primary-dark, #2196F3));
  color: white;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
}

.recommendation-description {
  font-size: 15px;
  color: var(--text-primary, #111827);
  line-height: 1.6;
  margin: 16px 0;
}

.recommendation-section {
  margin: 20px 0;
}

.recommendation-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0 0 12px 0;
}

.recommendation-section ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: none;
}

.recommendation-section li {
  position: relative;
  padding: 6px 0 6px 24px;
  font-size: 16px;
  color: var(--text-primary, #111827);
  line-height: 1.5;
}

.recommendation-section li:before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--primary-color, #4CAF50);
  font-weight: bold;
}

.recommendation-section.considerations li:before {
  content: "\2022";
  color: #ffc107;
}

/* Recommendation Notice */
.recommendation-notice {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 16px;
  font-weight: 500;
}

.pool-notice {
  background: #e3f2fd;
  color: #1976d2;
  border-left: 4px solid #2196F3;
}

/* Recommendation Actions */
.recommendation-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.recommendation-select {
  flex: 1;
  min-width: 200px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary-color, #4CAF50), var(--primary-dark, #45a049));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.recommendation-select:hover {
  background: white;
  color: var(--primary-color, #4CAF50);
  border: 2px solid var(--primary-color, #4CAF50);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.recommendation-select:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .recommendation-question {
    padding: 16px;
  }

  .question-text {
    font-size: 16px;
  }

  .recommendation-option {
    padding: 12px;
  }

  .option-icon {
    font-size: 20px;
  }


  .fence-recommendation {
    padding: 16px;
  }

  .recommendation-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .recommendation-title {
    font-size: 18px;
  }

  .recommendation-actions {
    flex-direction: column;
  }

  .recommendation-select {
    width: 100%;
    min-width: unset;
  }
}

/* Animation for recommendations appearing */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fence-recommendation {
  animation: slideIn 0.4s ease-out;
}

/* Loading state */
.recommendation-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  color: #6c757d;
  font-size: 16px;
}

.recommendation-loading:before {
  content: "";
  width: 20px;
  height: 20px;
  border: 3px solid #e9ecef;
  border-top-color: #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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