/* private-chat.css - Facebook-style chat popups for RPG */

.private-chat-popup {
    position: fixed;
    bottom: 0;
    right: 320px; /* cascade popups leftward, adjust in JS */
    width: 320px;
    max-height: 420px;
    background: linear-gradient(180deg, #1a1a2e 96%, #23233a 100%);
    border: 1.5px solid #ff00ff77;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 0 20px #ff00ff33;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.3s;
}
.private-chat-popup .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #2d0036 70%, #ff00ff33 100%);
    padding: 10px 14px;
    color: #fff;
    font-size: 1.05em;
    font-weight: 600;
    cursor: move;
    border-bottom: 1px solid #ff00ff33;
}
.private-chat-popup .chat-header .chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid #ff00ff;
}
.private-chat-popup .chat-header .chat-close {
    background: none;
    border: none;
    color: #ff80ff;
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.2s;
}
.private-chat-popup .chat-header .chat-close:hover {
    color: #fff;
}
.private-chat-popup .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.private-chat-popup .chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 2px;
    width: 100%;
}
.private-chat-popup .message-sent {
    justify-content: flex-end;
}
.private-chat-popup .message-sent .bubble {
    background: #00ff8899;
    color: #222;
    text-align: right;
    margin-left: 40px;
    margin-right: 0;
    align-self: flex-end;
}
.private-chat-popup .message-received {
    justify-content: flex-start;
}
.private-chat-popup .message-received .bubble {
    background: #ff00ff33;
    color: #fff;
    text-align: left;
    margin-right: 40px;
    margin-left: 0;
    align-self: flex-start;
}
.private-chat-popup .chat-message .bubble {
    max-width: 68%;
    padding: 8px 13px;
    border-radius: 16px;
    box-shadow: 0 0 6px #ff00ff22;
    word-break: break-word;
}
.private-chat-popup .chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #23233a;
    border-top: 1px solid #ff00ff22;
}
.private-chat-popup .chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: #19192e;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1em;
    margin-right: 8px;
}
.private-chat-popup .chat-send-btn {
    background: linear-gradient(135deg, #ff1493, #8a2be2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 0 7px #ff00ff44;
    transition: background 0.2s;
}
.private-chat-popup .chat-send-btn:hover {
    background: linear-gradient(135deg, #8a2be2, #ff1493);
}

.emoji-toggle-btn{
    padding: 0px;
}

.friend-item {
    position: relative;
}
.chat-btn {
    position: relative;
}
.chat-btn .unread-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 13px;
    height: 13px;
    background: #ff2d55;
    border-radius: 50%;
    border: 2px solid #23233a;
    z-index: 2;
    box-shadow: 0 0 4px #ff2d55cc;
    display: none;
}
.chat-btn.has-unread .unread-dot {
    display: block;
}

@media (max-width: 700px) {
    .private-chat-popup {
        width: 98vw;
        right: 1vw;
        left: 1vw;
        min-width: 0;
        max-width: 100vw;
    }
}
