
/* ======================================================
   NOVO CHAT FLUTUANTE - VISUAL DIFERENTE
   Widget estilo aplicativo, sem alterar o resto do site.
   ====================================================== */

#chatBox{
    position: fixed !important;
    right: 22px !important;
    bottom: 22px !important;
    width: 370px !important;
    max-width: calc(100vw - 24px) !important;
    height: 560px !important;
    max-height: calc(100vh - 36px) !important;
    z-index: 999999 !important;
    font-family: Inter, Arial, Helvetica, sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0f172a !important;
    border-radius: 26px !important;
    box-shadow: 0 25px 80px rgba(0,0,0,.45) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    transform-origin: bottom right;
}

#chatBox.chat-collapsed{
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
}

.chat-launcher{
    display: none;
}

#chatBox.chat-collapsed .chat-launcher{
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: linear-gradient(135deg,#7c3aed,#2563eb,#06b6d4) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 14px 18px !important;
    box-shadow: 0 18px 45px rgba(37,99,235,.45) !important;
    cursor: pointer !important;
    font-weight: 800 !important;
    font-size: 15px !important;
}

.chat-launcher-icon{
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: grid;
    place-items: center;
    font-size: 19px;
}

.chat-launcher-badge{
    min-width: 22px;
    height: 22px;
    border-radius: 99px;
    background: #ef4444;
    display: grid;
    place-items: center;
    padding: 0 6px;
    font-size: 12px;
    box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}

#chatBox.chat-collapsed .chat-panel{
    display: none !important;
}

.chat-panel{
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-topbar{
    position: relative;
    padding: 18px 18px 16px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 0%, rgba(14,165,233,.75), transparent 30%),
        radial-gradient(circle at 100% 10%, rgba(168,85,247,.65), transparent 33%),
        linear-gradient(135deg,#111827,#1e1b4b 48%,#172554);
}

.chat-topbar::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:-1px;
    height:24px;
    background: linear-gradient(to bottom, rgba(15,23,42,0), #0f172a);
    pointer-events:none;
}

.chat-topline{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    position:relative;
    z-index:2;
}

.chat-brand{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.chat-logo{
    width:48px;
    height:48px;
    border-radius:18px;
    background:rgba(255,255,255,.13);
    display:grid;
    place-items:center;
    font-size:24px;
    border:1px solid rgba(255,255,255,.20);
    box-shadow: inset 0 0 20px rgba(255,255,255,.08);
}

.chat-brand-title{
    font-size:18px;
    line-height:1.05;
    font-weight:900;
    letter-spacing:-.03em;
}

.chat-brand-subtitle{
    margin-top:5px;
    display:flex;
    align-items:center;
    gap:7px;
    color:rgba(255,255,255,.78);
    font-size:12px;
    white-space:nowrap;
}

.chat-pulse{
    width:9px;
    height:9px;
    border-radius:50%;
    background:#22c55e;
    box-shadow:0 0 0 0 rgba(34,197,94,.65);
    animation:chatPulse 1.4s infinite;
}

@keyframes chatPulse{
    0%{box-shadow:0 0 0 0 rgba(34,197,94,.65)}
    70%{box-shadow:0 0 0 9px rgba(34,197,94,0)}
    100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}
}

.chat-actions{
    display:flex;
    gap:8px;
}

.chat-icon-button{
    width:34px;
    height:34px;
    border:1px solid rgba(255,255,255,.16);
    border-radius:12px;
    background:rgba(255,255,255,.10);
    color:#fff;
    cursor:pointer;
    font-size:18px;
    line-height:34px;
}

.chat-room-info{
    position:relative;
    z-index:2;
    margin-top:16px;
    padding:12px;
    border-radius:18px;
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.13);
    display:flex;
    justify-content:space-between;
    gap:10px;
    color:rgba(255,255,255,.88);
    font-size:12px;
}

.chat-body{
    flex:1;
    display:flex;
    flex-direction:column;
    min-height:0;
    background:
        radial-gradient(circle at 90% 15%, rgba(59,130,246,.12), transparent 30%),
        radial-gradient(circle at 10% 80%, rgba(168,85,247,.10), transparent 28%),
        #0f172a;
    padding: 12px 12px 0 !important;
}

#chatMessages.chat-messages,
#chatMessages{
    flex:1 !important;
    height:auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
    padding:12px 6px 12px !important;
    margin:0 !important;
    background:transparent !important;
    border-radius:0 !important;
    box-shadow:none !important;
}

#chatMessages::-webkit-scrollbar{width:5px}
#chatMessages::-webkit-scrollbar-thumb{background:rgba(148,163,184,.45);border-radius:20px}

