/**
 * Messages & Comments
 * Ticket/message chat bubbles, message actions, file links, send controls,
 * ticket state labels, service state labels, and comment items.
 */

.message {
    position: relative;
}

.message .message-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    gap: 4px;
}

.message p.date {
    margin-bottom: 0;
}

.message:hover .message-actions {
    display: flex;
}

.message-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    width: auto;
}

.message-actions button:hover {
    color: #fff;
}

.message .content a {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.message.outbound a {
    color: white;
}

.message .content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message .file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85em;
    text-decoration: none;
    width: fit-content;
}

.message .file-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.edited-label {
    font-style: italic;
    opacity: 0.7;
    font-size: 0.85em;
}

.message {
    background: var(--pico-background-color);
    padding: var(--pico-spacing);
    border-radius: var(--pico-border-radius);
    margin-bottom: var(--pico-spacing);
    max-width: 95%;
}

.message.outbound {
    width: 100%;
    margin-left: auto;
    background: var(--pico-primary);
    color: white;
}

.message p {
    color: inherit;
}

.messages_scroll_container {
    overflow-y: scroll;
    max-height: 500px;
    display: flex;
    flex-direction: column-reverse;
}

button#send_message_button {
    margin: 0;
    max-width: 50px;
}

input#send_message {
    width: 100%;
    max-width: unset;
}

span.in-progress {
    background: #db854d;
    padding: 2px 7px;
    border-radius: 5px;
    color: white;
    margin-right: 3px;
}

span.open {
    background: #ce2525;
    padding: 2px 7px;
    border-radius: 5px;
    color: white;
    margin-right: 3px;
}

span.closed {
    background: var(--pico-background-success);
    padding: 2px 7px;
    border-radius: 5px;
    color: white;
    margin-right: 3px;
}

span.service_state_1 {
    background: #405d72;
    padding: 2px 7px;
    border-radius: 5px;
    color: white;
    margin-right: 3px;
}

span.service_state_0 {
    background: #758694;
    padding: 2px 7px;
    border-radius: 5px;
    color: white;
    margin-right: 3px;
}

.comment-item {
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 20px;
    border-bottom-left-radius: 0;
    max-width: 95%;
    margin-bottom: 1rem;
    position: relative;
}

.comment-item:after {
    background: #f5f5f5;
    width: 30px;
    height: 20px;
    position: absolute;
    left: -8px;
    bottom: -20px;
    z-index: 4;
    content: "";
    clip-path: polygon(28% 0, 0% 100%, 100% 0);
}

.comment-item.active-user {
    margin-left: auto;
    background-color: #eaf5ff;
    color: var(--pico-primary);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 0;
}

.comment-item.active-user:after {
    background-color: #eaf5ff;
    left: unset;
    right: -10px;
    rotate: 70deg;
}

.comment-item .comment-author {
    font-weight: bold;
    font-size: var(--hb-font-size-sm);
    margin-bottom: 12px;
}

.comment-item .comment-author button {
    padding: 2px 6px;
    margin-left: 4px;
}

.comment-item .comment-author button i {
    font-size: var(--hb-font-size-sm);
}

.comment-item .comment-data .fa-lock {
    color: var(--pico-primary);
    font-size: var(--hb-font-size-xs);
    position: relative;
    top: -1px;
}

.comment-footer {
    font-size: var(--hb-font-size-xs);
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: end;
}
