/* Adicione isso ao arena.css ou arena_cards.css */

/* --- Chat System --- */
.arena-chat-container {
    background: rgba(15, 15, 18, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-top: 2rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.chat-header {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.chat-msg.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.msg-bubble {
    background: rgba(255,255,255,0.05);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border-top-left-radius: 0;
    position: relative;
    group: hover;
}

.btn-report-msg {
    position: absolute;
    top: 5px;
    right: -30px;
    background: transparent;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: 0.2s;
    padding: 5px;
}

.chat-msg:hover .btn-report-msg {
    opacity: 1;
}

.btn-report-msg:hover {
    color: var(--arena-danger);
}

.chat-msg.mine .btn-report-msg {
    right: auto;
    left: -30px;
}

.chat-msg.mine .msg-bubble {
    background: var(--arena-primary);
    color: #fff;
    border-radius: 12px;
    border-top-right-radius: 0;
}

.msg-author {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--cor-texto-secundario);
    display: block;
}

.chat-msg.mine .msg-author { display: none; } /* Oculta nome para o próprio user */

.msg-text { font-size: 0.9rem; line-height: 1.4; word-break: break-word; }

/* Imagens Renderizadas no Chat */
.chat-img-container {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
}

.chat-rendered-img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.chat-rendered-img:hover {
    transform: scale(1.02);
}

.chat-text-link {
    color: var(--arena-primary);
    text-decoration: underline;
}

.chat-msg.mine .chat-text-link {
    color: #fff;
    text-decoration: underline;
}

.chat-input-area {
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.8rem 1.2rem;
    color: #fff;
    outline: none;
    font-family: inherit;
}

.chat-input:focus { border-color: var(--arena-primary); }

.btn-send {
    background: var(--arena-primary);
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.btn-send:hover { transform: scale(1.1); }

/* Scrollbar fina para o chat */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