.chat-day-separator{
    text-align:center;
    color:#94a3b8;
    font-size:11px;
    margin:6px 0 14px;
}

.chat-item{
    width:fit-content !important;
    max-width:82% !important;
    padding:0 !important;
    margin:0 0 12px 0 !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
}

.chat-item:nth-child(even){
    margin-left:auto !important;
}

.chat-bubble{
    padding:11px 13px;
    border-radius:18px 18px 18px 6px;
    background:#1e293b;
    color:#e5e7eb;
    box-shadow:0 10px 24px rgba(0,0,0,.18);
    border:1px solid rgba(255,255,255,.06);
}

.chat-item:nth-child(even) .chat-bubble{
    border-radius:18px 18px 6px 18px;
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    color:#fff;
}

.chat-meta{
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:5px !important;
    font-size:11px !important;
    color:#a5b4fc !important;
}

.chat-item:nth-child(even) .chat-meta{
    color:rgba(255,255,255,.78) !important;
}

.chat-meta strong{
    color:inherit !important;
    font-size:12px !important;
    font-weight:800;
}

.chat-time{
    opacity:.82;
    font-size:10px;
}

.chat-text{
    font-size:15.5px !important;
    line-height:1.45 !important;
    font-weight:500 !important;
    color:inherit !important;
}

.chat-composer{
    padding:12px;
    background:rgba(2,6,23,.92);
    border-top:1px solid rgba(255,255,255,.08);
    backdrop-filter:blur(12px);
}

.chat-name-wrap{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:9px;
}

.chat-name-label{
    color:#94a3b8;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
}

#chatName{
    flex:1;
    width:auto !important;
    height:34px !important;
    border-radius:999px !important;
    border:1px solid rgba(148,163,184,.25) !important;
    background:rgba(15,23,42,.88) !important;
    color:#f8fafc !important;
    padding:0 12px !important;
    outline:none !important;
    font-size:13px !important;
    box-sizing:border-box !important;
}

.chat-form{
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
    width:100% !important;
}

#chatText{
    flex:1 !important;
    min-width:0 !important;
    height:46px !important;
    border-radius:18px !important;
    border:1px solid rgba(148,163,184,.25) !important;
    background:#111827 !important;
    color:#f8fafc !important;
    padding:0 14px !important;
    outline:none !important;
    font-size:14.5px !important;
}

#chatText::placeholder,
#chatName::placeholder{
    color:#64748b !important;
}

.emoji-btn{
    width:46px !important;
    min-width:46px !important;
    height:46px !important;
    border-radius:18px !important;
    border:1px solid rgba(255,255,255,.08) !important;
    background:#1e293b !important;
    color:#facc15 !important;
    font-size:20px !important;
    cursor:pointer !important;
}

#chatSendButton,
.send-btn{
    width:46px !important;
    min-width:46px !important;
    height:46px !important;
    padding:0 !important;
    border-radius:18px !important;
    border:0 !important;
    background:linear-gradient(135deg,#22c55e,#06b6d4) !important;
    color:#fff !important;
    cursor:pointer !important;
    font-size:0 !important;
    box-shadow:0 12px 25px rgba(6,182,212,.28) !important;
    position:relative;
}

#chatSendButton::before{
    content:"➤";
    font-size:20px;
    display:block;
    transform:translateX(1px);
}

#chatSendButton:disabled{
    opacity:.65;
    cursor:not-allowed;
}

#chatSendButton:disabled::before{
    content:"...";
    font-size:18px;
    transform:none;
}

#chatStatus{
    display:block !important;
    min-height:16px;
    margin-top:8px !important;
    font-size:11px !important;
    color:#22c55e;
}

.chat-help{
    color:#64748b;
    font-size:10.5px;
    text-align:center;
    margin-top:4px;
}

@media(max-width:480px){
    #chatBox{
        right:10px !important;
        bottom:10px !important;
        width:calc(100vw - 20px) !important;
        height:calc(100vh - 20px) !important;
        border-radius:22px !important;
    }

    #chatBox.chat-collapsed{
        width:auto !important;
        height:auto !important;
    }

    #chatBox.chat-collapsed .chat-launcher{
        padding:13px 15px !important;
        font-size:14px !important;
    }

    .chat-room-info{
        display:none;
    }

    .chat-topbar{
        padding:16px;
    }

    .chat-logo{
        width:42px;
        height:42px;
        border-radius:15px;
    }

    .chat-brand-title{
        font-size:17px;
    }

    .chat-text{
        font-size:15px !important;
    }
}
