/* ========== ENHANCED CHATBOT DESIGNER STYLES ========== */

/* Two-column layout container */
.chatbot-designer-container {
  display: flex;
  gap: 0; /* Remove gap between columns */
  margin-top: 20px;
}

.chatbot-config-column {
  flex: 1;
  min-width: 300px;
  margin-right: 20px; /* Add space between columns */
  margin-left: 20px; /* Add space on the left side to separate from sidebar */
}

.chatbot-preview-column {
  flex: 1;
  min-width: 300px;
  margin-right: 20px; /* Add spacing on the right side */
}

/* Card header with toggle */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Preview toggle switch */
.preview-toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #129ed9;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  color: #555;
}

/* iframe container styles */
.iframe-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
}

#websitePreviewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #f5f7f9;
}

.iframe-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.7);
}

.loading-message, .error-message {
  background-color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  display: none;
  pointer-events: auto;
}

.loading-message.visible, .error-message.visible {
  display: block;
}

.error-message {
  color: #d32f2f;
}

/* Chatbot elements for the iframe */
#iframePreviewChatbotLauncher, #iframePreviewChatbotWindow {
  position: absolute;
  z-index: 2;
}

#iframePreviewChatbotLauncher {
  bottom: 20px;
  right: 20px;
}

#iframePreviewChatbotWindow {
  bottom: 80px;
  right: 20px;
}

/* Settings sections */
.chatbot-setting-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e1e4e8;
}

.chatbot-setting-section h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #333;
}

/* Setting description text */
.setting-description {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* Color input groups with text field */
.color-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-text-input {
  width: 100px;
  padding: 4px 8px;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  font-family: monospace;
}

/* Color preview area */
.chatbot-color-preview {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.color-preview-header {
  background-color: #129ed9;
  color: white;
  padding: 10px;
  text-align: center;
  font-weight: 500;
}

.color-preview-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  min-height: 80px;
}

.color-preview-message {
  background-color: #d7efff;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 12px;
  border-bottom-left-radius: 0;
  font-size: 14px;
  max-width: 70%;
}

/* Avatar upload container */
.avatar-upload-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.avatar-preview {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e1e4e8;
}

.avatar-upload-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-avatar-btn {
  padding: 6px 12px;
  background-color: #f8f9fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.upload-avatar-btn:hover {
  background-color: #f1f2f3;
}

.avatar-url-input {
  font-size: 13px;
}

/* Textarea field */
.textarea-field {
  resize: vertical;
  min-height: 60px;
}

/* Suggestions chips container */
.suggestion-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.suggestion-chip {
  background-color: #f0f4f7;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  border: 1px solid #e1e4e8;
}

.remove-chip-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-chip-btn:hover {
  color: #d32f2f;
}

.add-suggestion-group {
  display: flex;
  gap: 8px;
}

.add-suggestion-btn {
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.add-suggestion-btn:hover {
  background-color: #f1f2f3;
}

/* Toggle setting */
.toggle-setting {
  display: flex;
  align-items: center;
}

.toggle-setting input[type="checkbox"] {
  margin-right: 10px;
}

/* Code snippet panel */
.chatbot-code-panel {
  margin-top: 20px;
}

.close-code-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}

.code-container {
  background-color: #f5f7f9;
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;
  position: relative;
}

pre#chatbotCodeSnippet {
  margin: 0;
  white-space: pre-wrap;
  font-family: monospace;
  overflow-x: auto;
  max-height: 300px;
  font-size: 13px;
}

.copy-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.copy-code-btn:hover {
  background-color: #f1f2f3;
}

/* Website preview */
.chatbot-preview-container {
  padding: 15px;
}

.website-preview {
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  height: 500px;
  position: relative;
}

.website-header {
  background-color: #f5f7f9;
  padding: 10px;
  border-bottom: 1px solid #e1e4e8;
}

.website-url {
  background-color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-family: monospace;
  color: #555;
}

.website-content {
  padding: 20px;
  text-align: center;
}

.website-placeholder {
  height: 20px;
  background-color: #f0f4f7;
  margin: 30px auto;
  max-width: 80%;
  border-radius: 4px;
}

/* Chatbot preview in website */
.preview-chatbot-launcher {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #129ed9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-chatbot-launcher img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.preview-chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 300px;
  height: 380px;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.preview-chatbot-header {
  background-color: #129ed9;
  color: #fff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.preview-chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.preview-message {
  display: flex;
  align-items: flex-end;
  margin-bottom: 15px;
}

.preview-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
}

.preview-bubble {
  background-color: #f0f4f7;
  padding: 8px 12px;
  border-radius: 12px;
  border-bottom-left-radius: 0;
  font-size: 13px;
  max-width: 80%;
}

.preview-chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
}

.preview-suggestion {
  background-color: #f0f4f7;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #e1e4e8;
}

.preview-chatbot-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #e1e4e8;
}

.preview-chatbot-input input {
  flex: 1;
  border: none;
  padding: 8px;
  font-size: 13px;
  outline: none;
  background-color: #f5f7f9;
  border-radius: 20px;
  padding-left: 15px;
}

.preview-chatbot-input button {
  background-color: #129ed9;
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-left: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make the chatbot launcher a bit nicer */
#getaccessibleaiChatbotLauncher {
  transition: transform 0.3s, box-shadow 0.3s;
}

#getaccessibleaiChatbotLauncher:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

#getaccessibleaiChatbotWindow {
  transition: opacity 0.3s, transform 0.3s;
  transform-origin: bottom right;
}

/* Make responsive for small screens */
@media (max-width: 1000px) {
  .chatbot-designer-container {
    flex-direction: column;
  }
  
  .chatbot-preview-column {
    margin-top: 20px;
  }
}

