.chat-mensagem-box {
    width: 95%;
    margin: 2px auto;
}

.chat-mensagem-texto .whatsapp-code {
    display: block;
    margin: 6px 0;
    padding: 10px 12px;
    background: midnightblue;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
}

.whatsapp-inline-code {
    padding: 2px 5px;
    background: #f1f1f1;
    border-radius: 6px;
    font-family: monospace;
}

#emoji-picker-container {
    position: absolute;
    bottom: 60px;
    left: 10px;
    z-index: 9999;
}

.message-input {
    resize: none;
    height: 38px; /* mantém fixo em 1 linha, sem crescer */
    max-height: 100px; /* limite se você quiser permitir crescimento controlado */
    overflow-y: auto; /* precisa ser auto ou scroll, não hidden, senão não rola */
    line-height: 1.4;
    padding: 8px 0;
    font-family: inherit;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;

    /* esconde a barra de rolagem, mas mantém o scroll funcionando */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE e Edge legado */
}

/* Chrome, Safari, Edge novo (baseado em Chromium) */
.message-input::-webkit-scrollbar {
    display: none;
}

.chat-mensagem {
    transition: opacity 0.15s ease;
}

.chat-mensagem:hover {
    cursor: pointer;
    opacity: 0.5;
}

.modal-mensagem-mini .modal-dialog {
    max-width: 280px;
}

.wa-audio-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #202c33;
    border-radius: 8px;
    padding: 6px 10px;
    width: 180px;
    min-height: 34px;
}

.wa-audio-play {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #00a884;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.wa-audio-wave {
    height: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.wa-audio-wave span {
    width: 3px;
    background: #8696a0;
    border-radius: 999px;
}

.wa-audio-wave span:nth-child(1) {
    height: 4px;
}

.wa-audio-wave span:nth-child(2) {
    height: 7px;
}

.wa-audio-wave span:nth-child(3) {
    height: 5px;
}

.wa-audio-wave span:nth-child(4) {
    height: 9px;
}

.wa-audio-wave span:nth-child(5) {
    height: 6px;
}

.wa-audio-wave span:nth-child(6) {
    height: 10px;
}

.wa-audio-wave span:nth-child(7) {
    height: 5px;
}

.wa-audio-wave span:nth-child(8) {
    height: 8px;
}

.wa-audio-wave span:nth-child(9) {
    height: 4px;
}

.wa-audio-wave span:nth-child(10) {
    height: 7px;
}


.wa-arquivo-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f1f2f4;
    max-width: 320px;
}

.wa-arquivo-icon {
    flex-shrink: 0;
    color: #667781;
}

.wa-arquivo-nome {
    font-size: 13px;
    font-weight: 500;
    color: #111b21;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.btn-carregar-mais, .btn-carregar-mais-antigas, .btn-carregar-mais-recentes {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 14px;

    border: none;
    border-radius: 999px;

    background: #202c33;
    color: #d1d7db;

    font-size: 12px;
    font-weight: 500;

    cursor: pointer;

    transition: all .15s ease;
}

.btn-carregar-mais:hover {
    background: #2a3942;
    transform: translateY(-1px);
}

.btn-carregar-mais svg {
    width: 14px;
    height: 14px;
}

.chat-mensagem-alterada {
    display: inline-block;
    border: 2px solid #d946ef;
    background: linear-gradient(
        90deg,
        rgba(168, 85, 247, 0.08),
        rgba(236, 72, 153, 0.08)
    );
    border-radius: 10px;
    padding: 4px 8px;
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.20);
}

.wa-btn-carregar-mais.disabled,
.wa-btn-carregar-mais:disabled {
    opacity: .6;
    cursor: not-allowed;
    pointer-events: none;
}


/* ===== Sidebar de busca ===== */
.busca-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: #ffffff;
    color: #111b21;
    border-left: 1px solid #e9edef;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* ===== Header ===== */
.busca-sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border-bottom: 1px solid #e9edef;
    font-size: 16px;
    font-weight: 600;
    color: #111b21;
}

.btn-fechar-busca {
    background: none;
    border: none;
    color: #667781;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.btn-fechar-busca:hover {
    background: #f0f2f5;
    color: #111b21;
}

/* spinner de carregamento no header */
.busca-spinner {
    width: 18px;
    height: 18px;
    margin-left: auto;
    animation: busca-spin 0.8s linear infinite;
}

.busca-spinner circle {
    stroke: #00a884;
    stroke-linecap: round;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    animation: busca-dash 1.2s ease-in-out infinite;
}

@keyframes busca-spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes busca-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ===== Input de busca ===== */
.busca-sidebar-input-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #e9edef;
    background: #ffffff;
}

.busca-sidebar-input-wrap input {
    width: 100%;
    background: #f0f2f5;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 14px;
    color: #111b21;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.busca-sidebar-input-wrap input::placeholder {
    color: #667781;
}

.busca-sidebar-input-wrap input:focus {
    background: #ffffff;
    border-color: #00a884;
}

/* ===== Lista de resultados ===== */
.busca-resultados {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

.busca-data-label {
    padding: 10px 16px 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #667781;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.busca-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s ease;
}

.busca-item:hover {
    background: #f5f6f6;
}

.busca-item.active {
    background: #e7f9f1;
    border-left: 3px solid #00a884;
    padding-left: 13px;
}

.busca-item-hora {
    font-size: 12px;
    color: #667781;
    margin-bottom: 3px;
}

.busca-item-texto {
    font-size: 14px;
    color: #3b4a54;
    line-height: 1.4;
    word-break: break-word;
}

.busca-item-texto mark {
    background: #00a884;
    color: #ffffff;
    border-radius: 3px;
    padding: 1px 3px;
    font-weight: 500;
}

/* ===== Estado vazio / erro ===== */
.busca-vazio {
    padding: 32px 20px;
    color: #667781;
    text-align: center;
    font-size: 14px;
}

/* ===== Scrollbar (opcional, deixa mais discreto) ===== */
.busca-resultados::-webkit-scrollbar {
    width: 6px;
}

.busca-resultados::-webkit-scrollbar-thumb {
    background: #d1d7db;
    border-radius: 3px;
}

.busca-resultados::-webkit-scrollbar-track {
    background: transparent;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .busca-sidebar {
        width: 100%;
        border-left: none;
        box-shadow: none;
    }

    .busca-sidebar-header {
        padding: 14px 12px;
    }

    .busca-item {
        padding: 12px 16px;
    }

    .busca-item-texto {
        font-size: 15px;
    }
}

.chat-btn-acoes {
    transition: all 0.25s ease-in-out;
}

/* Efeito ao passar o mouse */
.chat-btn-acoes:hover {
    background-color: #f0f7ff; /* Fundo azul bem claro */
    color: #2563eb; /* Cor do texto/ícone azul (Tailwind blue-600) */
    /* Sombra azul para destaque */
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.35);
    transform: translateY(-1px); /* Leve elevação visual */
}

/* Efeito de clique */
.chat-btn-acoes:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px 0 rgba(37, 99, 235, 0.2);
}
