/* ===============================
   MESSAGE PAGE LEFTOVERS
=============================== */
.inbox-main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.message-item {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 8px;
}

.bot-message {
    background-color: #e1f0ff;
    text-align: left;
}

.user-message {
    background-color: #d1ffd6;
    text-align: right;
}

.message-header {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
}

/* ===============================
   BOTTOM CHAT BAR
=============================== */
#chat-bubble-bar {
    position: fixed;
    right: 20px;
    bottom: 0;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 10px;
    z-index: 20000;
}

/* ===============================
   MESSAGES LAUNCHER TAB
=============================== */
.system-tab {
    width: 260px;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    background: #2b2b2f;
    border: 1px solid #3a3a3f;
    border-bottom: none;
}

.system-tab .chat-tab-header {
     display: flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 10px 14px;
    background: #2b2b2f;
    color: #c3a0fd;
    font-weight: 700;
    font-size: 15px;
}

/* ===============================
   INBOX WINDOW
=============================== */
#chat-window {
   position: fixed;
    right: 20px;
    bottom: 52px;
    width: 260px;
    height: 340px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #1b1b24;
    border: 1px solid rgba(195, 160, 253, 0.18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
    z-index: 20001;
}

.chat-bubble-tab,
.system-tab {
    flex: 0 0 260px;
}

#chat-window.open {
    display: flex;
}

#chat-inbox-list {
    flex: 1;
    overflow-y: auto;
    background: #26262b;
}

.inbox-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.15s ease;
}

.inbox-user:hover {
    background: rgba(195, 160, 253, 0.08);
}

.inbox-user img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.inbox-user span {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.inbox-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.inbox-username {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
}

.inbox-user .unread {
    min-width: 18px;
    height: 18px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #c3a0fd;
    color: #1b1b24;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

#chat-bubble-text {
    margin-left: 6px;
    color: #ffcc00;
    font-weight: 700;
}

.inbox-preview {
    font-size: 12px;
    color: #aaa;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===============================
   OPEN CHAT BOX
=============================== */
.chat-bubble-tab {
    width: 260px;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    background: #1f1f24;
    border: 1px solid #3a3a3f;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.chat-bubble-tab .chat-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    background: #2b2b2f;
    color: #c3a0fd;
    font-weight: 700;
    font-size: 14px;
}

.chat-bubble-tab .chat-tab-header span:last-child {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.chat-tab-body {
    display: flex;
    flex-direction: column;
    height: 300px;
    background: #141420;
}

/* ===============================
   CHAT MESSAGES
=============================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #141420;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: 78%;
    padding: 9px 11px;
    border-radius: 12px;
    line-height: 1.35;
    font-size: 13px;
    word-break: break-word;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: #2b2b3d;
    color: #fff;
    border-bottom-left-radius: 4px;
}

/* ===============================
   CHAT INPUT
=============================== */
.chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #181826;
}

.chat-input input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: none;
    outline: none;
    border-radius: 999px;
    background: #26263a;
    color: #fff;
    font-size: 13px;
}

.chat-input input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.chat-input button {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===============================
   SCROLLBARS
=============================== */
#chat-inbox-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-inbox-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-inbox-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(195, 160, 253, 0.45);
    border-radius: 999px;
}

#chat-inbox-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(195, 160, 253, 0.7);
}