/* ========================================
   VOXTREAM BRASIL - CHAT COM IA
   ======================================== */

/* FAB Button */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a8cc, #0088aa);
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 168, 204, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    animation: chatPulse 2s infinite;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 168, 204, 0.6);
}

@keyframes chatPulse {
    0%, 100% { box-shadow: 0 5px 20px rgba(0, 168, 204, 0.4); }
    50% { box-shadow: 0 5px 30px rgba(0, 168, 204, 0.6); }
}

/* Overlay */
.chat-overlay {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 380px;
    height: 540px;
    background: #1a1a2e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 168, 204, 0.3);
    animation: chatSlideUp 0.3s ease;
}

.chat-overlay.open {
    display: flex;
}

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

/* Header */
.chat-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 168, 204, 0.2);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a8cc, #0088aa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
}

.chat-info h3 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.chat-info span {
    color: #00ff88;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-info span::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ff88;
    animation: chatOnline 1.5s infinite;
}

@keyframes chatOnline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-header-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #16213e;
}

.chat-body::-webkit-scrollbar {
    width: 4px;
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 168, 204, 0.3);
    border-radius: 4px;
}

/* Messages */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    display: block;
    animation: msgFadeIn 0.3s ease;
    font-family: 'Poppins', sans-serif;
    word-wrap: break-word;
    white-space: pre-wrap !important;
    word-break: break-word;
}

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

.bot-msg {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.user-msg {
    background: linear-gradient(135deg, #00a8cc, #0088aa);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00a8cc;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Footer */
.chat-footer {
    padding: 12px;
    background: #1a1a2e;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 8px;
}

.chat-footer input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-footer input::placeholder {
    color: #64748b;
}

.chat-footer input:focus {
    border-color: #00a8cc;
}

.chat-footer button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00a8cc, #0088aa);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-footer button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 168, 204, 0.4);
}

/* Mobile */
@media (max-width: 576px) {
    .chat-overlay {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-fab {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }
}
