/* ============================================================
   FLOW MESSAGES — Layout compacto do chat
   Objetivo: ampliar área útil da conversa e reduzir cabeçalho/FilePond
   ============================================================ */

#flow-messages-chat {
    min-width: 0;
}

#chat-area {
    padding: 10px 12px 8px;
    overflow: hidden;
}

#chat-area .chat-header-bar.chat-header-bar-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 9px 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#chat-area .chat-header-main {
    flex: 1;
    min-width: 0;
}

#chat-area .chat-header-title {
    color: #1f2d3d;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chat-area .chat-header-subtitle {
    margin-top: 3px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chat-area .flow-whatsapp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 210px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    vertical-align: middle;
    cursor: help;
}

#chat-area .flow-whatsapp-status-badge i {
    font-size: 10px;
}

#chat-area .chat-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#chat-area .chat-detail-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 13px;
    background: #fff;
}

#whatsapp-communication.chat-main-area {
    min-height: 0;
    overflow: hidden;
}

#chat-area #message-history.message-history {
    min-height: 0;
    padding: 12px 16px;
    border-radius: 8px;
    scrollbar-width: thin;
}

#flow-messages-chat .chat-message-composer.message-input {
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(248, 249, 250, 0.98);
}

#flow-messages-chat .chat-footer-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#flow-messages-chat .chat-attachment-strip {
    width: 100%;
}

#flow-messages-chat .chat-attachment-strip .filepond--root {
    margin-bottom: 0;
    font-size: 13px;
}

#flow-messages-chat .chat-attachment-strip .filepond--panel-root {
    border: 1px dashed #cfd8e3;
    border-radius: 10px;
    background: #ffffff;
}

#flow-messages-chat .chat-attachment-strip .filepond--drop-label {
    min-height: 46px;
    color: #495057;
}

#flow-messages-chat .chat-attachment-strip .filepond--drop-label label {
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
}

#flow-messages-chat .chat-attachment-strip .filepond--drop-label label::before {
    content: "\f0c6";
    display: inline-block;
    margin-right: 9px;
    color: #495057;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

#flow-messages-chat .chat-attachment-strip .filepond--list-scroller {
    margin-top: 4px;
}

#flow-messages-chat .chat-attachment-strip .filepond--item {
    margin-top: 4px;
}

#flow-messages-chat .chat-attachment-strip .filepond--credits {
    display: none;
}

#flow-messages-chat .chat-input-row.chat-input-row-compact {
    align-items: stretch;
    gap: 8px;
    margin-top: 0;
}

#flow-messages-chat .chat-recipient-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

#flow-messages-chat .chat-recipient-add-button {
    width: 42px;
    min-width: 42px;
    flex: 0 0 42px;
}

#flow-messages-chat .chat-recipient-select {
    width: 260px;
    max-width: 260px;
    height: 40px;
    flex: 0 0 260px;
    font-size: 13px;
}

#flow-messages-chat .chat-input-row textarea {
    min-height: 40px;
    max-height: 86px;
    height: 40px;
    padding: 9px 10px;
    line-height: 1.35;
    resize: vertical;
}

#flow-messages-chat .chat-footer-action-button,
#flow-messages-chat .chat-send-button {
    height: 40px;
    border-radius: 7px;
}

#flow-messages-chat .chat-message-audio-dictation-button {
    width: 42px;
    min-width: 42px;
    color: #2563eb !important;
}

#flow-messages-chat .chat-message-audio-dictation-button i,
#flow-messages-chat .chat-message-audio-dictation-button .fas,
#flow-messages-chat .chat-message-audio-dictation-button .fa {
    color: #2563eb !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#flow-messages-chat .chat-message-audio-dictation-button:hover,
#flow-messages-chat .chat-message-audio-dictation-button:focus {
    color: #1d4ed8 !important;
}

#flow-messages-chat .chat-message-audio-dictation-button:hover i,
#flow-messages-chat .chat-message-audio-dictation-button:focus i,
#flow-messages-chat .chat-message-audio-dictation-button:hover .fas,
#flow-messages-chat .chat-message-audio-dictation-button:focus .fas,
#flow-messages-chat .chat-message-audio-dictation-button:hover .fa,
#flow-messages-chat .chat-message-audio-dictation-button:focus .fa {
    color: #1d4ed8 !important;
}

#flow-messages-chat .chat-message-audio-dictation-button.is-recording {
    width: auto;
    min-width: 82px;
    color: #ffffff !important;
    border-color: #dc3545;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

#flow-messages-chat .chat-message-audio-dictation-button.is-recording i,
#flow-messages-chat .chat-message-audio-dictation-button.is-recording .fas,
#flow-messages-chat .chat-message-audio-dictation-button.is-recording .fa {
    color: #ffffff !important;
}

#flow-messages-chat .chat-message-audio-status {
    min-height: 16px;
    padding-left: 2px;
    font-size: 11px;
    line-height: 1.25;
}

#flow-messages-chat .chat-send-button {
    min-width: 82px;
    padding-left: 16px;
    padding-right: 16px;
    font-weight: 500;
}

#flow-messages-chat .new-messages-badge {
    bottom: 132px;
}

@media (min-width: 768px) {
    #flow-messages-wrapper {
        height: calc(100vh - 104px);
    }
}

@media (max-width: 991.98px) {
    #flow-messages-chat .chat-recipient-select {
        width: 210px;
        max-width: 210px;
        flex-basis: 210px;
    }
}

@media (max-width: 767.98px) {
    #chat-area {
        padding: 8px;
    }

    #chat-area .chat-header-bar.chat-header-bar-compact {
        min-height: 52px;
        padding: 8px 10px;
        gap: 8px;
    }

    #chat-area .chat-header-title {
        font-size: 14px;
    }

    #chat-area .chat-header-subtitle {
        font-size: 11px;
    }

    #chat-area .flow-whatsapp-status-badge {
        max-width: 150px;
        font-size: 10px;
    }

    #chat-area .chat-detail-button span {
        display: none;
    }

    #flow-messages-chat .chat-input-row.chat-input-row-compact {
        flex-wrap: wrap;
    }

    #flow-messages-chat .chat-recipient-select {
        width: auto;
        max-width: none;
        flex: 1 1 calc(100% - 50px);
    }

    #flow-messages-chat .message-textarea-wrapper {
        flex: 1 1 100%;
    }

    #flow-messages-chat .chat-send-button {
        flex: 1 1 auto;
    }
}