/* chat.css */

.container {
    padding: 1rem;
    height: calc(100vh - 250px);
}

.chat-card {
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(13, 13, 13, 0.7);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.chat-messages::-webkit-scrollbar-thumb { background: var(--primary-accent); border-radius: 4px; }

.message-item {
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);

    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
}

.message-item.own-message {


    background: rgba(255, 255, 255, 0.05);
    align-self: flex-end;
    max-width: 80%;
}

.message-item.other-message {
    align-self: flex-start;
    max-width: 80%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #aaa;
}

.message-username {
    font-weight: bold;
    color: var(--text-light);
}

.own-message .message-username {
    color: var(--primary-accent);
}

.message-content {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.4;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.msg-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-family);
    transition: color 0.2s;
    text-decoration: underline;
}

.msg-btn:hover { color: var(--primary-accent); }
.msg-btn.delete-btn:hover { color: #ff5555; }

.chat-form {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.chat-form input {
    margin-bottom: 0;
    flex-grow: 1;
}

.chat-send-btn {
    margin-top: 0;
    width: auto;
    padding: 12px 24px;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.cancel-btn {
    border-color: #ff5555;
    color: #ff5555;
    box-shadow: 4px 4px 0px #ff5555;
}
.cancel-btn:hover { box-shadow: 2px 2px 0px #ff5555; background: rgba(255, 85, 85, 0.1); }
.cancel-btn:active { box-shadow: 0px 0px 0px #ff5555; }

.loading-text {
    text-align: center;
    color: var(--primary-accent);
    padding: 1rem;
}