/* WNB Chat Widget — scoped to avoid theme conflicts */

#wnb-bubble {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 999999 !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: #0284c7 !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(2,132,199,0.4) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: auto !important;
    min-height: auto !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
#wnb-bubble:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 6px 28px rgba(2,132,199,0.5) !important;
    background: #0369a1 !important;
}
#wnb-bubble.wnb-hidden { display: none !important; }
#wnb-bubble svg {
    width: 28px !important;
    height: 28px !important;
    fill: none !important;
    stroke: #fff !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}
#wnb-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    width: 20px !important;
    height: 20px !important;
    background: #ef4444 !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-shadow: 0 2px 6px rgba(239,68,68,0.4) !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}
#wnb-badge.wnb-hidden { display: none !important; }

/* Proactive preview */
#wnb-proactive-preview {
    position: fixed !important;
    bottom: 94px !important;
    right: 24px !important;
    z-index: 999998 !important;
    max-width: 280px !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 14px 16px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    animation: wnb-slide-up 0.4s ease !important;
    cursor: pointer !important;
}
#wnb-proactive-preview.wnb-hidden { display: none !important; }
#wnb-proactive-preview .wnb-pp-title { font-size: 13px !important; font-weight: 600 !important; color: #0284c7 !important; margin: 0 0 4px !important; }
#wnb-proactive-preview .wnb-pp-text { font-size: 13px !important; color: #1e293b !important; line-height: 1.4 !important; margin: 0 !important; }
#wnb-proactive-preview .wnb-pp-close {
    position: absolute !important; top: 6px !important; right: 8px !important;
    background: none !important; border: none !important; color: #64748b !important;
    cursor: pointer !important; font-size: 16px !important; line-height: 1 !important; padding: 2px !important;
}

/* Chat window */
#wnb-chat {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 9999999 !important;
    width: 380px !important;
    height: 560px !important;
    max-height: calc(100vh - 48px) !important;
    max-width: calc(100vw - 32px) !important;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: wnb-scale-in 0.25s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
}
#wnb-chat.wnb-hidden { display: none !important; }

#wnb-chat .wnb-chat-header {
    background: #0284c7 !important;
    color: #fff !important;
    padding: 16px 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    border: none !important;
    margin: 0 !important;
}
#wnb-chat .wnb-chat-avatar {
    width: 38px !important; height: 38px !important; border-radius: 50% !important;
    background: rgba(255,255,255,0.2) !important; display: flex !important;
    align-items: center !important; justify-content: center !important;
    font-size: 18px !important; flex-shrink: 0 !important;
}
#wnb-chat .wnb-chat-info h3 { margin: 0 !important; font-size: 15px !important; font-weight: 600 !important; color: #fff !important; }
#wnb-chat .wnb-chat-info p { margin: 2px 0 0 !important; font-size: 12px !important; opacity: 0.85 !important; color: #fff !important; }
#wnb-chat .wnb-chat-close {
    margin-left: auto !important; background: none !important; border: none !important;
    color: #fff !important; cursor: pointer !important; font-size: 22px !important;
    padding: 4px !important; opacity: 0.8 !important;
}
#wnb-chat .wnb-chat-close:hover { opacity: 1 !important; }

#wnb-chat .wnb-chat-messages {
    flex: 1 !important; overflow-y: auto !important; padding: 16px !important;
    display: flex !important; flex-direction: column !important; gap: 10px !important;
    scroll-behavior: smooth !important; background: #fff !important; margin: 0 !important;
}

#wnb-chat .wnb-msg {
    max-width: 82% !important; padding: 10px 14px !important; border-radius: 14px !important;
    font-size: 14px !important; line-height: 1.5 !important; word-wrap: break-word !important;
    white-space: pre-wrap !important; border: none !important; margin: 0 !important;
    box-shadow: none !important;
}
#wnb-chat .wnb-msg-in {
    align-self: flex-start !important; background: #f1f5f9 !important; color: #1e293b !important;
    border-bottom-left-radius: 4px !important;
}
#wnb-chat .wnb-msg-out {
    align-self: flex-end !important; background: #0284c7 !important; color: #fff !important;
    border-bottom-right-radius: 4px !important;
}
#wnb-chat .wnb-msg-time { font-size: 11px !important; color: #64748b !important; margin-top: 3px !important; }
#wnb-chat .wnb-msg-out .wnb-msg-time { color: rgba(255,255,255,0.7) !important; text-align: right !important; }

