/* WP AnthroChatbot — Frontend */
#wpac-root * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

#wpac-toggle {
    position: fixed; bottom: 24px; right: 24px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--wpac-primary, #2563eb);
    border: none; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: transform .2s, box-shadow .2s;
    z-index: 99999;
}
#wpac-toggle.wpac-left { right: auto; left: 24px; }
#wpac-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.32); }
#wpac-toggle svg { width: 24px; height: 24px; }
.wpac-unread {
    position: absolute; top: 2px; right: 2px;
    width: 13px; height: 13px;
    background: #ef4444; border-radius: 50%;
    border: 2px solid white; display: none;
}

#wpac-window {
    position: fixed; bottom: 92px; right: 24px;
    width: 360px; height: 540px;
    background: #ffffff; border: 1px solid #e5e7eb;
    border-radius: 16px;
    display: flex; flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    z-index: 99998; overflow: hidden;
    opacity: 0; transform: translateY(14px) scale(.97);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
#wpac-window.wpac-left { right: auto; left: 24px; }
#wpac-window.open { opacity: 1; transform: none; pointer-events: all; }

.wpac-win-header {
    padding: 14px 18px;
    background: var(--wpac-primary, #2563eb);
    display: flex; align-items: center; gap: 12px;
}
.wpac-win-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: white; flex-shrink: 0;
}
.wpac-win-info h3 { font-size: 14px; font-weight: 600; color: white; }
.wpac-win-info p  { font-size: 11px; color: rgba(255,255,255,0.8); margin-top: 1px; }
.wpac-status-dot  { width: 6px; height: 6px; background: #86efac; border-radius: 50%; display: inline-block; margin-right: 4px; }

#wpac-messages {
    flex: 1; overflow-y: auto; padding: 16px 14px;
    display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
#wpac-messages::-webkit-scrollbar { width: 4px; }
#wpac-messages::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

.wpac-msg { display: flex; flex-direction: column; max-width: 86%; animation: wpacFadeUp .2s ease both; }
@keyframes wpacFadeUp { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:none; } }
.wpac-msg.user  { align-self: flex-end; align-items: flex-end; }
.wpac-msg.bot   { align-self: flex-start; align-items: flex-start; }

.wpac-bubble {
    padding: 10px 13px; border-radius: 12px;
    font-size: 13.5px; line-height: 1.6; white-space: pre-wrap;
}
.wpac-msg.user .wpac-bubble {
    background: var(--wpac-primary, #2563eb);
    color: white; border-bottom-right-radius: 4px;
}
.wpac-msg.bot .wpac-bubble {
    background: #f3f4f6; color: #1f2937;
    border: 1px solid #e5e7eb; border-bottom-left-radius: 4px;
}
.wpac-bubble a { color: inherit; text-underline-offset: 2px; }
.wpac-msg.bot .wpac-bubble a { color: var(--wpac-primary, #2563eb); }

.wpac-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wpac-chip {
    padding: 5px 11px; border: 1px solid #d1d5db;
    border-radius: 20px; font-size: 12px; color: var(--wpac-primary, #2563eb);
    cursor: pointer; background: transparent;
    transition: background .15s, border-color .15s;
}
.wpac-chip:hover { background: #eff6ff; border-color: var(--wpac-primary, #2563eb); }

.wpac-typing { display: flex; gap: 5px; padding: 10px 13px; }
.wpac-typing span {
    width: 7px; height: 7px;
    background: #9ca3af; border-radius: 50%;
    opacity: .5; animation: wpacBlink 1.2s infinite;
}
.wpac-typing span:nth-child(2) { animation-delay: .2s; }
.wpac-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes wpacBlink { 0%,80%,100%{opacity:.4;transform:scale(1)} 40%{opacity:1;transform:scale(1.35)} }

.wpac-win-footer {
    padding: 10px 12px; border-top: 1px solid #e5e7eb;
    background: #f9fafb; display: flex; gap: 8px; align-items: flex-end;
}
#wpac-input {
    flex: 1; background: white; border: 1px solid #d1d5db;
    border-radius: 10px; padding: 9px 12px; color: #1f2937;
    font-size: 13.5px; resize: none; min-height: 40px; max-height: 100px;
    line-height: 1.5; outline: none; font-family: inherit;
    transition: border-color .2s;
}
#wpac-input::placeholder { color: #9ca3af; }
#wpac-input:focus { border-color: var(--wpac-primary, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
#wpac-send {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--wpac-primary, #2563eb);
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: opacity .2s, transform .15s;
}
#wpac-send:hover { opacity: .88; transform: scale(1.05); }
#wpac-send:disabled { opacity: .4; cursor: default; }
#wpac-send svg { width: 16px; height: 16px; }

.wpac-win-powered {
    text-align: center; padding: 4px 0 8px;
    font-size: 10px; color: #9ca3af;
    background: #f9fafb;
}

@media (max-width: 420px) {
    #wpac-window { width: calc(100vw - 20px); right: 10px !important; left: 10px !important; }
}
