/* Chat Popup Styles - Comunicador Institucional Profissional (Migrado do BPM) */
.chat-popup {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    z-index: 99999;
    border: 1px solid #e2e8f0;
    animation: slideUpPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpPop {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.chat-popup-header {
    background: #1e40af;
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-popup-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
    position: relative;
}

.chat-search-bar {
    padding: 12px 15px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-search-bar input[type="text"] {
    width: 100%;
    padding: 10px 35px 10px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.chat-search-bar input:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 25px;
    top: 22px;
    background: #f1f5f9;
    border: none;
    color: #94a3b8;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
}

.chat-tabs {
    display: flex;
    background: white;
    padding: 0 15px;
    border-bottom: 1px solid #e2e8f0;
    gap: 15px;
}

.chat-tab {
    padding: 12px 5px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    text-transform: uppercase;
}

.chat-tab.active {
    color: #1e40af;
    border-bottom-color: #1e40af;
}

.contact-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.contact-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.2s;
    position: relative;
}

.contact-item:hover {
    background: #f0f7ff;
}

.contact-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
}

.chat-window-pop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: none;
    flex-direction: column;
    z-index: 100;
}

.chat-win-header {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-win-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-pop {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    position: relative;
}

.msg-pop-me {
    align-self: flex-end;
    background: #1e40af;
    color: white;
    border-bottom-right-radius: 2px;
}

.msg-pop-other {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-win-footer {
    padding: 10px 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
}

.chat-win-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 0.85rem;
}

.emoji-drawer {
    position: absolute;
    bottom: 70px;
    left: 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    display: none;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    z-index: 200;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.emoji-item {
    cursor: pointer;
    font-size: 1.2rem;
    text-align: center;
    padding: 5px;
}

.sem-alocacao-tag {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Modais de Sistema (Grupo, Membros, etc) */
.modal-chat-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-chat-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid #e2e8f0;
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}