/* View Mode Layout and Components */
body.projects-view-mode #app-sidebar {
  display: none !important;
}

body.projects-view-mode .workspace-wrapper {
  width: 100vw !important;
  max-width: 100vw !important;
  flex: 1 1 100% !important;
}

body.projects-view-mode .main-content-scroll {
  padding: 0 !important;
  overflow: hidden !important;
}

body.projects-view-mode .content-container {
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
}

.view-workbench {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-workspace);
}

.view-sidebar {
  width: 280px;
  min-width: 240px;
  background: #ffffff;
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: #fafbfc;
}

.view-sidebar-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.view-catalog-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.view-project-group {
  margin-bottom: 14px;
}

.view-project-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 8px;
  letter-spacing: 0.5px;
}

.view-entry-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  margin-top: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-entry-card:hover {
  background: #f6f8fa;
  border-color: var(--border-default);
}

.view-entry-card.active {
  background: #f0f7ff;
  border-color: #54aeff;
  box-shadow: 0 0 0 1px #54aeff;
}

.view-entry-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.view-entry-card-title span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-entry-card-title span:last-child {
  flex-shrink: 0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-entry-card-url {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-entry-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.view-display-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  position: relative;
  overflow: hidden;
}

.view-toolbar {
  height: 44px;
  background: #2d333b;
  border-bottom: 1px solid #444c56;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  color: #adbac7;
  font-size: 13px;
}

.view-toolbar-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #adbac7;
  border-radius: 4px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
}

.view-toolbar-btn:hover {
  background: #373e47;
  color: #cdd9e5;
}

.view-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.view-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
}

.view-status-connecting {
  background: rgba(187, 128, 9, 0.2);
  color: #e3b341;
}

.view-status-logging_in {
  background: rgba(46, 160, 67, 0.2);
  color: #56d364;
}

.view-status-ready {
  background: rgba(56, 139, 253, 0.2);
  color: #58a6ff;
}

.view-status-failed {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.view-viewport-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 10px;
}

.view-toolbar-select {
  background: #22272e;
  border: 1px solid #444c56;
  color: #adbac7;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.view-toolbar-select:focus {
  border-color: #58a6ff;
}

.view-iframe-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #ffffff;
}

.view-iframe-banner {
  background: #1c2738;
  border-bottom: 1px solid #388bfd;
  color: #adbac7;
  padding: 6px 12px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.view-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  flex: 1;
  background: #ffffff;
}

.view-canvas {
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  cursor: default;
  outline: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.view-canvas:focus {
  box-shadow: 0 0 0 2px #58a6ff, 0 4px 20px rgba(0, 0, 0, 0.5);
}

.view-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #768390;
  gap: 12px;
}

.view-downloads-bar {
  background: #22272e;
  border-top: 1px solid #444c56;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #adbac7;
}

.view-download-link {
  color: #58a6ff;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 768px) {
  .view-workbench {
    flex-direction: column !important;
  }

  .view-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-height: 180px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-default) !important;
    flex-shrink: 0 !important;
  }

  .view-catalog-list {
    max-height: 120px !important;
  }

  .view-display-container {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .view-toolbar {
    height: auto !important;
    min-height: 44px !important;
    flex-wrap: wrap !important;
    padding: 6px 10px !important;
    gap: 6px !important;
  }

  .view-viewport-wrapper {
    min-height: 0 !important;
    padding: 4px !important;
  }

  .view-iframe-container {
    min-height: 0 !important;
  }

  .view-iframe {
    min-height: 250px !important;
  }
}
