/**
 * 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 */
#smartfence-embed-root .recommendation-question { 
  padding: 16px;
  background: transparent;
  margin: 0;
  width: 100%;
}

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

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

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

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

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

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

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

#smartfence-embed-root .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;
}

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

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

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

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

#smartfence-embed-root .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 */
#smartfence-embed-root .question-actions { 
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #a5a6a6;
  display: flex;
  justify-content: flex-start;
}

#smartfence-embed-root .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;
}

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

/* Recommendation Results */
#smartfence-embed-root .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 */
#smartfence-embed-root .recommendation-primary { 
  border: 2px solid var(--primary-color, #4CAF50);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
}

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

/* Recommendation Badge */
#smartfence-embed-root .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);
}

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

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

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

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

#smartfence-embed-root .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;
}

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

#smartfence-embed-root .recommendation-section { 
  margin: 20px 0;
}

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

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

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

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

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

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

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

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

#smartfence-embed-root .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);
}

#smartfence-embed-root .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);
}

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

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

  #smartfence-embed-root .question-text { 
    font-size: 16px;
  }

  #smartfence-embed-root .recommendation-option { 
    padding: 12px;
  }

  #smartfence-embed-root .option-icon { 
    font-size: 20px;
  }


  #smartfence-embed-root .fence-recommendation { 
    padding: 16px;
  }

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

  #smartfence-embed-root .recommendation-title { 
    font-size: 18px;
  }

  #smartfence-embed-root .recommendation-actions { 
    flex-direction: column;
  }

  #smartfence-embed-root .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);
  }
}

#smartfence-embed-root .fence-recommendation { 
  animation: slideIn 0.4s ease-out;
}

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

#smartfence-embed-root .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);
  }
}
/* Checkbox Option Styles */
#smartfence-embed-root .checkbox-option { 
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

#smartfence-embed-root .checkbox-option .option-checkbox { 
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary-color, #4CAF50);
}

#smartfence-embed-root .checkbox-option .option-content { 
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

#smartfence-embed-root .checkbox-option:has(.option-checkbox:checked) { 
  border-color: var(--primary-color, #4CAF50);
  background: var(--primary-bg, #f8fff9);
}

/* Submit Button for Multiple Choice */
#smartfence-embed-root .recommendation-submit-button { 
  padding: 12px 24px;
  background: var(--primary-color, #4CAF50);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 8px;
}

#smartfence-embed-root .recommendation-submit-button:hover:not(:disabled) { 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

#smartfence-embed-root .recommendation-submit-button:active:not(:disabled) { 
  transform: translateY(0);
}

#smartfence-embed-root .recommendation-submit-button:disabled { 
  opacity: 0.5;
  cursor: not-allowed;
  background: #ccc;
}

/* Question Actions Container */
#smartfence-embed-root .question-actions { 
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* Question Type Indicator */
#smartfence-embed-root .question-type-indicator { 
  display: inline-block;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
  margin-bottom: 8px;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 4px;
}

#smartfence-embed-root .question-type-indicator.multiple { 
  background: var(--primary-bg, #f0fdf4);
  color: var(--primary-color, #4CAF50);
}