/* ======== RESET ======== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* font-family: "Inter", sans-serif; */
}

body {
    background: #f4f6fa;
    color: #333;
}

/* ======== CABEÇALHO ======== */
.cabecalho {
    background: #ffffffff;
    padding: 0px 0;
    margin-bottom: 25px;
}

/* ======== LAYOUT PRINCIPAL ======== */
.pagina {
    width: 92%;
    max-width: 1200px;
    margin: auto;
    padding-bottom: 50px;
}

/* ======== BLOCO DO CHAMADO ======== */
.chamado-detalhes {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    margin-bottom: 40px;
}

/* --- CONTAINER PRINCIPAL DO CHAT --- */
.historico-chat {
    width: 100%;
    max-width: none;
    margin: 40px auto 0;
    /* afasta do formulário acima */
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- CABEÇALHO --- */
.historico-chat h3 {
    background: #141529;
    color: #fff;
    margin: 0;
    padding: 12px;
    text-align: center;
    font-size: 1rem;
    border-radius: 15px 15px 0 0;
}

/* --- LISTA DE MENSAGENS --- */
.historico-lista {
    flex: 1;
    min-height: 250px;
    max-height: 350px;
    overflow-y: auto;
    padding: 15px;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- EXEMPLO DE ESTILO PARA MENSAGENS --- */
.historico-lista .msg {
    background: #e5e5e5;
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 70%;
    word-wrap: break-word;
}

.historico-lista .msg.enviada {
    background: #d1ffd1;
    align-self: flex-end;
}

.historico-lista .msg.recebida {
    background: #e9e9e9;
    align-self: flex-start;
}

/* --- ÁREA DE DIGITAÇÃO --- */
/* --- ÁREA DE DIGITAÇÃO --- */
.comentario-area {
    display: flex;
    align-items: center;
    /* alinha tudo no eixo vertical */
    justify-content: space-between;
    /* distribui elementos nas extremidades */
    width: 100%;
    padding: 10px 15px;
    gap: 10px;
}

/* O input fica centralizado e ocupa todo o espaço */
.comentario-area input[type="text"],
.comentario-area textarea {
    flex: 1;
    /* ocupa o espaço entre os botões */
    height: 45px;
    border-radius: 10px;
    padding: 0 15px;
    padding: 2rem;
    border: 1px solid #ccc;
    outline: none;
}

/* Botões */
.comentario-area button {
    height: 45px;
    /* mesma altura do input */
    padding: 0 20px;
    border-radius: 10px;
    cursor: pointer;
}

/* Ícone de anexo igual ao seu */
.btn-anexo {
    background: #f5f5f5;
    color: #333;
    padding: 0 15px;
}


/* --- UPLOAD ESTILIZADO COMO BOTÃO REDONDINHO --- */
.comentario-area input[type="file"] {
    display: none;
    /* esconde o padrão feio */
}

.label-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
    color: #333;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ccc;
    transition: background-color 0.3s ease;
}

.label-upload:hover {
    background-color: #e4e4e4;
}

.label-upload i {
    margin-right: 6px;
    font-size: 16px;
}


.comentario-area input[type="file"] {
    flex-shrink: 0;
    border: none;
    background: none;
    font-size: 14px;
}

.comentario-area button {
    border: none;
    background: #007bff;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.comentario-area button:hover {
    background: #0056b3;
}

/* --- INPUT DE TEXTO --- */
.comentario-area input[type="text"] {
    flex: 1;
    height: 45px;
    /* mesma altura dos botões */
    padding: 2rem;
    /* alinha o texto verticalmente */
    border: 1px solid #ccc;
    border-radius: 10px;
    outline: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    /* garante o alinhamento interno */
}


/* --- INPUT DE IMAGEM --- */
.comentario-area input {
    width: 32px;
    height: 32px;
    cursor: pointer;
}



#btnCancelar {
    background: #ccc;
    color: #000;
}

#btnSalvar {
    background: #222;
    color: #fff;
}

.comentario-area button:hover {
    opacity: 0.85;
}


/* --- BOTÃO FINALIZAR CHAMADO --- */
.btn-finalizar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* espaçamento entre o texto e o ícone */
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-finalizar:hover {
    background-color: #218838;
    transform: scale(1.02);
}

.btn-finalizar i {
    font-size: 16px;
}



/* ======== INFORMAÇÕES ======== */
.chamado-info {
    flex: 1;
    min-width: 300px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.chamado-info__titulo {
    font-size: 26px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 10px;
}

.chamado-info__linha {
    margin: 6px 0;
    font-size: 16px;
    font-weight: 500;
}

.chamado-info__descricao {
    margin: 15px 0;
    color: #444;
    line-height: 1.5;
}

/* ======== HISTÓRICO ======== */
.historico {
    margin-top: 10px;
}

/* container */
.historico-lista {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 14px;
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

/* cada mensagem vira uma bolha */
.historico-item {
    padding: 10px 14px;
    background: #f6f7fa;
    border-radius: 8px;
    font-size: 14px;
    max-width: 75%;
    line-height: 1.3;
    border: 1px solid #e6e6e6;
    animation: fadein .18s ease;
}

/* alternância automática (pares → direita) */
.historico-item:nth-child(odd) {
    align-self: flex-start;
    background: #f6f7fa;
}

.historico-item:nth-child(even) {
    align-self: flex-end;
    background: #e8f1ff;
    border-color: #c7dbff;
}

/* remover linha divisória antiga */
.historico-item:last-child,
.historico-item {
    border-bottom: none !important;
}

.chat-form {
    margin-top: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px 10px;
}

.chat-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-inputs input[type="text"] {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
}

.chat-inputs button {
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
}

.btn-cancelar {
    background: #f0f0f0;
}

.btn-enviar {
    background: #007bff;
    color: white;
}

.icone-upload {
    font-size: 18px;
    cursor: pointer;
    user-select: none;
}

.imagem-comentario {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 5px;
    display: block;
    border: 1px solid #ddd;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* animação */
@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* scroll suave */
.historico-lista::-webkit-scrollbar {
    width: 6px;
}

.historico-lista::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 20px;
}

.historico-lista::-webkit-scrollbar-thumb:hover {
    background: #9a9a9a;
}

/* ======== ÁREA DE COMENTÁRIO ======== */
.comentario-area {
    margin-top: 25px;
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    border: 1px solid #d2d6dd;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

/* ======== MOBILE ======== */
@media (max-width: 700px) {
    .chamado-imagem {
        width: 100%;
    }
}

/* --- RESPONSIVO --- */
@media (max-width: 600px) {
    .historico-chat {
        width: 100%;
    }

    .comentario-area,
    .comentario-area input {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .comentario-area button,
    .comentario-area input {
        width: 100%;
    }
}