/* LiveChat Toggle Button - 統一樣式 */
#dcc-livechat {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1050;
}

#dcc-livechat-window {
    display: none;
    margin-bottom: 8px;
}

#dcc-livechat-frame {
    width: 340px;
    height: 560px;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#dcc-livechat-toggle {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
    color: #fff !important;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: livechat-shake 0.6s ease-in-out, livechat-pulse 1.5s ease-in-out 0.6s;
    animation-iteration-count: 1, 1;
    animation-fill-mode: forwards;
}

#dcc-livechat-toggle i {
    font-size: 1.5rem;
    line-height: 1;
}

#dcc-livechat-toggle.animate {
    animation: livechat-shake 0.6s ease-in-out, livechat-pulse 1.5s ease-in-out 0.6s;
    animation-iteration-count: 1, 1;
}

#dcc-livechat-toggle:hover {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}

@keyframes livechat-shake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px) rotate(-3deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px) rotate(3deg);
    }
}

@keyframes livechat-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(139, 92, 246, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    }
}

/* 電商頁面：調整位置避開底部導航 */
@media (max-width: 991.98px) {
    body.eshop-active #dcc-livechat {
        bottom: calc(var(--eshop-mobile-nav-h, 56px) + 16px) !important;
    }
}
