/**
 * WORKFLOW TOOLS AI INTERFACE STYLES
 * Universal AI chat styling for all workflow tools
 * January 2026
 */

.workflow-tool-ai-interface {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: all 0.3s ease;
}

.workflow-tool-ai-interface.collapsed {
  max-height: 60px;
}

.workflow-tool-ai-interface.collapsed .ai-chat-body {
  display: none;
}

/* Header */
.ai-chat-header {
  background: linear-gradient(135deg, #0B2545 0%, #123A63 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.ai-icon {
  font-size: 24px;
}

.ai-chat-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  transition: background 0.2s ease;
}

.ai-chat-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Body */
.ai-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Messages */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f7f9fc;
}

.ai-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message-user {
  align-self: flex-end;
}

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

.ai-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ai-message-user .ai-message-content {
  background: #17BEBB;
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message-assistant .ai-message-content {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.ai-message-error .ai-message-content {
  background: #fee;
  border-color: #fcc;
  color: #c00;
}

/* Suggestions List */
.ai-suggestions-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-suggestion-item {
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  color: #1e40af;
}

.ai-suggestion-item:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateX(4px);
}

/* Typing Indicator */
.ai-typing .ai-message-content {
  padding: 16px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Input Container */
.ai-chat-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s ease;
}

.ai-chat-input:focus {
  outline: none;
  border-color: #17BEBB;
  box-shadow: 0 0 0 3px rgba(23, 190, 187, 0.1);
}

.ai-chat-send {
  background: #17BEBB;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-chat-send:hover {
  background: #13a09d;
  transform: scale(1.05);
}

.ai-chat-send:active {
  transform: scale(0.95);
}

/* Footer */
.ai-chat-footer {
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
  border-top: 1px solid #e5e7eb;
}

.ai-disclaimer {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  display: block;
}

/* Message Content Formatting */
.ai-message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.ai-message-content li {
  margin: 4px 0;
}

.ai-message-content strong {
  font-weight: 600;
  color: inherit;
}

.ai-message-content em {
  font-style: italic;
}

.ai-message-content p {
  margin: 8px 0;
}

.ai-message-content p:first-child {
  margin-top: 0;
}

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

/* Scrollbar Styling */
.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .workflow-tool-ai-interface {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 10px;
    max-height: 500px;
  }
  
  .ai-chat-header {
    padding: 14px 16px;
  }
  
  .ai-chat-title {
    font-size: 15px;
  }
  
  .ai-chat-messages {
    padding: 16px;
  }
  
  .ai-message {
    max-width: 90%;
  }
  
  .ai-message-content {
    font-size: 13px;
  }
  
  .ai-chat-input-container {
    padding: 12px;
  }
}

/* Accessibility */
.ai-chat-input:focus-visible,
.ai-chat-send:focus-visible,
.ai-chat-toggle:focus-visible {
  outline: 2px solid #17BEBB;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .workflow-tool-ai-interface {
    display: none;
  }
}



