/* ==========================================================
   Chat Bubbles Block — bkbg-chat-bubble
   ========================================================== */

.bkbg-chat-bubble-wrap {
    box-sizing: border-box;
}

.bkbg-chat-container {
    box-sizing: border-box;
}

.bkbg-chat-msg {
    box-sizing: border-box;
}

.bkbg-chat-bubble {
    word-break: break-word;
    box-sizing: border-box;
    font-family: var(--bkbg-cb-b-font-family, inherit);
    font-size: var(--bkbg-cb-b-font-size-d, 14px);
    font-weight: var(--bkbg-cb-b-font-weight, 400);
    line-height: var(--bkbg-cb-b-line-height-d, 1.5);
    text-transform: var(--bkbg-cb-b-text-transform, none);
    font-style: var(--bkbg-cb-b-font-style, normal);
    text-decoration: var(--bkbg-cb-b-text-decoration, none);
    letter-spacing: var(--bkbg-cb-b-letter-spacing-d, normal);
    word-spacing: var(--bkbg-cb-b-word-spacing-d, normal);
}

.bkbg-chat-sender {
    margin: 0;
}

.bkbg-chat-time {
    margin: 0;
}

.bkbg-chat-avatar {
    flex-shrink: 0;
}

/* Typing indicator animation */
.bkbg-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bkbg-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    animation: bkbg-bounce 1.2s ease-in-out infinite;
}

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

@keyframes bkbg-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* Dark chat style container adjustments */
.bkbg-chat-container--dark .bkbg-chat-sender {
    color: rgba(255, 255, 255, 0.5) !important;
}

.bkbg-chat-container--dark .bkbg-chat-time {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* ── Typography responsive ── */
@media (max-width: 1024px) {
    .bkbg-chat-bubble {
        font-size: var(--bkbg-cb-b-font-size-t, var(--bkbg-cb-b-font-size-d, 14px));
        line-height: var(--bkbg-cb-b-line-height-t, var(--bkbg-cb-b-line-height-d, 1.5));
        letter-spacing: var(--bkbg-cb-b-letter-spacing-t, var(--bkbg-cb-b-letter-spacing-d, normal));
        word-spacing: var(--bkbg-cb-b-word-spacing-t, var(--bkbg-cb-b-word-spacing-d, normal));
    }
}
@media (max-width: 767px) {
    .bkbg-chat-bubble {
        font-size: var(--bkbg-cb-b-font-size-m, var(--bkbg-cb-b-font-size-t, var(--bkbg-cb-b-font-size-d, 14px)));
        line-height: var(--bkbg-cb-b-line-height-m, var(--bkbg-cb-b-line-height-t, var(--bkbg-cb-b-line-height-d, 1.5)));
        letter-spacing: var(--bkbg-cb-b-letter-spacing-m, var(--bkbg-cb-b-letter-spacing-t, var(--bkbg-cb-b-letter-spacing-d, normal)));
        word-spacing: var(--bkbg-cb-b-word-spacing-m, var(--bkbg-cb-b-word-spacing-t, var(--bkbg-cb-b-word-spacing-d, normal)));
    }
}

/* Responsive */
@media (max-width: 600px) {
    .bkbg-chat-container {
        padding: 16px !important;
    }
}
