/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.grid-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 38px;
  min-height: 38px;
  padding: 0 4px;
  user-select: none;
  position: relative;
  z-index: 110;
}

.grid-content {
  flex: 1;
  overflow: auto;
  padding: 0 24px 12px;
}

.grid-loading {
  color: var(--color-fg-subtle);
  font-size: 14px;
}

.grid-empty {
  color: var(--color-fg-subtle);
  font-size: 14px;
}

.grid-error {
  color: var(--color-danger-fg);
  font-size: 14px;
}

.workspace-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workspace-header {
  font-size: 13px;
  color: var(--color-fg-muted);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.workspace-header.collapsible {
  cursor: pointer;
  user-select: none;
}

.workspace-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-right: 4px;
  transition: transform 0.15s ease;
}

.workspace-chevron.expanded {
  transform: rotate(90deg);
}

.workspace-name {
  font-weight: 600;
}

.workspace-path {
  margin-left: 6px;
  color: var(--color-fg-subtle);
  font-weight: 400;
}

.session-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-chip {
  display: flex;
  flex-direction: column;
  background: var(--color-canvas-subtle);
  border-radius: 8px;
  border: 1px solid var(--color-border-default);
  box-shadow: var(--color-shadow-small);
  min-width: 200px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.session-chip:hover {
  border-color: var(--color-fg-subtle);
}

.session-chip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  max-width: 533px;
}

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

.session-status-dot.open {
  background: var(--color-success-fg);
}

.session-status-dot.closed {
  background: var(--color-fg-subtle);
}

.session-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-fg-default);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.session-chip-title {
  color: var(--color-fg-muted);
  font-weight: 400;
}

.session-chip-detail {
  font-size: 11px;
  color: var(--color-fg-subtle);
}

.session-chip.disconnected,
.session-chip.not-supported {
  opacity: 0.6;
  cursor: default;
}

.session-chip-action {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: auto;
  opacity: 0;
}

.session-chip-action svg {
  width: 12px;
  height: 12px;
}

.session-chip:hover .session-chip-action {
  opacity: 1;
}

.session-chip-action:hover {
  background: var(--color-neutral-muted);
}

.screencast-container {
  width: 533px;
  height: 300px;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

.screencast-frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.screencast-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg-subtle);
  font-size: 12px;
}
