/* Be-Tech AI Chat - Brand Design with #00458E & #DD7007 */
/* FontAwesome 6.x Integration */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* Mobile Bottom Navigation */
.betech-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: white;
    border-top: 3px solid #DD7007;
    box-shadow: 0 -4px 20px rgba(0, 69, 142, 0.15);
    display: none; /* Hidden by default, shown only on mobile */
    padding: 8px 0;
}

.betech-mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.betech-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    min-width: 60px;
    flex: 1;
}

.betech-nav-item:hover,
.betech-nav-item:focus {
    color: #00458E;
    background: rgba(0, 69, 142, 0.05);
    text-decoration: none;
}

.betech-nav-item.active {
    color: #DD7007;
    background: rgba(221, 112, 7, 0.1);
}

.betech-nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.betech-nav-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.betech-nav-item:hover .betech-nav-icon {
    transform: translateY(-2px);
}

.betech-nav-item:active {
    transform: scale(0.95);
}

.betech-nav-item:active .betech-nav-icon {
    transform: translateY(-1px) scale(1.1);
}

/* Add subtle animation for active state */
.betech-nav-item.active .betech-nav-icon {
    animation: navPulse 0.6s ease-in-out;
}

@keyframes navPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    .betech-nav-item {
        padding: 10px 8px;
        min-height: 50px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .betech-nav-icon {
        font-size: 22px;
        margin-bottom: 3px;
    }
    
    .betech-nav-label {
        font-size: 10px;
    }
}

/* PC端显示聊天按钮，隐藏移动导航 */
@media (min-width: 769px) {
    .betech-mobile-nav {
        display: none !important;
    }
    
    #betech-chat-widget {
        display: block;
    }
}

/* 移动端显示导航，调整聊天窗口 */
@media (max-width: 768px) {
    .betech-mobile-nav {
        display: block;
    }
    
    /* 隐藏PC端的聊天按钮 */
    #betech-chat-button {
        display: none !important;
    }
    
    /* 调整聊天窗口位置和大小适应移动端 */
    #betech-chat-window {
        width: calc(100% - 20px);
        height: calc(100vh - 120px);
        margin: 10px;
        bottom: 80px;
        right: 0;
        left: 0;
        position: fixed;
        border-radius: 12px;
    }
    
    #betech-chat-messages {
        height: calc(100vh - 260px);
        padding: 12px;
    }
    
    #betech-chat-input-area {
        padding: 12px;
    }
    
    #betech-chat-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 确保移动端导航始终显示 */
    #betech-chat-widget {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 9999;
    }
}

#betech-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#betech-chat-button {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 69, 142, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.chat-icon {
    font-size: 16px;
    opacity: 0.9;
}

#betech-chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(221, 112, 7, 0.2), transparent);
    transition: left 0.5s;
}

#betech-chat-button:hover::before {
    left: 100%;
}

#betech-chat-button:hover {
    background: linear-gradient(135deg, #DD7007 0%, #C5630A 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(221, 112, 7, 0.4);
}

#betech-chat-button.active {
    display: none;
}

#betech-chat-window {
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 69, 142, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
    display: none;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 69, 142, 0.1);
    position: relative;
}

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

#betech-chat-header {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

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

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

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

.chat-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.2;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#betech-chat-clear {
    cursor: pointer;
    font-size: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    position: relative;
    overflow: hidden;
}

#betech-chat-clear::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

#betech-chat-clear:hover::before {
    transform: scale(1);
}

#betech-chat-clear:hover {
    opacity: 1;
    transform: scale(1.05);
}

#betech-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

#betech-chat-close {
    cursor: pointer;
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    position: relative;
    overflow: hidden;
}

#betech-chat-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

#betech-chat-close:hover::before {
    transform: scale(1);
}

#betech-chat-close:hover {
    opacity: 1;
    transform: scale(1.05);
}

#betech-chat-messages {
    height: 360px;
    overflow-y: auto;
    padding: 16px;
    background: #fafbfc;
    scroll-behavior: smooth;
    position: relative;
}



