﻿/* File Location: /public/css/dm.css */

/* ── DM Call Banner ──────────────────────────────────────────────────────── */
.dm-call-banner {
    background: #2d7d32;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 0 0 6px 6px;
}
.dm-call-banner button {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.dm-call-banner button:hover {
    background: rgba(255,255,255,0.35);
}

/* ── DM Sidebar ─────────────────────────────────────────────────────────── */
.dm-panel {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
}

.dm-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #3a3a3a;
    flex-shrink: 0;
}

.dm-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dm-new-btn {
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

    .dm-new-btn:hover {
        color: #fff;
    }

/* ── Search ──────────────────────────────────────────────────────────────── */
.dm-search-wrapper {
    padding: 8px 10px;
    border-bottom: 1px solid #3a3a3a;
    flex-shrink: 0;
}

.dm-search-input {
    width: 100%;
    padding: 7px 10px;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}

    .dm-search-input:focus {
        border-color: #5865f2;
    }

.dm-search-results {
    margin-top: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.dm-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #dcddde;
    transition: background 0.1s;
}

    .dm-search-result:hover {
        background: #3a3a3a;
    }

.dm-search-avatar {
    width: 28px;
    height: 28px;
    background: #5865f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.dm-search-empty {
    font-size: 13px;
    color: #888;
    padding: 6px 8px;
}

/* ── Conversation List ───────────────────────────────────────────────────── */
.dm-conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 6px;
}

.dm-conversation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    margin-bottom: 2px;
}

    .dm-conversation-item:hover {
        background: #3a3a3a;
    }

    .dm-conversation-item.active {
        background: #404249;
    }

.dm-conv-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.dm-conv-avatar {
    width: 32px;
    height: 32px;
    background: #5865f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.dm-conv-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: -1px;
    right: -1px;
    border: 2px solid #2b2b2b;
}

    .dm-conv-status.online {
        background: #43b581;
    }

    .dm-conv-status.idle {
        background: #faa61a;
    }

    .dm-conv-status.dnd {
        background: #f04747;
    }

    .dm-conv-status.offline {
        background: #747f8d;
    }

.dm-conv-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.dm-conv-name {
    font-size: 14px;
    font-weight: 600;
    color: #dcddde;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-conv-preview {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-loading,
.dm-empty {
    font-size: 13px;
    color: #888;
    padding: 12px 8px;
    text-align: center;
    line-height: 1.6;
}

/* ── Welcome / Home screen ───────────────────────────────────────────────── */
.dm-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
    gap: 12px;
}

.dm-welcome-icon {
    font-size: 64px;
    line-height: 1;
}

.dm-welcome h2 {
    font-size: 22px;
    color: #fff;
    margin: 0;
}

.dm-welcome p {
    font-size: 15px;
    color: #aaa;
    max-width: 340px;
    margin: 0;
    line-height: 1.5;
}

/* ── DM unread badges ────────────────────────────────────────────────────── */
.dm-unread-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ed4245;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
}

/* Badge on the logo/DM-home button in the top-nav */
.dm-home-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: #ed4245;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1e1e1e;
    pointer-events: none;
    box-sizing: border-box;
}

/* ── Load more spinner ───────────────────────────────────────────────────── */
.load-more-spinner {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 10px;
}

/* ── New conversation modal pills & results ──────────────────────────────── */
.conv-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}

.conv-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #5865f2;
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
}

.conv-pill-remove {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

.conv-user-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 4px;
}

.conv-user-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #dcddde;
    font-size: 14px;
}

    .conv-user-result:hover {
        background: rgba(255,255,255,0.07);
    }

/* ── Group DM sidebar styles ─────────────────────────────────────────────── */
.gdm-member-count {
    font-size: 11px;
    color: #96989d;
    margin-left: 4px;
}

.gdm-avatar {
    font-size: 16px;
    line-height: 32px;
    text-align: center;
}