@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

#wpava-widget-root * { box-sizing: border-box; font-family: 'Inter', sans-serif; margin: 0; padding: 0; }

/* ── FAB ── */
.wpava-fab {
    position: fixed; z-index: 99999; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    transition: transform .2s;
}
.wpava-fab.pos-bottom-right { bottom: 20px; right: 20px; }
.wpava-fab.pos-bottom-left  { bottom: 20px; left: 20px; }
.wpava-fab:hover { transform: scale(1.05); }

.wpava-fab-img {
    width: 68px; height: 68px; border-radius: 50%; object-fit: cover;
    border: 3px solid #7c3aed;
    box-shadow: 0 4px 20px rgba(124,58,237,.5);
    animation: wpava-float 3s ease-in-out infinite;
}
.wpava-fab-label {
    margin-top: 5px; font-size: 11px; font-weight: 600; color: #7c3aed;
    background: white; padding: 2px 8px; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12); letter-spacing: .3px;
    white-space: nowrap;
}

@keyframes wpava-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ── PANEL ── */
.wpava-panel {
    position: fixed; z-index: 99998;
    width: 330px; max-height: 520px;
    background: white; border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    display: flex; flex-direction: column; overflow: hidden;
    animation: wpava-fadeup .28s cubic-bezier(.22,.68,0,1.2);
}
.wpava-panel.pos-bottom-right { bottom: 102px; right: 20px; }
.wpava-panel.pos-bottom-left  { bottom: 102px; left: 20px; }

@keyframes wpava-fadeup {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── HEADER ── */
.wpava-panel-header {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.wpava-panel-header img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.4); }
.wpava-panel-header-info h4 { font-size: 14px; font-weight: 600; color: white; }
.wpava-panel-header-info span { font-size: 11px; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 4px; }
.wpava-online-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.wpava-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.7); font-size: 20px; cursor: pointer; line-height: 1; }
.wpava-close:hover { color: white; }

/* ── MESSAGES ── */
.wpava-messages {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
    scrollbar-width: thin;
}

.wpava-msg { display: flex; gap: 7px; max-width: 85%; animation: wpava-msgin .2s ease; }
.wpava-msg.user      { align-self: flex-end; flex-direction: row-reverse; }
.wpava-msg.assistant { align-self: flex-start; }

.wpava-msg .wpava-avatar-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 2px; }

.wpava-bubble { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.wpava-msg.assistant .wpava-bubble { background: #f3f4f6; color: #1f2937; border-radius: 4px 14px 14px 14px; }
.wpava-msg.user      .wpava-bubble { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: white; border-radius: 14px 4px 14px 14px; }

@keyframes wpava-msgin {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* TYPING */
.wpava-typing-dots { display: flex; gap: 4px; align-items: center; padding: 10px 14px; background: #f3f4f6; border-radius: 4px 14px 14px 14px; }
.wpava-dot { width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; }
.wpava-dot:nth-child(1) { animation: wpava-bounce 1.2s 0s   infinite ease-in-out; }
.wpava-dot:nth-child(2) { animation: wpava-bounce 1.2s .2s  infinite ease-in-out; }
.wpava-dot:nth-child(3) { animation: wpava-bounce 1.2s .4s  infinite ease-in-out; }
@keyframes wpava-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* SUGGESTIONS */
.wpava-suggestions { padding: 0 12px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.wpava-chip { background: #f3f4f6; border: 1px solid #e5e7eb; color: #374151; font-size: 11.5px; padding: 5px 10px; border-radius: 20px; cursor: pointer; transition: all .15s; font-family: inherit; }
.wpava-chip:hover { background: #ede9fe; border-color: #c4b5fd; color: #7c3aed; }

/* INPUT */
.wpava-input-area { padding: 10px 12px; border-top: 1px solid #f3f4f6; display: flex; gap: 8px; align-items: center; }
.wpava-input {
    flex: 1; border: 1px solid #e5e7eb; border-radius: 10px; padding: 9px 12px;
    font-size: 13px; font-family: inherit; outline: none; color: #1f2937; transition: border-color .15s;
}
.wpava-input:focus { border-color: #7c3aed; }
.wpava-send { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #7c3aed, #5b21b6); border: none; color: white; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity .15s; }
.wpava-send:disabled { opacity: .4; cursor: not-allowed; }

/* MOBILE */
@media (max-width: 480px) {
    .wpava-panel { width: calc(100vw - 24px); right: 12px !important; left: 12px !important; }
}

/* ── TALKING AVATAR v2.0 ── */
.wpava-avatar-area {
    position: relative;
    width: 44px; height: 44px; flex-shrink: 0;
}

.wpava-avatar-vid {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%; object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 1;
}
.wpava-avatar-vid.active { opacity: 1; z-index: 2; }

.wpava-avatar-static {
    width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
}

.wpava-status-dot {
    position: absolute; top: 0; right: 0;
    width: 10px; height: 10px; border-radius: 50%;
    background: #4ade80; border: 2px solid white; z-index: 3;
}
.wpava-status-dot.thinking {
    background: #f59e0b;
    animation: wpava-pulse-dot 0.8s infinite alternate;
}
@keyframes wpava-pulse-dot {
    from { opacity: 0.4; transform: scale(0.9); }
    to   { opacity: 1;   transform: scale(1.1); }
}

/* FAB video */
.wpava-fab-video-wrap {
    width: 68px; height: 68px; border-radius: 50%; overflow: hidden;
    border: 3px solid #7c3aed;
    box-shadow: 0 4px 20px rgba(124,58,237,.5);
    animation: wpava-float 3s ease-in-out infinite;
}
.wpava-fab-video { width: 100%; height: 100%; object-fit: cover; }
.wpava-fab-dot {
    position: absolute; bottom: 24px; right: 0;
    width: 12px; height: 12px;
}
