/* AI Chatbot 样式 */
.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 聊天按钮 */
.chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(14, 165, 233, 0.5);
}

.chat-toggle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.chat-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #14b8a6;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
}

/* 聊天窗口 */
.chat-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.chat-container.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* 聊天头部 */
.chat-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-title h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chat-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-close svg {
    width: 20px;
    height: 20px;
    color: white;
}

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

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageSlide 0.3s ease;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
}

.message-content {
    flex: 1;
    max-width: calc(100% - 48px);
}

.message-text {
    background: white;
    padding: 14px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
}

.message-text p {
    margin: 0 0 8px 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 4px 0;
}

.message-text strong {
    color: #0ea5e9;
}

.user-message .message-text {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

.user-message .message-text strong {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
}

/* 正在输入指示器 */
.typing-indicator .message-content {
    background: white;
    padding: 14px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: fit-content;
}

.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 20px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
        background: #0ea5e9;
    }
}

/* 快捷回复 */
.chat-quick-replies {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply {
    padding: 8px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-reply:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: white;
}

/* 输入区域 */
.chat-input-area {
    padding: 16px 20px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    background: #f1f5f9;
    border-radius: 24px;
    padding: 4px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    background: white;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.chat-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    color: #334155;
}

.chat-input-wrapper input::placeholder {
    color: #94a3b8;
}

.chat-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.chat-send svg {
    width: 18px;
    height: 18px;
    color: white;
}

.chat-input-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .chat-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        position: fixed;
        bottom: 80px;
        right: 16px;
        border-radius: 16px;
    }
    
    .chat-toggle {
        width: 56px;
        height: 56px;
    }
}

/* 欢迎动画 */
.chat-toggle {
    animation: chatBounce 2s infinite;
}

@keyframes chatBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.chat-toggle:hover {
    animation: none;
}

/* ============================================
   预约表单样式
   ============================================ */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.booking-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #334155;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.booking-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.booking-input::placeholder {
    color: #94a3b8;
}

.booking-input[type="textarea"] {
    resize: vertical;
    min-height: 60px;
}

.booking-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.booking-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.booking-submit:active {
    transform: translateY(0);
}

/* ============================================
   聊天内操作按钮
   ============================================ */
.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.chat-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* ============================================
   消息内链接样式
   ============================================ */
.message-text a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.message-text a:hover {
    text-decoration: underline;
}

/* ============================================
   成功状态样式
   ============================================ */
.booking-success {
    text-align: center;
    padding: 20px;
}

.booking-success-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.booking-success h4 {
    color: #059669;
    margin: 0 0 8px;
    font-size: 16px;
}

.booking-success p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}
