.ai-assistant {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--gray-1);
  border-left: 1px solid var(--gray-4);
}

.ai-header {
  background: var(--gray-2);
  border-bottom: 1px solid var(--gray-4);
  min-height: 40px;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  background: var(--gray-1);
}

.ai-empty {
  height: 100%;
  text-align: center;
}

.ai-message {
  animation: fadeIn 0.3s ease-in;
}

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

.ai-message-user {
  margin-left: 20%;
}

.ai-message-assistant {
  margin-right: 20%;
}

.ai-input-container {
  background: var(--gray-2);
  border-top: 1px solid var(--gray-4);
}

.ai-input-wrapper {
  position: relative;
}

.ai-send-button {
  position: absolute !important;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px !important;
  min-width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  font-size: 14px !important;
  cursor: pointer;
}

.ai-setup {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Typing indicator */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
}

.ai-typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-9);
  animation: typing 1.4s infinite;
}

.ai-typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .ai-message-user {
    margin-left: 10%;
  }

  .ai-message-assistant {
    margin-right: 10%;
  }
}

/* Tool call messages */
.ai-tool-message {
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

/* Markdown content styles */
.ai-message pre {
  margin: 0;
  overflow-x: auto;
}

.ai-message code {
  background: var(--gray-3);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

.ai-message pre code {
  background: none;
  padding: 0;
}

/* Text wrapping */
.ai-message-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.ai-message-content p,
.ai-message-content li {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Ensure code blocks have horizontal scroll */
.ai-message-content pre {
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 800px) {
  .ai-message-user,
  .ai-message-assistant {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Pulse animation for running status */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}
