/* 舒心护理 - 智能体对话组件样式 */

/* 对话按钮 */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #A8D5BA 0%, #7CB89F 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(168, 213, 186, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(168, 213, 186, 0.6);
}

.chat-button .icon {
    font-size: 28px;
}

.chat-button .notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF6B6B;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    display: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(168, 213, 186, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(168, 213, 186, 0.8);
    }
}

/* 对话窗口 */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.open {
    display: flex;
}

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

/* 对话窗口头部 */
.chat-header {
    background: linear-gradient(135deg, #A8D5BA 0%, #7CB89F 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header .title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header .title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header .title .status {
    font-size: 12px;
    opacity: 0.9;
}

.chat-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 对话消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F9F9F9;
}

.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

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

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

.message.assistant .avatar {
    background: linear-gradient(135deg, #A8D5BA 0%, #7CB89F 100%);
}

.message.user .avatar {
    background: #E8E8E8;
}

.message .content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.assistant .content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message.user .content {
    background: linear-gradient(135deg, #A8D5BA 0%, #7CB89F 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    border-bottom-left-radius: 4px;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background: #A8D5BA;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

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

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #F0F0F0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

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

.chat-input button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #A8D5BA 0%, #7CB89F 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(168, 213, 186, 0.4);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        bottom: 80px;
        right: 20px;
    }
    
    .chat-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}