#betech-chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

#betech-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

#betech-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.chat-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    text-align: right;
}

.chat-message.bot {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message-bubble.user {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    color: white;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 69, 142, 0.3);
    border: 1px solid rgba(221, 112, 7, 0.2);
}

.message-bubble.user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(221, 112, 7, 0.15) 0%, transparent 50%);
    border-radius: 20px;
    pointer-events: none;
}

.message-bubble.user.sending {
    opacity: 0.7;
}

.message-bubble.user.sending::after {
    content: '⏳';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.message-bubble.bot {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.file-list {
    margin-top: 10px;
}

.file-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #DD7007 0%, #C5630A 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.file-item:hover::before {
    transform: scaleY(1);
}

.file-item:hover {
    border-color: #00458E;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 69, 142, 0.15), 0 4px 10px rgba(221, 112, 7, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.file-header {
    color: #00458E;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}

.download-icon {
    color: #DD7007;
    margin-left: 8px;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.file-header:hover .download-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.download-btn {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    background: linear-gradient(135deg, #DD7007 0%, #C5630A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(221, 112, 7, 0.3);
    color: white !important;
    text-decoration: none !important;
}

/* Contact Section Styles */
.contact-section {
    text-align: center;
    padding: 16px;
    margin-top: 12px;
}

.contact-btn {
    background: linear-gradient(135deg, #DD7007 0%, #C5630A 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(221, 112, 7, 0.2);
}

.contact-btn:hover {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 69, 142, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.file-icon {
    font-size: 16px;
    opacity: 0.8;
}

/* QR Code Button Styles */
.file-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.qr-code-btn {
    background: linear-gradient(135deg, #DD7007 0%, #C5630A 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(221, 112, 7, 0.3);
    letter-spacing: 0.3px;
}

.qr-code-btn:hover {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 69, 142, 0.3);
}

.qr-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.qr-code-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid #00458E;
}

.qr-code-content h3 {
    color: #00458E;
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

.qr-code-content canvas {
    border: 2px solid #DD7007;
    border-radius: 8px;
    margin: 16px 0;
}

.qr-code-close {
    background: #DD7007;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.qr-code-close:hover {
    background: #00458E;
}

.file-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

#betech-chat-input-area {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}



#betech-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#betech-chat-input:focus {
    border-color: #00458E;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 69, 142, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
}

#betech-chat-send {
    background: linear-gradient(135deg, #DD7007 0%, #C5630A 100%);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(221, 112, 7, 0.3);
}

#betech-chat-send:hover {
    background: linear-gradient(135deg, #00458E 0%, #003A7A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 69, 142, 0.4);
}

#betech-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
    box-shadow: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

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

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

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* 输入状态样式 */
#betech-chat-input.disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

#betech-chat-send.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
    #betech-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    #betech-chat-button {
        width: 100%;
        justify-content: center;
        border-radius: 12px;
        padding: 14px 20px;
        font-size: 16px;
    }

    #betech-chat-window {
        width: 100%;
        height: 80vh;
        margin-bottom: 10px;
        border-radius: 12px 12px 0 0;
    }

    #betech-chat-messages {
        height: calc(80vh - 140px);
        padding: 12px;
    }

    #betech-chat-input-area {
        padding: 12px;
    }

    #betech-chat-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px 16px;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 15px;
    }

    .file-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    .file-item a {
        font-size: 15px;
    }

    .qr-code-btn {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 6px;
    }

    .qr-code-content {
        margin: 20px;
        padding: 20px;
        max-width: calc(100vw - 40px);
        border-radius: 12px;
    }

    .qr-code-content h3 {
        font-size: 16px;
    }
}

/* 平板设备优化 */
@media (min-width: 481px) and (max-width: 768px) {
    #betech-chat-window {
        width: 420px;
        height: 620px;
        border-radius: 20px;
    }

    #betech-chat-messages {
        height: 480px;
    }

    .qr-code-content {
        max-width: 350px;
    }
}
