/* Conditional Chatbot — Public Styles */

.ccb-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #f7f8fc;
}

/* ── Feed ──────────────────────────────────────────────────────── */
.ccb-feed {
    padding: 20px 16px;
    min-height: 200px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Bubbles ───────────────────────────────────────────────────── */
.ccb-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.45;
    word-break: break-word;
    animation: ccb-fade-in 0.25s ease forwards;
}

.ccb-bubble--bot {
    background: #fff;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ccb-bubble--user {
    background: #2271b1;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* ── Typing indicator ──────────────────────────────────────────── */
.ccb-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.ccb-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aaa;
    animation: ccb-bounce 1.2s infinite ease-in-out;
}

.ccb-typing span:nth-child(2) { animation-delay: 0.2s; }
.ccb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ccb-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%           { transform: scale(1.2); opacity: 1; }
}

/* ── Input area ────────────────────────────────────────────────── */
.ccb-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    align-items: center;
}

.ccb-text-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.ccb-text-input:focus {
    border-color: #2271b1;
}

.ccb-select {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    outline: none;
    cursor: pointer;
}

.ccb-submit-btn {
    padding: 9px 18px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.ccb-submit-btn:hover {
    background: #135e96;
}

/* ── Fade-in animation ─────────────────────────────────────────── */
@keyframes ccb-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Error message ─────────────────────────────────────────────── */
.ccb-error {
    color: #d63638;
    font-style: italic;
}
