/* Chat container styles */
.chat-container {
    height: 60vh;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #fafafa;
}

/* Message list styles */
.message-list {
    height: 100%;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    scroll-behavior: smooth;
}

/* Message bubble styles */
.message-bubble {
    display: flex;
    margin-bottom: 16px;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

.user-message {
    justify-content: flex-end;
}

.assistant-message {
    justify-content: flex-start;
}

.system-message {
    justify-content: center;
}

/* Message content styles */
.message-content {
    margin-top: 4px;
    line-height: 1.5;
}

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

.message-content pre {
    margin: 8px 0;
    border-radius: 6px;
    overflow: auto;
}

.message-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.05);
}

.message-content pre code {
    padding: 0;
    background-color: transparent;
}

/* Thinking content styles */
.thinking-content {
    background-color: #f0f0f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    font-style: italic;
    color: #666;
    display: flex;
    align-items: center;
}

.thinking-content .loading-icon {
    margin-right: 8px;
    color: #1890ff;
}

/* Message input styles */
.message-input {
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    background-color: #fff;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #8c8c8c;
}

.typing-indicator span {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #8c8c8c;
    margin-right: 3px;
    animation: typing 1s infinite;
}

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

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .chat-container {
        height: 70vh;
    }

    .message-bubble .ant-card {
        max-width: 90%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chat-container {
        background-color: #1f1f1f;
        border-color: #303030;
    }

    .message-list {
        background-color: #141414;
    }

    .message-input {
        background-color: #1f1f1f;
        border-color: #303030;
    }

    .message-content code {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .thinking-content {
        background-color: #262626;
        color: #a6a6a6;
    }
}