/* Estilos gerais */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Estilos para o navbar */
.navbar-brand {
    font-weight: bold;
}

/* Estilos para cards */
.card {
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Estilos para a lista de agentes */
.agent-card {
    transition: transform 0.2s;
    cursor: pointer;
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.agent-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

/* Estilos para a interface de chat */
.chat-container {
    height: 70vh;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.message {
    margin-bottom: 1rem;
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
}

.message-user {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.message-agent {
    background-color: #e9ecef;
    color: #212529;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 0.25rem;
}

/* Melhorar legibilidade: justificar texto das respostas do agente */
.message-agent .message-content {
    text-align: justify;
    text-justify: inter-word;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.message-attachment {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
}

.message-attachment a {
    color: inherit;
    text-decoration: none;
}

.message-attachment a:hover {
    text-decoration: underline;
}

/* Estilos para preview de imagens inline */
.message-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.image-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.image-thumbnail:hover {
    border-color: #007bff;
}

/* Modal para visualização de imagens */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.image-modal img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.image-modal-close:hover {
    opacity: 0.7;
}



.chat-input {
    display: flex;
    gap: 0.5rem;
}

.chat-input textarea {
    resize: none;
    height: 60px;
}

/* Estilos para tabelas */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Estilos para formulários */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: .65;
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Estilos para paginação */
.pagination {
    justify-content: center;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .message {
        max-width: 90%;
    }
}