/* ══════════════════════════════════════════════════════
   WIDGET DE SUPORTE FLUTUANTE (DUO)
   Aparece em todas as páginas — canto inferior direito
   ══════════════════════════════════════════════════════ */

/* Botão FAB */
#support-fab {
    position: fixed !important;
    bottom: 28px !important;
    right: 28px !important;
    width: 75px !important;
    height: 75px !important;
    border-radius: 50% !important;
    background: #f48024 !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 30px rgba(244, 128, 36, 0.4) !important;
    z-index: 999999 !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    padding: 10px !important;
    overflow: visible !important;
}

#support-fab img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    background: #fff !important;
}

#support-fab:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 26px rgba(244, 128, 36, 0.6) !important;
}

/* Badge de notificação */
#support-fab-badge {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 22px !important;
    height: 22px !important;
    background: #ff4444 !important;
    border-radius: 50% !important;
    border: 2px solid #fff !important;
    font-size: 11px !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    animation: badgePulse 2s infinite !important;
    z-index: 2 !important;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* Painel do chat */
#support-panel {
    position: fixed !important;
    bottom: 100px !important;
    right: 28px !important;
    width: 350px !important;
    max-height: 550px !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25) !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 999998 !important;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease !important;
    border: 1.5px solid #000000 !important;
}

#support-panel.open {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: all !important;
    visibility: visible !important;
}

/* Cabeçalho */
#support-header {
    background: #ffffff !important;
    padding: 15px 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.support-avatar-wrap {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    border: 2px solid #f48024 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.support-avatar-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.support-info {
    display: flex !important;
    flex-direction: column !important;
}

#support-header-title {
    color: #2c3e50 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    margin-bottom: 2px !important;
}

#support-header-sub {
    color: #7f8c8d !important;
    font-size: 12px !important;
}

#support-close-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #bdc3c7 !important;
    padding: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    transition: color 0.15s !important;
}

#support-close-btn:hover {
    color: #e74c3c !important;
}

/* Mensagens */
#support-messages {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    background: #f0f4f8 !important;
    scrollbar-width: thin !important;
    scrollbar-color: #cbd5e0 transparent !important;
}

#support-messages::-webkit-scrollbar { width: 5px; }
#support-messages::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 5px; }

/* Balões */
.sw-bubble {
    max-width: 85% !important;
    padding: 12px 16px !important;
    border-radius: 18px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
    animation: swBubbleIn 0.18s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

@keyframes swBubbleIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sw-bubble.assistant {
    background: #ffffff !important;
    color: #334155 !important;
    align-self: flex-start !important;
    border-bottom-left-radius: 4px !important;
}

.sw-bubble.user {
    background: #f48024 !important;
    color: #fff !important;
    align-self: flex-end !important;
    border-bottom-right-radius: 4px !important;
}

.sw-bubble.system {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-style: italic !important;
    align-self: center !important;
    text-align: center !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    max-width: 90% !important;
    box-shadow: none !important;
}

.sw-bubble.error {
    background: rgba(255, 80, 80, 0.15) !important;
    color: #ffaaaa !important;
    align-self: center !important;
    text-align: center !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    max-width: 90% !important;
}

/* Typing indicator */
.sw-typing {
    display: flex !important;
    gap: 5px !important;
    padding: 11px 14px !important;
    background: #fff !important;
    border-radius: 14px !important;
    border-bottom-left-radius: 4px !important;
    align-self: flex-start !important;
    width: fit-content !important;
}

.sw-typing span {
    width: 7px !important;
    height: 7px !important;
    background: #cbd5e0 !important;
    border-radius: 50% !important;
    animation: swBounce 1.2s infinite !important;
}

.sw-typing span:nth-child(2) { animation-delay: 0.2s !important; }
.sw-typing span:nth-child(3) { animation-delay: 0.4s !important; }

@keyframes swBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Hint WhatsApp */
#support-wa-hint {
    display: none;
    background: rgba(37, 211, 102, 0.12) !important;
    border: 1px solid rgba(37, 211, 102, 0.28) !important;
    border-radius: 8px !important;
    margin: 0 14px 8px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    color: #0c8c40 !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

/* Barra de input */
#support-input-bar {
    display: flex !important;
    gap: 10px !important;
    padding: 15px !important;
    background: #ffffff !important;
    border-top: 1px solid #f0f0f0 !important;
    flex-shrink: 0 !important;
    align-items: center !important;
}

#support-input {
    flex: 1 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 15px !important;
    color: #334155 !important;
    font-size: 14px !important;
    outline: none !important;
    resize: none !important;
    font-family: inherit !important;
}

#support-send-btn {
    background: #f48024 !important;
    color: #fff !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: background 0.2s, transform 0.1s !important;
}

#support-send-btn:hover {
    background: #df721c !important;
    transform: scale(1.05) !important;
}

#support-send-btn:disabled {
    background: #cbd5e0 !important;
    cursor: not-allowed !important;
}

@media (max-width: 480px) {
    #support-panel {
        width: calc(100vw - 24px) !important;
        right: 12px !important;
        bottom: 90px !important;
    }
    #support-fab {
        right: 14px !important;
        bottom: 18px !important;
    }
}
