/* 大地AI哨兵AI对话组件样式 */

/* 聊天按钮 */
#zhinong-ai-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: all 0.3s ease;
}

#zhinong-ai-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.chat-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 聊天窗口 */
#zhinong-ai-window {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#zhinong-ai-window.fullscreen {
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    z-index: 9999;
}

#zhinong-ai-window.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* 聊天窗口头部 */
.chat-header {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-fullscreen-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #495057;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chat-fullscreen-btn:hover {
    background-color: #e9ecef;
}

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

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 聊天窗口主体 */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
    max-height: calc(100vh - 160px);
}

#zhinong-ai-window.fullscreen .chat-body {
    max-height: calc(100vh - 120px);
}

/* 聊天消息 */
.chat-message {
    display: flex;
    margin-bottom: 15px;
    gap: 10px;
}

.ai-message {
    flex-direction: flex-start;
}

.user-message {
    flex-direction: row-reverse;
}

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

.ai-avatar {
    background: #E8F5E9;
    color: #2E7D32;
}

.user-avatar {
    background: #E3F2FD;
    color: #1976D2;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
}

.ai-message .message-content {
    background: white;
    border: 1px solid #E8F5E9;
    border-bottom-left-radius: 5px;
}

.user-message .message-content {
    background: #4CAF50;
    color: white;
    border-bottom-right-radius: 5px;
}

/* 聊天图片 */
.chat-image {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 5px;
}

/* 输入指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: white;
    border: 1px solid #E8F5E9;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
}

.typing-dots .dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 聊天窗口底部 */
.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #E0E0E0;
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-upload-btn {
    background: none;
    border: 1px solid #E0E0E0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #757575;
    transition: all 0.2s ease;
}

.chat-upload-btn:hover {
    background: #F5F5F5;
    color: #4CAF50;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    border-color: #4CAF50;
}

.chat-send-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 480px) {
    #zhinong-ai-button {
        bottom: 20px;
        right: 20px;
        padding: 10px 15px;
    }

    #zhinong-ai-window {
        bottom: 80px;
        right: 20px;
        left: 20px;
        width: auto;
        height: 400px;
    }

    .message-content {
        max-width: 80%;
    }
}

/* 详情查看功能样式 */
.response-summary {
    margin-bottom: 10px;
}

.response-detail {
    margin: 10px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

.response-detail p {
    margin: 10px 0;
}

.response-detail ul, .response-detail ol {
    margin: 10px 0;
    padding-left: 20px;
}

.response-detail li {
    margin: 5px 0;
}

.view-detail-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.view-detail-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}
