/* AI Assistant Component Styles */

.ai-assistant {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  max-width: 400px;
  width: 100%;
  transition: transform 0.3s ease;
  transform: translateY(calc(100% - 50px));
}

.ai-assistant.open {
  transform: translateY(0);
}

.ai-assistant .assistant-header {
  background-color: var(--primary);
  color: #fff;
  padding: 10px 15px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.ai-assistant .assistant-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ai-assistant .assistant-header .assistant-actions {
  display: flex;
  gap: 10px;
}

.ai-assistant .assistant-header .assistant-actions button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.ai-assistant .assistant-header .assistant-actions button:hover {
  color: #fff;
}

.ai-assistant .assistant-body {
  background-color: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ai-assistant .messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ai-assistant .message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.ai-assistant .message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-assistant .message.user .avatar {
  background-color: #e9f5ff;
  color: #1e88e5;
}

.ai-assistant .message.user .content {
  background-color: #e9f5ff;
  border-radius: 15px 2px 15px 15px;
}

.ai-assistant .message.assistant {
  align-self: flex-start;
}

.ai-assistant .message.assistant .avatar {
  background-color: #f5f5f5;
  color: #757575;
}

.ai-assistant .message.assistant .content {
  background-color: #f5f5f5;
  border-radius: 2px 15px 15px 15px;
}

.ai-assistant .message.assistant.error .content {
  background-color: #fff0f0;
  color: #d32f2f;
}

.ai-assistant .message.assistant.warning .content {
  background-color: #fff8e1;
  color: #ff8f00;
}

.ai-assistant .message.table-message,
.ai-assistant .message.workflow-message,
.ai-assistant .message.feature-message {
  max-width: 100%;
  width: 100%;
}

.ai-assistant .message.table-message .content,
.ai-assistant .message.workflow-message .content,
.ai-assistant .message.feature-message .content {
  width: 100%;
}

.ai-assistant .message .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ai-assistant .message .avatar i {
  font-size: 18px;
}

.ai-assistant .message .content {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.ai-assistant .message .content p:last-child {
  margin-bottom: 0;
}

.ai-assistant .message .content pre {
  background-color: #f8f9fa;
  padding: 8px;
  border-radius: 5px;
  margin: 8px 0;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.ai-assistant .message .content code {
  background-color: #f8f9fa;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 90%;
}

.ai-assistant .table-response {
  width: 100%;
}

.ai-assistant .table-response .sql-code {
  margin-bottom: 10px;
}

.ai-assistant .table-response table {
  font-size: 13px;
}

.ai-assistant .table-response table th {
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  font-weight: 600;
  white-space: nowrap;
}

.ai-assistant .table-response table td {
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-assistant .workflow {
  width: 100%;
}

.ai-assistant .workflow h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1976d2;
}

.ai-assistant .workflow .workflow-steps {
  padding-left: 20px;
  margin-bottom: 10px;
}

.ai-assistant .workflow .workflow-steps li {
  margin-bottom: 5px;
}

.ai-assistant .workflow .workflow-explanation {
  font-size: 13px;
  color: #757575;
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 10px;
}

.ai-assistant .feature-recommendation {
  width: 100%;
}

.ai-assistant .feature-recommendation h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1976d2;
}

.ai-assistant .feature-recommendation p {
  margin-bottom: 10px;
}

.ai-assistant .feature-recommendation .feature-explanation {
  font-size: 13px;
  color: #757575;
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 10px;
}

.ai-assistant .input-area {
  padding: 10px;
  border-top: 1px solid #eee;
  position: relative;
}

.ai-assistant .input-area textarea {
  resize: none;
  border-radius: 20px;
  padding-right: 40px;
  font-size: 14px;
  min-height: 40px;
  max-height: 100px;
}

.ai-assistant .input-area button {
  position: absolute;
  right: 20px;
  top: 20px;
  background: none;
  border: none;
  color: #1976d2;
  cursor: pointer;
}

.ai-assistant .input-area button:disabled {
  color: #bdbdbd;
}

.ai-assistant .loading-indicator {
  margin: 10px auto;
  text-align: center;
  color: #757575;
  font-size: 14px;
}

.ai-assistant .loading-indicator .spinner-border {
  width: 20px;
  height: 20px;
  margin-right: 5px;
} 