﻿@media (hover: none,max-width: 768px) {
    .msg-recebida, .msg-enviada {
        max-width: 75%;
    }

    .msg-actions {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

    /* container global do app */
    body > #app {
        height: 100%;
    }

/* layout de linha principal */
.container-fluid, .row {
    height: 100%;
}

/* cada coluna principal */
.col-2, .col-3, .col-7 {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* conteúdo com scroll interno */
.scrollable, .flex-grow-1.overflow-auto, .chat-mensagens {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* input fixo no rodapé */
.input-footer {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

/* cabeçalho do chat */
.chat-header {
    background-color: #f0f2f5;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    flex-shrink: 0;
}

/* área que envolve as mensagens */
.chat-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* bolhas de mensagens */
.bolha-mensagem {
    background-color: #f0f0f0;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    position: relative;
    font-size: 1rem; /* 👈 aumenta a legibilidade */
    line-height: 1.4; /* 👈 espaço entre linhas */

}

    .bolha-mensagem.enviado {
        background-color: #d1e7dd;
        align-self: flex-end;
    }

    .bolha-mensagem.recebido {
        background-color: #fff;
        border: 1px solid #ccc;
        align-self: flex-start;
    }



    
.dropdown-menu {
    z-index: 9999;
}
.msg-recebida, .msg-enviada {
    position: relative;    
    border-radius: 7.5px;
    box-shadow: 0 1px .5px rgba(0,0,0,.13);
    font-size: 14px;
    line-height: 12px;
    max-width: 50%; /* <= metade da coluna */
    word-break: break-word;
}

.msg-recebida {
    background: #ffffff;
    min-width: 15%;
    padding: 8px 5px 2px 10px; /* espaço à direita p/ hora + checks */
    color: #111b21;
    border-bottom-left-radius: 0;
    margin-right: auto; /* “encosta” à esquerda */
}

.msg-enviada {
    background: #dcf8c6; /* verde clássico */
    padding: 8px 10px 2px 10px; /* espaço à direita p/ hora + checks */
    color: #111b21;
    border-bottom-right-radius: 0;
    margin-left: auto; /* “encosta” à direita */
}
/* “Rabinho” das bolhas */
.msg-recebida::after {
    content: "";
    position: absolute;
    left: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border-right: 8px solid #fff;
    border-top: 8px solid transparent;
}

.msg-enviada::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 8px solid #dcf8c6;
    border-top: 8px solid transparent;
}
.input-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.composer-textarea {
    flex: 1;
    min-height: 40px; /* 1 linha */
    max-height: 25vh; /* limite visual (fallback) */
    padding: .6rem .8rem;
    line-height: 1.35;
    border: 1px solid #e1e7ef;
    border-radius: 12px;
    background: #fff;
    resize: none; /* tamanho controlado via JS */
    overflow-y: auto; /* mostra scroll quando passar do limite */
}
.bg-light.px-3.py-2.border-bottom {
    background-color: #f1f1f1;
    font-size: 0.9rem;
    border-left: 4px solid #0d6efd;
}
.chat-thumb {
    max-width: 320px; /* “tamanho WhatsApp Web” aprox */
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
    cursor: zoom-in;
}

.file-thumb {
    width: 64px;
    height: 64px;
    background: #f0f2f5;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-default {
    cursor: default;
}
/* anima “piscando” com leve fundo e anel */
@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(255,193,7,0.9);
        background-color: #fff3cd;
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255,193,7,0.15);
        background-color: #fffdf5;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255,193,7,0);
        background-color: transparent;
    }
}

/* aplica na bolha (tanto recebida quanto enviada) */
.msg-enviada.flash-highlight,
.msg-recebida.flash-highlight {
    animation: pulseHighlight 0.8s ease-out 2;
    border-radius: 12px; /* caso a bolha não tenha */
}

/* Fundo suave tipo WhatsApp Web */
.chat-mensagens {
    background: #e5ddd5;
    background-image: radial-gradient(rgba(0,0,0,.03) 1px, transparent 1px), radial-gradient(rgba(0,0,0,.02) 1px, transparent 1px);
    background-position: 0 0, 12px 12px;
    background-size: 24px 24px;
}

/* Linha de mensagem */
.message-row {
    gap: 8px;
}

/* Bolhas */
.bubble {
    max-width: 50%;
    padding: 5px 7px;
    border-radius: 18px 18px 0px 18px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    position: relative;
    word-break: break-word;
}


/* Imagens */
.chat-image {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

/* “Cartuchinho” de Responder */
.reply-chip {
    font-size: .85rem;
    color: #6b7a8c;
    background: rgba(255,255,255,.6);
    border-left: 3px solid #9bb0c3;
    padding: 6px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
}

/* Meta (hora + ticks) */
.meta-row {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    opacity: .8;
    font-size: .8rem;
}

/* Avatar com iniciais */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #dbe4ee;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    box-shadow: 0 1px 1px rgba(0,0,0,.06) inset, 0 1px 0 rgba(255,255,255,.6);
}

/* Arquivo */
.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,.6);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.file-name {
    font-weight: 600;
}

.file-caption {
    font-size: .85rem;
    color: #6b7a8c;
}

/* Header clean */
.chat-header {
    background: #fff !important;
    border-bottom: 1px solid #e7edf4 !important;
}

/* Composer */
.composer {
    background: #fff;
}

.input-pill {
    border-radius: 999px;
    border: 1px solid #e1e7ef;
    padding: .6rem .9rem;
    background: #f8fafc;
}

.btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Destaque piscando ao localizar a original */
@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(255,193,7,.9);
        background-color: #fff3cd;
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255,193,7,.15);
        background-color: #fffdf5;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255,193,7,0);
        background-color: transparent;
    }
}

