/**
 * 正百翔·智选 AI智能客服悬浮窗口样式
 */

/* 聊天窗口头部 */
#ai-chat-window .chat-header {
    background: linear-gradient(135deg, #c8102e 0%, #a00d24 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-chat-window .header-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: bold;
}

#ai-chat-window .header-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

#ai-chat-window .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    transition: transform 0.2s;
}

#ai-chat-window .close-btn:hover {
    transform: rotate(90deg);
}

/* 消息区域 */
#ai-chat-window .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    max-height: 400px;
}

#ai-chat-window .message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

#ai-chat-window .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #c8102e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    margin-right: 10px;
}

#ai-chat-window .user-avatar {
    background: #667eea;
    order: 2;
    margin-right: 0;
    margin-left: 10px;
}

#ai-chat-window .message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#ai-chat-window .user-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    order: 1;
}

#ai-chat-window .message-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* 输入区域 */
#ai-chat-window .chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#ai-chat-window #chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    transition: border-color 0.3s;
}

#ai-chat-window #chat-input:focus {
    outline: none;
    border-color: #c8102e;
}

#ai-chat-window .send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #c8102e 0%, #a00d24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#ai-chat-window .send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

#ai-chat-window .send-btn:active {
    transform: translateY(0);
}

/* 底部信息 */
#ai-chat-window .chat-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #eee;
}

/* AI徽章 */
#ai-chat-float-button .ai-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ffd700;
    color: #333;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* 滚动条样式 */
#ai-chat-window .chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* 移动端适配 */
@media (max-width: 768px) {
    #ai-chat-window {
        width: calc(100vw - 40px) !important;
        max-height: 70vh;
        ${AI_CHAT_CONFIG.position}: 20px !important;
        bottom: 100px !important;
    }
    
    #ai-chat-float-button {
        ${AI_CHAT_CONFIG.position}: 20px !important;
        bottom: 20px !important;
        width: 50px;
        height: 50px;
    }
    
    #ai-chat-window .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    #ai-chat-window {
        width: calc(100vw - 20px) !important;
        ${AI_CHAT_CONFIG.position}: 10px !important;
        bottom: 80px !important;
        border-radius: 8px;
    }
    
    #ai-chat-float-button {
        ${AI_CHAT_CONFIG.position}: 10px !important;
        bottom: 10px !important;
        width: 45px;
        height: 45px;
    }
    
    #ai-chat-window .chat-header {
        padding: 15px;
    }
    
    #ai-chat-window .header-info h3 {
        font-size: 14px;
    }
    
    #ai-chat-window .header-info p {
        font-size: 11px;
    }
}
