/* === NELO - Assistente em audio do Pecuaria 360 === */

.nelo-balao {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 2500;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 12px 14px 12px 96px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: neloEntrar 0.35s ease;
    border: 2px solid #1B5E20;
}

.nelo-balao--saindo {
    animation: neloSair 0.3s ease forwards;
}

.nelo-balao__avatar {
    position: absolute;
    left: -8px;
    bottom: -8px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid #1B5E20;
    background-image: url("../imagens/nelo.png");
    background-size: cover;
    background-position: center;
    transition: transform 0.2s ease;
}

.nelo-balao--falando .nelo-balao__avatar {
    animation: neloPulsar 0.9s ease-in-out infinite;
}

.nelo-balao__cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nelo-balao__config {
    background: transparent;
    border: none;
    color: #1B5E20;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.nelo-balao__config:hover { background: rgba(27, 94, 32, 0.08); }
.nelo-balao__config .material-symbols-outlined { font-size: 1.05rem; }

.nelo-balao__nome {
    font-weight: 700;
    color: #1B5E20;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.nelo-balao__nome::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4A537;
    box-shadow: 0 0 6px #D4A537;
}

.nelo-balao__fechar {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 1.1rem;
    line-height: 1;
}

.nelo-balao__fechar:hover {
    background: rgba(0, 0, 0, 0.06);
}

.nelo-balao__legenda {
    font-size: 0.88rem;
    color: #333;
    line-height: 1.4;
    max-height: 8.4em;
    overflow-y: auto;
    padding-right: 4px;
}

.nelo-balao__controles {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

.nelo-balao__botao {
    background: #1B5E20;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s ease;
}

.nelo-balao__botao:hover {
    background: #2E7D32;
}

.nelo-balao__botao--secundario {
    background: transparent;
    color: #1B5E20;
    border: 1px solid #1B5E20;
}

.nelo-balao__botao--secundario:hover {
    background: rgba(27, 94, 32, 0.08);
}

.nelo-balao__progresso {
    height: 3px;
    background: rgba(27, 94, 32, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.nelo-balao__progresso-barra {
    height: 100%;
    background: linear-gradient(90deg, #1B5E20, #D4A537);
    width: 0%;
    transition: width 0.2s linear;
}

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

@keyframes neloSair {
    to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

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

/* Tela pequena: balao ocupa quase toda a largura */
@media (max-width: 480px) {
    .nelo-balao {
        left: 8px;
        right: 8px;
        width: auto;
        bottom: 8px;
        padding-left: 88px;
    }
    .nelo-balao__avatar {
        width: 84px;
        height: 84px;
    }
}

/* === BOTAO FLUTUANTE DO NELO (chamar quando precisar) === */
.nelo-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: white;
    background-image: url("../imagens/nelo.png");
    background-size: cover;
    background-position: center;
    border: 3px solid #1B5E20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 2400;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nelo-fab:hover, .nelo-fab:focus {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    outline: none;
}

.nelo-fab--pulsando::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px solid #D4A537;
    animation: neloFabPulse 2.2s ease-out infinite;
}

@keyframes neloFabPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Esconde o FAB quando o balao esta aberto (evita sobreposicao) */
.nelo-fab--escondido {
    display: none !important;
}

/* Zona de fechar (estilo bolha do YouTube): aparece na base enquanto a bolha
   é arrastada; soltar nela guarda o Nelo (oculta + silencia). */
.nelo-drop {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%) scale(0.6);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.78);
    color: #fff;
    font-size: 26px;
    line-height: 64px;
    text-align: center;
    z-index: 2600;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
    pointer-events: none;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.nelo-drop--ativa {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.nelo-drop--alvo {
    background: #C62828;
    transform: translateX(-50%) scale(1.25);
}

/* === DESTAQUE DA SECAO AJUDA QUANDO CHEGA PELO NELO === */
@keyframes neloDestaque {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 165, 55, 0);
        background-color: transparent;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(212, 165, 55, 0.55);
        background-color: rgba(212, 165, 55, 0.10);
    }
}

.nelo-destacar {
    animation: neloDestaque 1.3s ease-in-out 3;
    border-radius: 14px;
    transition: box-shadow 0.3s ease;
    padding: 4px;
    margin: -4px;
}

/* === MODAL DE BOAS-VINDAS === */
.nelo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: neloModalFade 0.25s ease;
}

@keyframes neloModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nelo-modal {
    background: white;
    border-radius: 18px;
    max-width: 380px;
    width: 100%;
    padding: 76px 20px 20px;
    position: relative;
    margin-top: 60px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.nelo-modal__avatar {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    background-image: url("../imagens/nelo.png");
    background-size: cover;
    background-position: center;
    border: 4px solid #1B5E20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nelo-modal__titulo {
    color: #1B5E20;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px;
}

.nelo-modal__texto {
    color: #333;
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: center;
    margin: 0 0 16px;
    max-height: 180px;
    overflow-y: auto;
}

.nelo-modal__acoes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nelo-modal__botao {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nelo-modal__botao--primario {
    background: #1B5E20;
    color: white;
}
.nelo-modal__botao--primario:hover { background: #2E7D32; }

.nelo-modal__botao--secundario {
    background: transparent;
    color: #1B5E20;
    border: 1px solid #1B5E20;
}
.nelo-modal__botao--secundario:hover { background: rgba(27, 94, 32, 0.08); }

.nelo-modal__botao--terciario {
    background: transparent;
    color: #666;
    font-size: 0.85rem;
}
.nelo-modal__botao--terciario:hover { color: #333; text-decoration: underline; }
