/* .ctt-add {
    color: #67c472 !important;
    background-color: transparent !important;
    font-family: var(--main-font) !important;
    font-weight: bold !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    / * width: 100% !important;  * /
} */


/* ✅ ADICIONAR NO ARQUIVO css/common/chat.css */

/* Container da grid para posicionamento relativo */
.ctt-grid {
    position: relative;
}

.ctt-grid .gridjs-wrapper {
    height: calc(100vh - 250px) !important;
}

/* Célula do botão - posicionamento fixo à direita */
.ctt-grid .gridjs-td:last-child {
    position: sticky !important;
    right: 0 !important;
    background: white !important;
    z-index: 10 !important;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1) !important;
    min-width: 50px !important;
    text-align: center !important;
}

/* Botão dentro da célula */
.ctt-grid .ctt-add {
    position: relative !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    border: 1px solid #5fa2d0 !important;
    background: #5fa2d0 !important;
    color: white !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    min-width: 40px !important;
}

/* Hover do botão */
.ctt-grid .ctt-add:hover:not(:disabled) {
    background: #3676a3 !important;
    border-color: #3676a3 !important;
    transform: scale(1.05) !important;
}

/* Botão desabilitado */
.ctt-grid .ctt-add:disabled {
    background: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    transition: none !important;
}

/* Spinner de loading */
.ctt-grid .ctt-add .fa-spinner {
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ícone dentro do botão */
.ctt-grid .ctt-add .fa-envelope {
    font-size: 0.9rem !important;
    margin: 0 !important;
}

/* Ajuste para células de nome - evitar sobreposição */
.ctt-grid .gridjs-td:nth-child(2) {
    padding-right: 60px !important;
    max-width: calc(100% - 60px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.chatCloseBtn {
    display: none !important;
}

/* Responsivo para telas pequenas */
@media (max-width: 768px) {
    .ctt-grid .gridjs-td:last-child {
        position: relative !important;
        right: auto !important;
        box-shadow: none !important;
    }
    
    .ctt-grid .gridjs-td:nth-child(2) {
        padding-right: 0.5rem !important;
        padding-left: 0.5rem !important;
        max-width: none !important;
    }
}

/* ============================================================
 * MELHORIAS PARA LISTA DE CONTATOS DO CHAT
 * ============================================================ */

/* Aumentar altura da lista de contatos quando chat fechado */
.contact-list {
    height: calc(100vh - 74px); /*  !important; Altura maior para mostrar mais usuários */
    max-height: 100% !important; /* Altura máxima para não ficar muito grande */
    overflow-y: auto !important; /* Sempre mostrar scroll vertical */
    overflow-x: hidden !important;
}

/* Chat expandido - altura normal */
.cm-expanded .contact-list {
    height: calc(100vh - 74px) ; /* Manter altura original quando expandido */
    max-height: none !important;
}

/* Remover limite de 13 usuários quando chat fechado */
.contact-list > ul > li:nth-child(n + 14) {
    display: block !important; /* Mostrar todos os usuários */
}

/* Estilizar scroll da lista de contatos */
.contact-list::-webkit-scrollbar {
    width: 6px !important;
}

.contact-list::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px !important;
}

.contact-list::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 3px !important;
}

.contact-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

/* ============================================================
 * CHAT FLUTUANTE - SEM EMPURRAR O LAYOUT
 * ============================================================ */

/* Chat module flutuante */
.chat-module {
    position: fixed !important; /* Fixo na tela, não empurra conteúdo */
    right: 0 !important;
    top: 0 !important;
    height: 100vh !important; /* Altura total da viewport */
    z-index: 9998 !important; /* Alto z-index para ficar sobre tudo */
    background: #ffffff !important; /* Fundo branco sólido para melhor legibilidade */
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1) !important;
    border-left: 1px solid #ddd !important;
    transition: width 0.3s ease !important;
}

/* Chat fechado - apenas ícone */
.chat-module {
    width: 48px !important;
}

/* Chat expandido - largura completa */
.chat-module.cm-expanded {
    width: 256px !important;
}

/* Remover contração do conteúdo principal */
#contentContainer.sc-contracted {
    margin-right: 0 !important; /* Não empurra o conteúdo */
    width: 100% !important; /* Mantém largura total */
}

/* Header não contrai */
header.hd-contracted {
    margin-right: 0 !important;
    width: 100% !important;
}

/* Partial block não contrai */
#partialBlock.sc-contracted {
    margin-right: 0 !important;
    width: 100% !important;
}

/* Ajustar alertas para não ficarem atrás do chat */
#_GENERIC_ALERT {
    right: 260px !important; /* Espaço para o chat expandido */
    width: calc(100% - 260px) !important;
}

/* Quando chat fechado, alertas voltam ao normal */
.chat-module:not(.cm-expanded) ~ #_GENERIC_ALERT,
.chat-module:not(.cm-expanded) + #_GENERIC_ALERT {
    right: 60px !important;
    width: calc(100% - 0) !important;
}



/* ============================================================
 * MELHORIAS RESPONSIVAS
 * ============================================================ */

/* Para telas menores, ajustar altura */
@media (max-height: 600px) {
    .contact-list {
        /* height: calc(100vh - 150px) !important; */
        max-height: 400px !important;
    }
}

/* Para telas muito pequenas */
@media (max-width: 480px) {
    .contact-list {
        width: 100% !important;
        height: 100% !important;
        max-height: 350px !important;
    }

    .chatCloseBtn {
        display: block !important;
    }
    
    /* Reduzir tamanho dos tooltips em mobile */
    .ctt-item .ctt-name::after,
    .ctt-item .ctt-icon::after {
        font-size: 11px !important;
        padding: 3px 6px !important;
        max-width: 150px !important;
    }

    /* .ctt-grid .gridjs-wrapper {
        height: 100% !important;
    } */
}