/**
 * FastChat 聊天窗口样式
 * 轻拟态风格
 */

/* 默认样式变量 */
:root {
    --fc-primary: #667eea;
    --fc-secondary: #764ba2;
    --fc-bg: #f0f0f3;
    --fc-text: #333;
    --fc-text-light: #666;
}

/* 聊天按钮 */
.fastchat-toggle-btn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fc-primary), var(--fc-secondary));
    box-shadow: 
        8px 8px 16px rgba(0,0,0,0.2),
        -8px -8px 16px rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.fastchat-toggle-btn:hover {
    transform: scale(1.1) translateY(-2px);
}

.fastchat-toggle-btn:active {
    transform: scale(0.95);
}

/* 未读消息徽章 */
.fastchat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 聊天窗口 */
.fastchat-widget {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 380px;
    height: 520px;
    background: var(--fc-bg);
    border-radius: 20px;
    box-shadow: 
        20px 20px 60px #bebebe,
        -20px -20px 60px #ffffff;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fastchat-widget.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* 头部 */
.fastchat-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--fc-primary), var(--fc-secondary));
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fastchat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fastchat-logo {
    font-size: 18px;
    font-weight: 700;
}

.fastchat-status {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fastchat-status.online {
    background: rgba(78, 205, 196, 0.3);
}

.fastchat-status.offline {
    background: rgba(255, 107, 107, 0.3);
}

/* 操作按钮 */
.fastchat-actions {
    display: flex;
    gap: 8px;
}

.fastchat-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fastchat-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* 内容区域 */
.fastchat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 消息列表 */
.fastchat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 消息气泡 */
.fastchat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fastchat-message.visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--fc-primary), var(--fc-secondary));
    color: white;
    border-radius: 12px 12px 4px 12px;
    box-shadow: 4px 4px 12px rgba(102, 126, 234, 0.2);
}

.fastchat-message.admin {
    align-self: flex-start;
    background: #ffffff;
    color: var(--fc-text);
    box-shadow: 
        4px 4px 8px #b8b8b8,
        -4px -4px 8px #ffffff;
    border-radius: 12px 12px 12px 4px;
}

.fastchat-message.system {
    align-self: center;
    background: #e0e0e0;
    color: var(--fc-text-light);
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 
        inset 2px 2px 4px #b8b8b8,
        inset -2px -2px 4px #ffffff;
}

/* 图片消息 */
.fastchat-message-image {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.fastchat-message-image:hover {
    transform: scale(1.05);
}

/* 消息时间 */
.fastchat-message-time {
    font-size: 10px;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

/* 排队信息 */
.fastchat-queue-info {
    padding: 15px 20px;
    background: #fff3e0;
    text-align: center;
    font-size: 13px;
    color: #f57c00;
    border-radius: 12px;
    margin: 10px 20px;
    box-shadow: 
        inset 2px 2px 4px #b8b8b8,
        inset -2px -2px 4px #ffffff;
}

/* 输入区域 */
.fastchat-input-area {
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

/* 输入框 */
.fastchat-input {
    flex: 1;
    border: none;
    background: var(--fc-bg);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 100px;
    line-height: 1.5;
    box-shadow: 
        inset 4px 4px 8px #b8b8b8,
        inset -4px -4px 8px #ffffff;
    transition: all 0.2s ease;
}

.fastchat-input:focus {
    outline: none;
    box-shadow: 
        inset 6px 6px 12px #b0b0b0,
        inset -6px -6px 12px #ffffff;
}

.fastchat-input::placeholder {
    color: #999;
}

/* 按钮样式 */
.fastchat-emoji-btn,
.fastchat-upload-btn {
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: var(--fc-bg);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: 
        4px 4px 8px #b8b8b8,
        -4px -4px 8px #ffffff;
}

.fastchat-emoji-btn:hover,
.fastchat-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        6px 6px 12px #b0b0b0,
        -6px -6px 12px #ffffff;
}

.fastchat-emoji-btn:active,
.fastchat-upload-btn:active {
    transform: translateY(0);
}

.fastchat-send-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fc-primary), var(--fc-secondary));
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        4px 4px 8px rgba(102, 126, 234, 0.3),
        -4px -4px 8px rgba(118, 75, 162, 0.1);
}

.fastchat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        6px 6px 12px rgba(102, 126, 234, 0.4),
        -6px -6px 12px rgba(118, 75, 162, 0.2);
}

.fastchat-send-btn:active {
    transform: translateY(0);
}

/* 滚动条样式 */
.fastchat-messages::-webkit-scrollbar {
    width: 6px;
}

.fastchat-messages::-webkit-scrollbar-track {
    background: var(--fc-bg);
    border-radius: 3px;
}

.fastchat-messages::-webkit-scrollbar-thumb {
    background: #b8b8b8;
    border-radius: 3px;
}

.fastchat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .fastchat-widget {
        width: calc(100vw - 60px);
        height: 60vh;
        right: 20px;
        bottom: 90px;
    }
    
    .fastchat-toggle-btn {
        right: 20px;
        bottom: 20px;
        width: 55px;
        height: 55px;
    }
    
    .fastchat-message {
        max-width: 90%;
    }
}

/* 加载动画 */
.fastchat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
}

.fastchat-loading span {
    width: 8px;
    height: 8px;
    background: var(--fc-primary);
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out both;
}

.fastchat-loading span:nth-child(1) { animation-delay: -0.32s; }
.fastchat-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