.bubble.flash-highlight {
    animation: pulseHighlight .8s ease-out 2;
}
/* item da lista de contatos */
.contact-row {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    transition: background .15s ease;
}

    .contact-row:hover {
        background: #f7faff;
    }

    .contact-row.active {
        background: #e9f3ff;
    }

/* avatar com iniciais */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    font-weight: 700;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.06);
}

/* textos do contato */
.contact-text {
    min-width: 0;
}
/* permite truncar */
.contact-name {
    font-weight: 600;
    max-width: 180px;
}

.contact-sub {
    line-height: 1.2;
}
#chatContainer .d-flex {
    gap: 8px;
}
.composer-ce {
    flex: 1;
    min-height: 40px; /* 1 linha */
    max-height: 25vh; /* limite visual (fallback) */
    padding: .6rem .8rem;
    line-height: 1.35;
    border: 1px solid #e1e7ef;
    border-radius: 12px;
    background: #fff;
    overflow-y: auto; /* scroll quando passar do limite */
    white-space: pre-wrap; /* mantém quebras */
    outline: none;
}

    /* placeholder para contenteditable */
    .composer-ce:empty:before {
        content: attr(data-placeholder);
        color: #9aa1a9;
    }
/* container do botão/menu */
/* escondido por padrão */
.msg-actions {
    position: absolute;
    top: -6px;
    right: -6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-2px);
    transition: opacity .12s ease, transform .12s ease;
    z-index: 2;
    pointer-events: none; /* evita clique enquanto oculto */
}
/* botão transparente SEM borda/anel em qualquer estado */
.btn-msg-action,
.btn-msg-action:hover,
.btn-msg-action:active,
.btn-msg-action:focus,
.btn-msg-action:focus-visible,
.dropdown.show > .btn-msg-action {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent; /* mobile */
}
/* só mostra quando o mouse está NA BOLHA */
.msg-recebida:hover > .msg-actions,
.msg-enviada:hover > .msg-actions {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}
/* 🎨 cor do ÍCONE por tipo de bolha */
.msg-recebida .btn-msg-action i{        /* bolha branca */
  color:#54656f;                         /* cinza visível no branco */
}
.msg-recebida .btn-msg-action:hover i{
  color:#3b4a54;                         /* um pouco mais escuro no hover */
}

.msg-enviada .btn-msg-action i{         /* bolha verde */
  color:#0b6b3a;                         /* verde escuro */
}
.msg-enviada .btn-msg-action:hover i{
  color:#064f2d;                         /* fica mais forte no hover */
}
/* botão redondinho */
.btn-msg-action {
    padding: 12px 10px;
    border-radius: 50%;
    background: transparent;
    color: transparent;
    line-height: 1;
}

    .btn-msg-action:hover {
        background: transparent;
    }
/* caixa do menu */
.menu-actions {
    padding: 6px;
    border: 1px solid #e6eaef;
    border-radius: 12px;
    min-width: 220px;
}

    /* item padrão */
    .menu-actions .dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer; /* mãozinha */
        color: #202b38;
        transition: background .12s ease, box-shadow .12s ease;
    }

        /* ícone do item */
        .menu-actions .dropdown-item .bi {
            font-size: 1rem;
            opacity: .7;
            transition: transform .12s ease, opacity .12s ease, color .12s ease;
        }

        /* HOVER: fundo levemente elevado + ícone mais forte e “desliza” 2px */
        .menu-actions .dropdown-item:hover,
        .menu-actions .dropdown-item:focus {
            background: #f2f5f8;
            box-shadow: inset 0 1px 4px rgba(0,0,0,.06);
            outline: none;
        }

            .menu-actions .dropdown-item:hover .bi,
            .menu-actions .dropdown-item:focus .bi {
                opacity: 1;
                transform: translateX(2px);
                color: #0b5ed7; /* cor do ícone no hover */
            }

    /* separador com mais respiro */
    .menu-actions .dropdown-divider {
        margin: .35rem 0;
    }

    /* item perigoso (apagar) com hover vermelho clarinho */
    .menu-actions .dropdown-item.text-danger {
        color: #dc3545;
    }

        .menu-actions .dropdown-item.text-danger .bi {
            color: #dc3545;
            opacity: .9;
        }

        .menu-actions .dropdown-item.text-danger:hover {
            background: #fff1f2;
            box-shadow: inset 0 1px 4px rgba(220,53,69,.15);
        }
/*Parte das respostas de mensagens*/
.reply-chip {
    background: rgba(0,0,0,0.04);
    border-left: 3px solid #0d6efd;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
}

.reply-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.1);
    flex: 0 0 auto;
}

/* “poster” simples para vídeo */
.video-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #222;
    color: #fff;
    font-size: 18px;
}

/* caixinha neutra para áudio/documento */
.icon-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #495057;
    font-size: 16px;
}

.reply-text {
    max-width: 320px; /* ajuste conforme layout */
    white-space: nowrap;
}
/*Ajuste do player de video*/
.chat-video {
    max-width: 360px; /* ajuste pro seu layout */
    width: 100%;
    height: auto;
    border-radius: 8px;
    outline: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.video-row .file-name {
    font-weight: 600;
    margin-bottom: .25rem;
}
/* ajuste visual */
.btn-circle {
    border-radius: 9999px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-text {
    white-space: pre-wrap;
}
/* preserva \n e quebra linhas longas */
.file-caption {
    white-space: pre-wrap;
}
/* opcional: legenda de doc/img */
.reply-text {
    white-space: pre-wrap;
}
/* opcional: cartucho de resposta */