/* AI Chat Styles */
.ai-chat-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.ai-chat-window {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 400px;
  max-width: calc(100vw - 2rem);
  height: 600px;
  max-height: calc(100vh - 4rem);
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.ai-chat-window.open {
  display: flex;
}
.ai-chat-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-chat-header h3 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
}
.ai-chat-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}
.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ai-message {
  display: flex;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-message.user {
  flex-direction: row-reverse;
}
.ai-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.ai-message.assistant .ai-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
.ai-message.user .ai-message-avatar {
  background: var(--accent-color);
  color: white;
}
.ai-message-content {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
}
.ai-message.assistant .ai-message-content {
  background: var(--bg-secondary);
  border-bottom-left-radius: 4px;
}
.ai-message.user .ai-message-content {
  background: var(--bg-secondary);
  color: white;
  border-bottom-right-radius: 4px;
}
.ai-message-content code {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}
.ai-message-content pre {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.75rem 0;
  border-left: 3px solid rgba(102, 126, 234, 0.5);
}
.ai-message-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.5;
}
/* Enhanced formatting styles */
.ai-message-content strong {
  font-weight: 600;
  color: var(--text-primary);
}
.ai-message-content em {
  font-style: italic;
}
.ai-message-content a {
  color: #667eea;
  text-decoration: underline;
  word-break: break-all;
}
.ai-message-content a:hover {
  color: #764ba2;
}
.ai-message-content a.auto-link {
  font-size: 0.9em;
  opacity: 0.9;
}
.ai-message-content a.auto-link::before {
  content: '🔗 ';
  font-size: 0.8em;
}
.ai-message-content ul,
.ai-message-content ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
.ai-message-content h3,
.ai-message-content h4 {
  margin: 0.75rem 0 0.5rem 0;
  font-weight: 600;
  color: var(--text-primary);
}
.ai-message-content h3 {
  font-size: 1.1em;
}
.ai-message-content h4 {
  font-size: 1em;
}
.ai-message-content p {
  margin: 0.5rem 0;
}
.ai-message-content p:first-child {
  margin-top: 0;
}
.ai-message-content p:last-child {
  margin-bottom: 0;
}
.ai-chat-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}
.ai-chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
}
.ai-chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.ai-chat-input:focus {
  border-color: #667eea;
}
.ai-chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.ai-chat-send:hover:not(:disabled) {
  transform: scale(1.05);
}
.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ai-typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
}
.ai-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing 1.4s infinite;
}
.ai-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.ai-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}
.ai-chat-welcome {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
}
.ai-chat-welcome i {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ai-chat-welcome h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}
.ai-chat-welcome p {
  margin: 0;
  font-size: 0.9rem;
}
@media (max-width: 768px) {
  .ai-chat-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 4rem);
    bottom: 1rem;
    right: 1rem;
  }
  .ai-chat-button {
    bottom: 1rem;
    right: 1rem;
  }
}