


/* chat.css — BTZ.IO Chatbot Plugin */
.chatbot-centered {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: clamp(300px, min(92vw, 92dvw), 520px);
    max-width: min(520px, 96vw);
    height: min(90vh, 90dvh, 740px);
    max-height: min(90vh, 90dvh, 740px);
}
#chat-wrap {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    background: #e5ddd5; border-radius: 12px;
    overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25);
    font-family: 'Segoe UI', Arial, sans-serif;
}
#chat-header {
    background: #075e54; padding: 10px 12px 10px 14px;
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.chat-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: #128c7e; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.chat-avatar-img {
    width: 100%; height: 100%; object-fit: cover; display: none;
}
.chat-avatar-letter {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    color: #fff; font-weight: 600; font-size: 16px;
}
.chat-info { flex: 1; min-width: 0; }
.chat-name-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.chat-name  { color: white; font-weight: 600; font-size: 15px; line-height: 1.2; }
.chat-verified {
    width: 16px; height: 16px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #25d366; color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}
.chat-status{ color: #b2dfdb; font-size: 12px; }
.chat-header-actions {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
    margin-left: auto;
}
.chat-header-icon-btn {
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: transparent; color: rgba(255,255,255,0.92);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.15s;
    padding: 0;
}
.chat-header-icon-btn:hover { background: rgba(255,255,255,0.12); }
#messages   {
    flex: 1; overflow-y: auto; padding: 12px 10px;
    display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth;
    background-color: #efe7dd;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8bdb0' fill-opacity='0.22'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.bubble-wrap       { display: flex; flex-direction: column; width: 100%; }
.bubble-wrap.user  { align-items: flex-end; }
.bubble-wrap.bot   { align-items: flex-start; }
.bot-msg-row {
    display: flex; flex-direction: row; align-items: flex-end; gap: 8px;
    width: 100%; max-width: 100%;
}
.bot-msg-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: #128c7e; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.msg-avatar-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.msg-avatar-fallback {
    color: #fff; font-size: 13px; font-weight: 600;
}
.bot-msg-content {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
    max-width: calc(100% - 40px);
}
.bubble {
    max-width: min(85%, 340px); padding: 8px 12px 6px; border-radius: 8px;
    font-size: 14px; line-height: 1.45; position: relative;
    animation: popIn .2s cubic-bezier(.175,.885,.32,1.275) both; word-break: break-word;
}
.bubble.bot  { background: white; border-radius: 0 8px 8px 8px; color: #111; }
.bubble.user { background: #dcf8c6; border-radius: 8px 0 8px 8px; color: #111; }
.bubble .time{ font-size: 11px; color: #999; float: right; margin-left: 8px; margin-top: 2px; }
.bubble.user .time { color: #7bb56e; }
.typing-bubble {
    background: white; border-radius: 0 8px 8px 8px;
    padding: 12px 16px; display: flex; align-items: center; gap: 4px;
    animation: popIn .2s both;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #999; animation: bounce 1.2s infinite ease-in-out; }
.dot:nth-child(2){ animation-delay: .2s; }
.dot:nth-child(3){ animation-delay: .4s; }
.audio-player { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.play-btn { width: 36px; height: 36px; border-radius: 50%; background: #128c7e; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: white; }
.waveform { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; }
.waveform span { display: block; width: 3px; border-radius: 2px; background: #128c7e; opacity: .5; animation: wave 1s infinite ease-in-out; }
.ad-inline-wrap { align-items: center; margin: 6px 0 8px; }
.ad-inline-box {
    width: 100%;
    max-width: min(340px, 100%);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}
.ad-inline-label {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    border-bottom: 1px solid #eeeeee;
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: .2px;
}
.ad-slot-container {
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
}
.ad-loading, .ad-fallback {
    font-size: 12px;
    color: #94a3b8;
}
#options-wrap { padding: 8px 10px 8px calc(10px + 32px + 8px); display: flex; flex-direction: column; gap: 6px; animation: slideUp .25s ease both; }
.opt-btn { background: #128c7e; color: white; border: none; border-radius: 24px; padding: 10px 18px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, transform .1s; }
.opt-btn:hover  { background: #0d7066; }
.opt-btn:active { transform: scale(.97); }
#chat-footer { background: #f0f0f0; padding: 8px 10px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#footer-msg { flex: 1; background: white; border-radius: 24px; padding: 9px 16px; font-size: 14px; color: #999; border: none; outline: none; }
.footer-icon { width: 40px; height: 40px; border-radius: 50%; background: #075e54; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.date-divider { text-align: center; margin: 8px 0; }
.date-divider span { background: #d9d2ca; padding: 3px 10px; border-radius: 8px; font-size: 11.5px; color: #666; }
@keyframes popIn   { from{opacity:0;transform:scale(.85) translateY(6px)} to{opacity:1;transform:scale(1) translateY(0)} }
@keyframes slideUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes bounce  { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }
@keyframes wave    { 0%,100%{height:4px} 50%{height:20px} }