/**
 * WP Chatbox 样式
 */

/* 主容器 */
#wp-chatbox-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

/* 聊天按钮 */
#wp-chatbox-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 2px 6px rgba(91, 141, 190, 0.2);
    transition: all 0.3s ease;
}

#wp-chatbox-button img {
    width: 100%;
    height: 100%;
    display: block;
}

#wp-chatbox-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 
                0 3px 8px rgba(91, 141, 190, 0.3);
}

/* 聊天窗口 */
#wp-chatbox-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 隐藏类 */
.wp-chatbox-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

/* 聊天窗口标题栏 */
#wp-chatbox-header {
    background-color: #4caf50;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#wp-chatbox-title {
    font-weight: bold;
    font-size: 16px;
}

#wp-chatbox-controls {
    display: flex;
}

#wp-chatbox-minimize {
    cursor: pointer;
    padding: 5px;
}

/* 消息区域 */
#wp-chatbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 消息容器 */
.wp-chatbox-message-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    width: 100%;
}

/* 头像样式 */
.wp-chatbox-avatar {
    width: 32px;
    height: 40px;
    flex-shrink: 0;
    margin: 2px 8px;
    background-size: cover;
    background-position: center;
}

/* 用户头像特殊样式 */
.wp-chatbox-avatar-user {
    background-color: #e6f2ff;
    border-radius: 50%;
}

/* 机器人头像特殊样式 */
.wp-chatbox-avatar-bot {
    background-color: #f0f0f0;
    border-radius: 0; /* 方形头像 */
}

/* 消息样式 */
.wp-chatbox-message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.wp-chatbox-message-user {
    background-color: #e6f2ff;
    border-bottom-right-radius: 4px;
    margin-left: auto; /* 靠右对齐 */
}

.wp-chatbox-message-bot {
    background-color: #f0f0f0;
    border-bottom-left-radius: 4px;
    margin-right: auto; /* 靠左对齐 */
}

/* 调整用户消息容器排列方向 */
.wp-chatbox-message-container:has(.wp-chatbox-message-user) {
    flex-direction: row-reverse; /* 用户消息和头像靠右 */
}

/* 输入区域 */
#wp-chatbox-input-container {
    padding: 10px;
    display: flex;
    align-items: center;
    border-top: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

#wp-chatbox-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 8px 15px;
    resize: none;
    max-height: 100px;
    min-height: 24px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

#wp-chatbox-send {
    background-color: transparent;
    border: none;
    color: #4caf50;
    padding: 8px;
    cursor: pointer;
    margin-left: 5px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

#wp-chatbox-send:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

/* 打字指示器 */
#wp-chatbox-typing {
    padding: 10px 15px;
}

.wp-chatbox-typing-indicator {
    display: flex;
    align-items: center;
}

.wp-chatbox-typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #b6b6b6;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    animation: bounce 1.5s infinite ease-in-out;
}

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

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

.wp-chatbox-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
} 