#waic-chat-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#waic-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    transition: transform 0.2s;
}
#waic-chat-button:hover {
    transform: scale(1.05);
}

/* Invitation Bubble */
#waic-invitation-bubble {
    position: absolute;
    right: 70px;
    bottom: 10px;
    width: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 30px 12px 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    z-index: -1;
    cursor: default;
}
#waic-invitation-bubble::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 15px;
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}
.waic-invitation-content {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}
.waic-invitation-close {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 16px;
    color: #999;
    cursor: pointer;
}
.waic-invitation-close:hover {
    color: #666;
}

.waic-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: none;
    z-index: 10;
}

/* Response Preview Bubble */
#waic-response-preview {
    position: absolute;
    right: 70px;
    bottom: 10px;
    width: 240px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    border: 1px solid #eee;
    z-index: 5;
    cursor: pointer;
    display: none;
    opacity: 0;
}

#waic-response-preview.waic-show {
    display: block;
    animation: waic-slide-in 0.3s forwards;
}

#waic-response-preview.waic-hide {
    display: block;
    animation: waic-slide-out 0.3s forwards;
}

.waic-preview-body {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.waic-preview-arrow {
    position: absolute;
    right: -8px;
    bottom: 15px;
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

@keyframes waic-slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes waic-slide-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

#waic-chat-window {
    background: #f4f7f6;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    border: 1px solid rgba(0,0,0,0.05);
}

.waic-chat-header {
    padding: 10px 15px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 45px;
    box-sizing: border-box;
}
.waic-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.waic-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
}
.waic-avatar-mini-placeholder {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.waic-title {
    font-weight: 600;
    font-size: 14px;
}
.waic-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    opacity: 0.8;
    transition: all 0.2s;
    display: inline-block;
    width: 24px;
    height: 24px;
    text-align: center;
}
.waic-close:hover {
    opacity: 1;
    transform: scale(1.2) rotate(90deg);
}

.waic-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.waic-msg-row {
    display: flex;
    width: 100%;
}
.waic-msg-row.assistant {
    justify-content: flex-start;
}
.waic-msg-row.user {
    justify-content: flex-end;
}

.waic-msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.waic-msg-row.assistant .waic-msg-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 2px;
}
.waic-msg-row.user .waic-msg-bubble {
    background: var(--waic-theme-color);
    color: #fff;
    border-bottom-right-radius: 2px;
}

/* Dots Animation */
.waic-dots {
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: waic-dots-anim 1.5s infinite;
}

@keyframes waic-dots-anim {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

@keyframes waic-dots-anim {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.waic-typing-indicator {
    font-size: 12px;
    color: #999;
    font-style: italic;
    padding: 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.waic-error-notice {
    font-size: 12px;
    color: #ff4d4f;
    text-align: center;
    padding: 10px 15px;
    margin: 5px 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
}

.waic-chat-input-area {
    padding: 12px 15px;
    background: #fff;
    border-top: 1px solid #eee;
    height: 60px;
    box-sizing: border-box;
}
.waic-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9f9f9;
    border-radius: 20px;
    padding: 4px 12px;
    border: 1px solid #eee;
}
.waic-image-upload-btn {
    cursor: pointer;
    color: #999;
    font-size: 18px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}
.waic-image-upload-btn:hover {
    color: var(--waic-theme-color);
}
.waic-msg-bubble img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 5px;
    display: block;
}
#waic-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 4px;
    font-size: 13px;
    outline: none;
}
#waic-send {
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
#waic-send:disabled {
    background-color: #ccc !important;
    cursor: not-allowed;
    opacity: 0.7;
}
#waic-send:hover:not(:disabled) {
    opacity: 0.9;
}

/* Animations */
.waic-chat-button-open #waic-chat-button {
    animation: none !important;
}

.waic-anim-pulse { animation: waic-pulse 2s infinite; }
.waic-anim-bounce { animation: waic-bounce 2s infinite; }
.waic-anim-shake { animation: waic-shake 2s infinite; }
.waic-anim-swing { animation: waic-swing 2s infinite; }

@keyframes waic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--waic-theme-rgb), 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(var(--waic-theme-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--waic-theme-rgb), 0); }
}
@keyframes waic-bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}
@keyframes waic-shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}
@keyframes waic-swing {
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}