/* Next Section Button Styles */
.next-button-container {
  display: flex;
  justify-content: flex-end;
  margin: 30px 0 15px 0;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.next-section-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #129ed9;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.next-section-button:hover {
  background-color: #0e86ba;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.next-section-button i {
  font-size: 12px;
  margin-left: 2px;
}

.import-products-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-bottom: 10px;
}

.import-products-card #creditsWrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.import-products-card .info-box2 {
  width: 100%;
  text-align: center;
  margin-bottom: 0;
}

.import-products-card .feed-nav-cards {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.import-products-card .feed-card {
  min-width: 140px;
  text-align: center;
}

/* MeshInsights Styles */

/* Tab Navigation */
.insights-tabs-container {
  display: flex;
  gap: 5px;
  margin: 15px 20px;
  border-bottom: 1px solid #e1e4e8;
  padding-bottom: 5px;
}

.insights-tab {
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #666;
  border: 1px solid transparent;
  border-bottom: none;
}

.insights-tab:hover {
  background-color: #f5f7f9;
}

.insights-tab.active {
  color: #129ed9;
  background-color: white;
  border-color: #e1e4e8;
  border-bottom: 2px solid white;
  margin-bottom: -1px;
}

.insights-tab-content {
  padding: 15px 0;
  display: block;
  margin-left: 0; /* Remove left margin since feed-nav-cards has proper centering */
}

.insights-tab-content.hidden {
  display: none;
}

/* Source Labels */
.insights-source-label {
  margin: 25px 20px 10px 20px;
  padding-bottom: 5px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e1e4e8;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Charts Grid */
.charts-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
  gap: 20px;
  margin: 20px;
}

.chart-card {
  background: white;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

.chart-title {
  font-weight: 600;
  color: #444;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-actions {
  display: flex;
  gap: 8px;
}

.chart-close-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.chart-close-btn:hover {
  background-color: #f1f2f3;
  color: #d32f2f;
}

/* Make the insights cards look better */
.insights-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 0 20px 15px 20px;
}

.insights-card {
  background: white;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.insights-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.insights-card-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.insights-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.insights-card-value {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.insights-delta {
  font-size: 13px;
  font-weight: 500;
}

.insights-delta.positive {
  color: #4caf50;
}

.insights-delta.negative {
  color: #f44336;
}

/* Campaign selector */
.campaign-selector {
  margin: 15px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.campaign-selector label {
  font-weight: 500;
  color: #555;
}

.campaign-selector select {
  min-width: 200px;
}

/* Range buttons */
.range-buttons-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 20px;
}

.range-buttons-insights button {
  padding: 8px 15px;
  background-color: #f5f7f9;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.range-buttons-insights button:hover {
  background-color: #eaecef;
}

.range-buttons-insights button.active-range-btn {
  background-color: #129ed9;
  color: white;
  border-color: #129ed9;
}

/* Additional spacing for the info box in insights */
#insightsInterface .info-box2 {
  margin: 15px 20px;
}

/* Monitoring Settings Styles */
.insights-cards2 {
  margin: 20px;
}

.insights-card2 {
  background: white;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.insights-card-monitoring {
  display: flex;
  flex-direction: column;
}

#monitoringSettingsPanel {
  width: 100%;
}

.monitoring-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e1e4e8;
}

.monitoring-setting-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px !important;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.monitoring-setting-row:hover {
  background-color: #f1f2f3;
}

.monitoring-setting-row label {
  font-weight: 500;
  color: #444;
  width: 120px;
}

.monitoring-setting-row select, 
.monitoring-setting-row input {
  border: 1px solid #dfe1e5;
  border-radius: 4px;
  padding: 8px 12px !important;
  font-size: 14px;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.monitoring-setting-row select:focus, 
.monitoring-setting-row input:focus {
  border-color: #129ed9;
  box-shadow: 0 0 0 2px rgba(18,158,217,0.2);
  outline: none;
}

.monitoring-setting-row select {
  width: 140px;
  margin-right: 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 30px !important;
}

.monitoring-setting-row input[type="number"] {
  width: 100px;
}

.monitoring-recipient-row {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e1e4e8;
}

.monitoring-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
}

.monitoring-save-button {
  background-color: #129ed9;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitoring-save-button:hover {
  background-color: #0e8dc1;
}

.monitoring-save-button i {
  font-size: 14px;
}

/* Group monitoring settings visually */
.monitoring-section {
  margin-bottom: 24px;
  padding-bottom: 15px;
}

.monitoring-section-label {
  font-weight: 600;
  color: #444;
  margin-bottom: 12px;
  font-size: 15px;
}

/* Minimal Preview Styles */
.minimal-preview-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.minimal-preview-input-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e6f0;
  padding: 4px;
}

.minimal-preview-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.minimal-preview-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 12px;
  background: transparent;
  min-width: 200px;
  border-radius: 20px;
}

.minimal-preview-send-btn {
  background: #129ed9;
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.minimal-preview-chat-interface {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  max-height: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e1e6f0;
  overflow: hidden;
}

.minimal-preview-chat-header {
  background: #129ed9;
  color: white;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
}

.minimal-preview-minimize-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.minimal-preview-messages {
  padding: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.minimal-preview-message {
  margin-bottom: 8px;
}

.minimal-preview-message.assistant {
  background: #f0f4f7;
  padding: 6px 10px;
  border-radius: 12px;
  border-bottom-left-radius: 0;
  font-size: 11px;
  max-width: 80%;
}

.minimal-preview-welcome {
  color: #333;
}
