/* ==================================================
   VARIÁVEIS DE COR E NEON (Aproveitando paleta do Header)
   ================================================== */
:root {
    --wv-neon: #40E0D0; /* Neon principal: Azul turquesa */
    --wv-pulse: #FF0080; /* Pulso: Rosa neon */
    --chat-header-bg: linear-gradient(180deg, #102c3a, #133a4a); /* Gradiente escuro do Header */
    --chat-header-color: #ffffff;
    --chat-body-bg: #1b1b1b; /* Fundo escuro (dark-theme) */
    --chat-body-color: #ffffff;
    --chat-bubble-agent: #f0f0f0; /* Bolha do agente em cinza claro */
    --chat-bubble-user: #2a8177; /* Bolha do usuário combinando com hover do Header */
}

/*:root {*/
/*  --wv-neon: #00FFFF;      !* Neon principal: Ciano *!*/
/*  --wv-pulse: #FF0090;     !* Pulso: Rosa neon *!*/
/*  --chat-header-bg: linear-gradient(180deg, #102c3a, #133a4a);*/
/*  --chat-header-color: #ffffff;*/
/*  --chat-body-bg: #0D0D0D;*/
/*  --chat-body-color: #ffffff;*/
/*  --chat-bubble-agent: #2a2a2a;*/
/*  --chat-bubble-user: #00FFFF;*/
/*}*/

/*:root {*/
/*  --wv-neon: #40E0D0;      !* Neon principal: Azul turquesa *!*/
/*  --wv-pulse: #FF0080;     !* Pulso: Rosa neon *!*/
/*  --chat-header-bg: linear-gradient(180deg, #161616, #222);*/
/*  --chat-header-color: #ffffff;*/
/*  --chat-body-bg: #0C0C0C;*/
/*  --chat-body-color: #ffffff;*/
/*  --chat-bubble-agent: #303030;*/
/*  --chat-bubble-user: #40E0D0;*/
/*}*/
/* ==================================================
   ANIMAÇÕES COMUNS
   ================================================== */
@keyframes wv-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes wv-btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7), 0 0 6px var(--wv-neon);
    }
    70% {
        box-shadow: 0 0 0 24px rgba(255, 152, 0, 0), 0 0 6px var(--wv-neon);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0), 0 0 6px var(--wv-neon);
    }
}

@keyframes wv-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pontinhos de digitação */
@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ==================================================
   BOTÃO FLUTUANTE
   ================================================== */
#wv-chat-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 2.5rem;
    z-index: 1050;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background: #090808;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease-in-out;
    animation: wv-float 3s ease-in-out infinite, wv-btn-pulse 2s infinite;
    backface-visibility: hidden;
    will-change: transform;
    cursor: pointer;
}

#wv-chat-toggle:hover {
    transform: scale(1.05) rotate(-2deg);
}

.wv-chat {
    pointer-events: none; /* para não capturar cliques no SVG */
}

/* Anel girando continuamente */
.wv-chat .ring {
    stroke: var(--wv-neon);
    stroke-dasharray: 4 5;
    transform-origin: 50% 50%;
    animation: wv-spin 6s linear infinite;
}

/* Texto dentro do botão */
.wv-chat text {
    font-size: 9px;
    font-weight: 700;
    fill: var(--wv-neon);
    letter-spacing: 0.1px;
    stroke: none;
    text-rendering: geometricPrecision;
}

/* ==================================================
   CONTAINER DO CHAT
   ================================================== */
#wv-chat-container {
    position: fixed;
    z-index: 1049;
    display: none; /* Inicia fechado */
    bottom: 30px;
    right: 30px;
    width: 480px;
    height: 620px;
}

@media (max-width: 767.98px) {
    #wv-chat-container {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        margin: 0;
    }
}

/* ==================================================
   CAIXA (CARD) DO CHAT
   ================================================== */
.chat-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    background: var(--chat-body-bg);
    color: var(--chat-body-color);
}

@media (max-width: 767.98px) {
    .chat-card {
        border-radius: 0;
    }
}

/* ==================================================
   HEADER DO CHAT
   ================================================== */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--chat-header-bg);
    color: var(--chat-header-color);
    padding: 0.5rem 1rem;
    border-bottom: 2px solid var(--wv-neon);
    position: relative;
}

