/* 智能客服浮动图标样式 */
.wp-ai-cn-chatbot-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

.wp-ai-cn-chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.wp-ai-cn-chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.wp-ai-cn-chatbot-trigger svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.wp-ai-cn-chatbot-trigger .chat-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.wp-ai-cn-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wp-ai-cn-chatbot-window.active {
    display: flex;
}

.wp-ai-cn-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wp-ai-cn-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-ai-cn-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-ai-cn-chatbot-avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.wp-ai-cn-chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wp-ai-cn-chatbot-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.wp-ai-cn-chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.wp-ai-cn-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wp-ai-cn-chatbot-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.wp-ai-cn-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f8fa;
}

.wp-ai-cn-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.wp-ai-cn-chatbot-message.user {
    flex-direction: row-reverse;
}

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

.wp-ai-cn-chatbot-message.bot .wp-ai-cn-chatbot-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wp-ai-cn-chatbot-message.user .wp-ai-cn-chatbot-message-avatar {
    background: #e9ecef;
}

.wp-ai-cn-chatbot-message-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.wp-ai-cn-chatbot-message.user .wp-ai-cn-chatbot-message-avatar svg {
    fill: #667eea;
}

.wp-ai-cn-chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.wp-ai-cn-chatbot-message.bot .wp-ai-cn-chatbot-message-content {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wp-ai-cn-chatbot-message.user .wp-ai-cn-chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.wp-ai-cn-chatbot-message-time {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 4px;
    padding: 0 4px;
}

.wp-ai-cn-chatbot-message.user .wp-ai-cn-chatbot-message-time {
    text-align: right;
}

.wp-ai-cn-chatbot-typing {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: fit-content;
}

.wp-ai-cn-chatbot-typing.active {
    display: flex;
}

.wp-ai-cn-chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: wp-ai-cn-chatbot-typing 1.4s infinite ease-in-out both;
}

.wp-ai-cn-chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.wp-ai-cn-chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }
.wp-ai-cn-chatbot-typing span:nth-child(3) { animation-delay: 0s; }

@keyframes wp-ai-cn-chatbot-typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.wp-ai-cn-chatbot-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.wp-ai-cn-chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wp-ai-cn-chatbot-input input:focus {
    border-color: #667eea;
}

.wp-ai-cn-chatbot-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.wp-ai-cn-chatbot-input button:hover {
    transform: scale(1.05);
}

.wp-ai-cn-chatbot-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wp-ai-cn-chatbot-input button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.wp-ai-cn-chatbot-welcome {
    text-align: center;
    padding: 40px 20px;
}

.wp-ai-cn-chatbot-welcome-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-ai-cn-chatbot-welcome-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.wp-ai-cn-chatbot-welcome h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
}

.wp-ai-cn-chatbot-welcome p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .wp-ai-cn-chatbot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .wp-ai-cn-chatbot-trigger {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}
