/* ==========================================================================
   Flexable Home V3 — connect / chat   (Module 5)
   ========================================================================== */

.flxb-chat {
    border: 1px solid var(--flxb-line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--flxb-shadow);
    overflow: hidden;
}

.flxb-chat-head {
    height: 64px;
    border-bottom: 1px solid #ecece7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
}

.flxb-online {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
}

.flxb-online i {
    width: 8px;
    height: 8px;
    background: var(--flxb-green);
    border-radius: 50%;
    flex-shrink: 0;
}

.flxb-chat-score {
    font-size: 11px;
    color: #818381;
    white-space: nowrap;
}

.flxb-matching-banner {
    margin: 16px;
    border: 1px solid var(--flxb-line);
    background: #fafbfb;
    border-radius: 16px;
    padding: 11px 13px;
    font-size: 11px;
    color: #777a78;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flxb-tiny-spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #d6d6d0;
    border-top-color: var(--flxb-brand);
    animation: flxbSpin 1s linear infinite;
    flex-shrink: 0;
}

.flxb-messages {
    padding: 26px 18px 22px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flxb-bubble {
    max-width: 72%;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.flxb-bubble-customer {
    align-self: flex-end;
    background: var(--flxb-bubble);
    color: var(--flxb-ink);
    border-bottom-right-radius: 5px;
}

.flxb-bubble-freelancer {
    align-self: flex-start;
    background: #fff;
    color: var(--flxb-ink);
    border: 1px solid var(--flxb-line);
    border-bottom-left-radius: 5px;
}

.flxb-chat-actions {
    border-top: 1px solid var(--flxb-line);
    padding: 13px 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafbfb;
}

.flxb-chat-actions button {
    border: 1px solid var(--flxb-line);
    background: #fff;
    color: var(--flxb-ink);
    height: 38px;
    padding: 0 13px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
    white-space: nowrap;
}

.flxb-chat-actions button:hover {
    border-color: #c8c8c2;
}

.flxb-chat-actions .flxb-chat-primary {
    background: var(--flxb-charcoal);
    color: #fff;
    border-color: var(--flxb-charcoal);
}

.flxb-chat-actions .flxb-chat-primary:hover {
    background: #323138;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
    .flxb-chat {
        border-radius: 24px;
    }

    .flxb-messages {
        min-height: 0;
        padding: 20px 14px 18px;
    }

    /* narrow screens need wider bubbles to stay readable */
    .flxb-bubble {
        max-width: 86%;
    }

    .flxb-chat-head {
        height: 56px;
        padding: 0 14px;
    }

    .flxb-matching-banner {
        margin: 12px;
    }

    .flxb-chat-actions {
        justify-content: stretch;
    }

    .flxb-chat-actions button {
        flex: 1;
        padding: 0 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flxb-tiny-spinner {
        animation-duration: 3s;
    }
}
