/* ======= UserListDrawer — Hoàn toàn không phụ thuộc MudBlazor ======= */

.user-list-drawer {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-size: 14px;
    color: #333;
    background: #fff;
}

/* ===== Header ===== */
.uld-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 4px;
}

.uld-header-icon {
    width: 22px;
    height: 22px;
    color: #1976d2;
    flex-shrink: 0;
}

.uld-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #1976d2;
}

/* ===== Search ===== */
.uld-search {
    position: relative;
    padding: 8px 12px;
}

.uld-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    color: #888;
}

.uld-search-input {
    width: 100%;
    padding: 7px 8px 7px 32px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
    background: #f5f5f5;
}

.uld-search-input:focus {
    border-color: #1976d2;
    background: #fff;
}

/* ===== Group Labels ===== */
.uld-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.uld-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.uld-group-count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: #aaa;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 8px;
}

/* ===== User List ===== */
.uld-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.uld-empty {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* ===== User Item ===== */
.uld-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s;
}

.uld-user-item:hover {
    background: #f0f4ff;
}

.uld-user-item:active {
    background: #e3edff;
}

/* ===== Avatar ===== */
.uld-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.uld-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    user-select: none;
}

.avatar-online {
    background: #1976d2;
}

.avatar-offline {
    background: #9e9e9e;
}

.uld-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.dot-online {
    background: #4caf50;
}

.dot-offline {
    background: #bdbdbd;
}

/* ===== User Info ===== */
.uld-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.uld-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uld-user-status {
    font-size: 11px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-online {
    color: #2e7d32;
}

.status-offline {
    color: #888;
}

/* ===== Unread Badge ===== */
.uld-unread-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #d32f2f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Scrollbar ===== */
.uld-list::-webkit-scrollbar {
    width: 5px;
}

.uld-list::-webkit-scrollbar-track {
    background: transparent;
}

.uld-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.uld-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ===== Dark mode support ===== */
@media (prefers-color-scheme: dark) {
    .user-list-drawer {
        background: #1e1e1e;
        color: #ddd;
    }

    .uld-search-input {
        background: #2d2d2d;
        border-color: #444;
        color: #ddd;
    }

    .uld-search-input:focus {
        border-color: #5b9cf5;
        background: #333;
    }

    .uld-group-label {
        color: #999;
    }

    .uld-group-count {
        color: #888;
        background: #333;
    }

    .uld-user-item:hover {
        background: #2a2a2a;
    }

    .uld-user-item:active {
        background: #333;
    }

    .uld-user-name {
        color: #ddd;
    }

    .uld-status-dot {
        border-color: #1e1e1e;
    }
}
