﻿#tengchat-widget-wrapper {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#tengchat-floating-btn {
    background-color: var(--tengchat-btn-bg);
    border: none;
    border-radius: var(--tengchat-border-radius);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#tengchat-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.tengchat-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.tengchat-btn-text {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
}

/* Icon Only Style */
.tengchat-style-icon-only #tengchat-floating-btn {
    padding: 14px;
    border-radius: 50% !important; /* Force circle for single icon */
}

.tengchat-style-icon-only .tengchat-icon svg {
    width: 32px;
    height: 32px;
}

/* Chat Window */
#tengchat-chat-window {
    position: absolute;
    bottom: calc(100% + 20px);
    width: 340px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom;
}

.tengchat-position-bottom-right #tengchat-chat-window {
    right: 0;
}

.tengchat-position-bottom-left #tengchat-chat-window {
    left: 0;
}

#tengchat-chat-window.tengchat-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.tengchat-chat-header {
    background-color: var(--tengchat-brand-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

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

.tengchat-brand-img, .tengchat-brand-img-fallback {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tengchat-brand-name {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
}

.tengchat-brand-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

#tengchat-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#tengchat-close-btn:hover {
    opacity: 1;
}

.tengchat-chat-body {
    background-color: #E5DDD5; /* WhatsApp default chat bg */
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.5a.5.5 0 0 0 0-1 .5.5 0 0 0 0 1zM20 21a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM19.5 20a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0z' fill='%23ccc' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
    padding: 20px;
    min-height: 150px;
}

.tengchat-chat-message {
    background: #fff;
    padding: 12px 14px;
    border-radius: 0 8px 8px 8px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    font-size: 14px;
    color: #111;
    max-width: 85%;
}

.tengchat-chat-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent #fff transparent transparent;
}

.tengchat-msg-author {
    font-size: 11px;
    color: rgba(0,0,0,0.4);
    margin-bottom: 4px;
    font-weight: 500;
}

.tengchat-chat-footer {
    padding: 16px;
    background: #fff;
    text-align: center;
}

#tengchat-start-chat-btn {
    display: block;
    background-color: var(--tengchat-btn-bg);
    color: #fff;
    text-decoration: none;
    padding: 12px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.2s;
}

#tengchat-start-chat-btn:hover {
    filter: brightness(0.95);
}

.tengchat-watermark {
    margin-top: 12px;
    font-size: 11px;
    color: #888;
}

.tengchat-watermark a {
    color: var(--tengchat-brand-color);
    text-decoration: none;
    font-weight: 500;
}

.tengchat-watermark a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #tengchat-chat-window {
        width: calc(100vw - 40px);
        max-width: 340px;
    }
}

