/* 性教育 AI 助手样式 */

#sexedu-ai-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

#sexedu-chat-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

#sexedu-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 消息气泡 */
.sexedu-message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sexedu-user-message {
    background: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.sexedu-ai-message {
    background: #ffffff;
    color: #333;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* 输入区域 */
#sexedu-input-area {
    display: flex;
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

#sexedu-user-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 15px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s;
    min-height: 50px;
    max-height: 150px;
}

#sexedu-user-input:focus {
    outline: none;
    border-color: #007bff;
}

#sexedu-send-btn {
    padding: 12px 32px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

#sexedu-send-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#sexedu-send-btn:active {
    transform: translateY(0);
}

#sexedu-send-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* 加载动画 */
.sexedu-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.sexedu-typing {
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 75%;
}

.sexedu-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.sexedu-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.sexedu-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* 欢迎消息 */
.sexedu-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.sexedu-welcome h3 {
    color: #007bff;
    margin-bottom: 10px;
}

/* 错误消息 */
.sexedu-error {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #sexedu-ai-container {
        padding: 10px;
        margin: 20px auto;
    }
    
    #sexedu-messages {
        height: 400px;
        padding: 15px;
    }
    
    .sexedu-message {
        max-width: 85%;
    }
    
    #sexedu-input-area {
        padding: 15px;
    }
    
    #sexedu-send-btn {
        padding: 12px 24px;
    }
}

/* 滚动条样式 */
#sexedu-messages::-webkit-scrollbar {
    width: 8px;
}

#sexedu-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#sexedu-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#sexedu-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}