#wnb-chat .wnb-msg-proactive {
    align-self: flex-start !important; background: #e0f2fe !important; color: #1e293b !important;
    border: 1px solid #bae6fd !important; border-bottom-left-radius: 4px !important;
}
#wnb-chat .wnb-msg-proactive .wnb-msg-link {
    display: inline-block !important; margin-top: 6px !important; color: #0284c7 !important;
    font-weight: 600 !important; text-decoration: none !important; font-size: 13px !important;
}

#wnb-chat .wnb-typing {
    align-self: flex-start !important; padding: 12px 18px !important; background: #f1f5f9 !important;
    border-radius: 14px !important; border-bottom-left-radius: 4px !important;
    display: flex !important; gap: 5px !important;
}
#wnb-chat .wnb-typing.wnb-hidden { display: none !important; }
#wnb-chat .wnb-typing span {
    width: 7px !important; height: 7px !important; background: #64748b !important;
    border-radius: 50% !important; animation: wnb-bounce 1.4s infinite !important;
    display: inline-block !important;
}
#wnb-chat .wnb-typing span:nth-child(2) { animation-delay: 0.2s !important; }
#wnb-chat .wnb-typing span:nth-child(3) { animation-delay: 0.4s !important; }

#wnb-chat .wnb-welcome {
    text-align: center !important; padding: 24px 16px 8px !important;
    color: #64748b !important; font-size: 13px !important; line-height: 1.5 !important;
}

#wnb-chat .wnb-chat-input {
    padding: 12px 16px !important; border-top: 1px solid #e2e8f0 !important;
    display: flex !important; gap: 8px !important; align-items: flex-end !important;
    flex-shrink: 0 !important; background: #fff !important; margin: 0 !important;
}
#wnb-chat .wnb-chat-input textarea {
    flex: 1 !important; border: 1px solid #e2e8f0 !important; border-radius: 12px !important;
    padding: 10px 14px !important; font-size: 14px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    resize: none !important; outline: none !important; max-height: 100px !important;
    min-height: 40px !important; line-height: 1.4 !important; color: #1e293b !important;
    background: #f8fafc !important; box-shadow: none !important; margin: 0 !important;
}
#wnb-chat .wnb-chat-input textarea:focus { border-color: #0284c7 !important; background: #fff !important; }
#wnb-chat .wnb-chat-input textarea::placeholder { color: #64748b !important; }
#wnb-chat .wnb-chat-send {
    width: 40px !important; height: 40px !important; border-radius: 50% !important;
    background: #0284c7 !important; color: #fff !important; border: none !important;
    cursor: pointer !important; display: flex !important; align-items: center !important;
    justify-content: center !important; flex-shrink: 0 !important; padding: 0 !important;
    margin: 0 !important; min-width: auto !important;
}
#wnb-chat .wnb-chat-send:hover { background: #0369a1 !important; }
#wnb-chat .wnb-chat-send:disabled { background: #cbd5e1 !important; cursor: not-allowed !important; }
#wnb-chat .wnb-chat-send svg {
    width: 18px !important; height: 18px !important; fill: none !important;
    stroke: #fff !important; stroke-width: 2.5 !important;
    stroke-linecap: round !important; stroke-linejoin: round !important;
}

@keyframes wnb-scale-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wnb-slide-up { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes wnb-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

@media (max-width: 480px) {
    #wnb-chat { width: 100vw !important; height: 100vh !important; max-height: 100vh !important; max-width: 100vw !important; bottom: 0 !important; right: 0 !important; border-radius: 0 !important; }
    #wnb-bubble { bottom: 16px !important; right: 16px !important; }
    #wnb-proactive-preview { bottom: 86px !important; right: 16px !important; max-width: calc(100vw - 90px) !important; }
}

/* ─── THEME OVERRIDE RESET ─── */
#wnb-chat *, #wnb-chat *::before, #wnb-chat *::after,
#wnb-bubble, #wnb-bubble * {
    box-sizing: border-box !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
}
#wnb-chat h3,
#wnb-chat .wnb-chat-info h3 {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.3 !important;
    border: none !important;
    background: none !important;
}
#wnb-chat p,
#wnb-chat .wnb-chat-info p {
    font-size: 12px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    border: none !important;
    background: none !important;
}
#wnb-chat button,
#wnb-chat .wnb-chat-close,
#wnb-chat .wnb-chat-send {
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-indent: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}
#wnb-chat .wnb-chat-send {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    background: #0284c7 !important;
    color: #fff !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#wnb-chat .wnb-chat-input textarea {
    width: auto !important;
    box-shadow: none !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}
