/* PengCBA Assistant Chatbot — dark theme to match the PengCBA site */

#pengcba-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#pengcba-chat-launcher {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, #f0b429, #c98f0a);
    color: #101828;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(240, 180, 41, 0.4);
    transition: transform 0.2s ease;
}
#pengcba-chat-launcher:hover { transform: scale(1.07); }

#pengcba-chat-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 370px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: #0f1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#pengcba-chat-panel[hidden] { display: none; }

.pcb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #14213b, #1a2b4a);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pcb-header-info { display: flex; align-items: center; gap: 10px; color: #fff; }
.pcb-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2dd4bf, #0ea5a0);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: #062a28;
}
.pcb-header strong { display: block; font-size: 0.98rem; }
.pcb-status { font-size: 0.74rem; color: #7ee8db; }
#pengcba-chat-close {
    background: none;
    border: 0;
    color: #9fb0c7;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 8px;
}
#pengcba-chat-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.pcb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pcb-msg {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.pcb-msg.bot {
    align-self: flex-start;
    background: #14213b;
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #dfe7f2;
    border-bottom-left-radius: 4px;
}
.pcb-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #f0b429, #d99f12);
    color: #101828;
    border-bottom-right-radius: 4px;
}
.pcb-msg.typing { display: inline-flex; gap: 5px; align-items: center; }
.pcb-msg.typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #2dd4bf;
    animation: pcb-bounce 1.2s infinite;
}
.pcb-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.pcb-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pcb-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.pcb-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pcb-quick button {
    background: transparent;
    border: 1px solid rgba(45, 212, 191, 0.5);
    color: #2dd4bf;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}
.pcb-quick button:hover { background: rgba(45, 212, 191, 0.12); color: #fff; }

.pcb-input {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0b1220;
}
.pcb-input input {
    flex: 1;
    background: #14213b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 11px 16px;
    color: #e8edf5;
    font-size: 0.92rem;
}
.pcb-input input:focus { outline: none; border-color: #2dd4bf; }
.pcb-input button {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, #2dd4bf, #0ea5a0);
    color: #062a28;
    font-size: 16px;
}

@media (max-width: 480px) {
    #pengcba-chat-widget { right: 14px; bottom: 14px; }
    #pengcba-chat-panel {
        width: calc(100vw - 28px);
        height: min(540px, calc(100vh - 110px));
        right: 0;
        bottom: 72px;
    }
}