/* Botões do header */
.header-btn {
    background: transparent;
    color: #fff;
    border: 2px solid var(--wv-neon);
    border-radius: 5px;
    cursor: pointer;
    margin-left: 0.5rem;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.header-btn:hover {
    box-shadow: 0 0 8px var(--wv-neon), 0 0 8px var(--wv-neon) inset;
}

/* ==================================================
   CORPO DE MENSAGENS
   ================================================== */
.chat-body {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.quick-options button {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 calc(33.33% - 0.5rem);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.35rem;
    transition: background .2s, transform .2s;
}

.quick-options button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.quick-options i {
    font-size: 16px;
}

.bubble {
    max-width: 75%;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
    animation: slideIn .25s ease-out;
}

.bubble.agent {
    background: var(--chat-bubble-agent);
    color: #000;
    margin-right: auto;
    border-bottom-left-radius: 2px;
    box-shadow: 0 0 4px var(--wv-neon);
}

.bubble.agent::after {
    content: "";
    position: absolute;
    left: -6px;
    bottom: 0;
    border-right: 6px solid var(--chat-bubble-agent);
    border-top: 6px solid transparent;
}

.bubble.user {
    background: var(--chat-bubble-user);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.bubble.user::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 0;
    border-left: 6px solid var(--chat-bubble-user);
    border-top: 6px solid transparent;
}

/* ==================================================
   FOOTER (BARRA DE ENVIO)
   ================================================== */
.chat-footer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--chat-header-bg);
    border-top: 2px solid var(--wv-neon);
    padding: 0.45rem 0.5rem;
}

.chat-footer button {
    background: transparent;
    border: 2px solid var(--wv-neon);
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

.chat-footer button:hover {
    box-shadow: 0 0 8px var(--wv-neon), 0 0 8px var(--wv-neon) inset;
}

.chat-footer textarea {
    flex: 1;
    resize: none;
    border: 2px solid var(--wv-neon);
    border-radius: 5px;
    padding: 0.5rem 0.75rem;
    outline: none;
    font-size: 0.9rem;
    color: #000;
}

.chat-footer textarea::placeholder {
    color: #999;
}

/* ==================================================
   BOLHA DE "DIGITANDO..."
   ================================================== */
.typing-bubble .bubble-text {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    animation: dotBounce 1s infinite ease-in-out;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* ==================================================
   ESTILO DO HORÁRIO NA BOLHA
   ================================================== */
.bubble-time {
    font-size: 0.6rem;
    color: #d4d4d4;
    margin-top: 4px;
    text-align: right;
}

/* equalizer antigo (usado no preview de gravação) */
.voice-bars {
    display: flex;
    gap: 3px;
    height: 14px;
}

.voice-bars span {
    width: 3px;
    background: #0096ff;
    animation: bar 1s ease-in-out infinite;
    transform-origin: bottom;
}

.voice-bars span:nth-child(1) {
    animation-delay: -0.2s
}

.voice-bars span:nth-child(2) {
    animation-delay: -0.4s
}

.voice-bars span:nth-child(3) {
    animation-delay: -0.6s
}

.voice-bars span:nth-child(4) {
    animation-delay: -0.8s
}

.voice-bars span:nth-child(5) {
    animation-delay: -1s
}

@keyframes bar {
    0%, 100% {
        transform: scaleY(.2)
    }
    50% {
        transform: scaleY(1)
    }
}

.mic-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--wv-neon);
    border-radius: 50%;
    background: transparent;
    transition: background .3s ease, transform .1s;
}

.mic-btn:active {
    transform: scale(.92)
}

.mic-btn.recording {
    background: var(--wv-neon);
    box-shadow: 0 0 12px var(--wv-neon), 0 0 22px var(--wv-pulse);
}

.mic-icon {
    font-size: 1.2rem;
    color: #fff;
    pointer-events: none
}

.mic-wave {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    opacity: 0;
    transition: opacity .25s;
}

.mic-wave span {
    width: 3px;
    height: 8px;
    background: #fff;
    animation: wv-eq 1s ease-in-out infinite;
    transform-origin: bottom;
}

.mic-wave span:nth-child(2) {
    animation-delay: -.2s
}

.mic-wave span:nth-child(3) {
    animation-delay: -.4s
}

.mic-wave span:nth-child(4) {
    animation-delay: -.6s
}

.mic-wave span:nth-child(5) {
    animation-delay: -.8s
}

@keyframes wv-eq {
    0%, 100% {
        height: 8px
    }
    50% {
        height: 18px
    }
}

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

.mic-btn.recording .mic-wave {
    opacity: 1
}

.mic-btn.recording .mic-icon {
    opacity: .25
}

/* mantém o botão visível durante gravação */
.is-recording #wv-chat-mic {
    display: flex
}

/* oculta apenas os outros botões/campos */
.is-recording #wv-chat-input,
.is-recording #wv-chat-send,
.is-recording #wv-chat-attach,
.is-recording #wv-chat-clear,
.is-recording #wv-chat-restart {
    display: none
}

.is-recording .chat-footer{
    justify-content: center;   /* alinha tudo no meio */
}
