/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-RunningSessions {
  display: flex;
  flex-direction: column;
  min-width: var(--jp-sidebar-min-width);
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

.jp-RunningSessions > .jp-SidePanel-toolbar::part(positioning-region) {
  justify-content: flex-end;
}

.jp-RunningSessions-section {
  min-height: 50px;
  overflow: auto;
}

.jp-RunningSessions-sectionContainer {
  margin: 0;
  padding: 0;
}

.jp-RunningSessions-sectionList {
  display: block;
  margin: 0;
  padding: 0;
  list-style-type: none;
  padding-left: 14px;
}

.jp-RunningSessions-viewButton[aria-pressed='true'] {
  box-shadow: none;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view .jp-RunningSessions-sectionList {
  padding-left: 0;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view .jp-mod-running-leaf {
  margin-left: 0;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view
  .jp-RunningSessions-item.jp-mod-kernelspec::part(positioning-region),
.jp-mod-running-list-view
  .jp-RunningSessions-item.jp-mod-kernel::part(positioning-region) {
  display: none;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view
  .jp-RunningSessions-item.jp-mod-kernel-widget::part(content-region) {
  margin-inline-start: -2.6em;
}

.jp-RunningSessions-item.jp-mod-kernelspec,
.jp-RunningSessions-item.jp-mod-kernel {
  user-select: none;
}

.jp-RunningSessions-item-label-kernel-id {
  color: var(--jp-ui-font-color3);
}

.jp-RunningSessions-collapseButton[aria-pressed='true'] {
  box-shadow: none;
}

.jp-RunningSessions-toolbar {
  min-width: max-content;
}

img.jp-RunningSessions-icon,
span.jp-RunningSessions-icon > svg {
  width: 16px;
  height: 16px;
}

img.jp-RunningSessions-icon {
  margin-top: 4px;
  object-fit: contain;
}

span.jp-RunningSessions-icon {
  align-items: center;
  display: flex;
}

span.jp-RunningSessions-icon > svg {
  display: block;
  margin: 0 auto;
}

.jp-RunningSessions-itemLabel {
  font-size: var(--jp-ui-font-size1);
  flex: 1 1 55%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.jp-RunningSessions-itemDetail {
  font-size: var(--jp-ui-font-size1);
  flex: 1 1 45%;
  padding: 0 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.jp-RunningSessions-itemShutdown {
  visibility: hidden;
}

.jp-RunningSessions-item:focus-visible > .jp-RunningSessions-itemShutdown,
.jp-RunningSessions-item:hover > .jp-RunningSessions-itemShutdown {
  visibility: visible;
}

.jp-RunningSessions-shutdownAll.jp-ToolbarButtonComponent {
  color: var(--jp-warn-color1);
}

.jp-RunningSessions-shutdownAll.jp-ToolbarButtonComponent[disabled] {
  color: var(--jp-ui-font-color2);
}

/*-----------------------------------------------------------------------------
| SearchableSessions
|----------------------------------------------------------------------------*/

.jp-RunningSessions-item.jp-mod-active {
  background-color: var(--jp-layout-color2);
  outline: 1px solid var(--jp-brand-color1);
  outline-offset: -2px;
}

.jp-RunningSessions-item.jp-mod-active.jp-TreeItem::part(positioning-region) {
  background-color: transparent;
}

.jp-SearchableSessions-list > .jp-RunningSessions-section {
  min-height: auto;
}

.jp-SearchableSessions-title {
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size0);
  margin: 0;
  padding: 4px 0;
}

.jp-SearchableSessions-titleLabel {
  text-transform: uppercase;
}

.jp-SearchableSessions-acceptButton {
  display: none;
}

.jp-SearchableSessions-list > .jp-RunningSessions-section.jp-mod-empty {
  display: none;
}

.jp-SearchableSessions-filter {
  overflow: visible;

  /* Required to display correctly the filter box and its focus highlight */
  padding: 0 2px;
}

.jp-SearchableSessions-filter > .jp-FilterBox {
  width: 100%;
}

.jp-SearchableSessions-list {
  overflow: auto;
}

.jp-SearchableSessions.jp-Dialog-body {
  display: flex;
}

.jp-SearchableSessions-modal .jp-Dialog-content {
  padding: 16px;
  box-shadow: var(--jp-elevation-z4);
  border-radius: 4px;
  min-height: 100px;
  max-height: 95%;
}

.jp-SearchableSessions-modal .jp-Dialog-footer {
  display: none;
}

.jp-SearchableSessions-modal .jp-Dialog-header {
  font-size: var(--jp-ui-font-size2);
}

.jp-SearchableSessions-modal.jp-Dialog {
  background: transparent;
  justify-content: start;
  padding-top: 38px;
  border: 0;
}

.jp-SearchableSessions-emptyIndicator {
  color: var(--jp-ui-font-color2);
  padding: 16px;
  text-align: center;
  padding-bottom: 8px;
}

.jp-RunningSessions-section:not(.jp-mod-empty)
  ~ .jp-SearchableSessions-emptyIndicator {
  display: none;
}
