/* Studio-style project viewer, ported from the blog. */
.project-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.project-detail-name {
  margin-bottom: 8px;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 800;
  line-height: 1.15;
}

.project-detail-desc {
  max-width: 720px;
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.6;
}

.project-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.project-detail-actions {
  flex-shrink: 0;
}

.btn svg {
  width: 14px;
  height: 14px;
  margin-right: 8px;
}

.ide-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 280px);
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #0e0e0e;
  overflow: hidden;
}

.ide-titlebar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid #1a1a1a;
  background: #0e0e0e;
}

.ide-titlebar-dots {
  display: flex;
  gap: 6px;
  margin-right: 12px;
}

.ide-titlebar-dot {
  width: 10px;
  height: 10px;
  border: 1px solid #3a3a3a;
  background: #1a1a1a;
}

.ide-titlebar-text {
  flex: 1;
  margin-right: 40px;
  color: #8a8a8a;
  font-size: 12px;
  text-align: center;
}

.ide-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ide-activity-bar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  width: 40px;
  padding: 8px 0;
  border-right: 1px solid #1a1a1a;
  background: #111111;
}

.ide-activity-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #9a9a9a;
}

.ide-activity-icon.active {
  color: var(--text);
}

.ide-activity-icon.active::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 2px;
  background: var(--accent);
}

.ide-activity-icon svg {
  width: 20px;
  height: 20px;
}

.ide-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 260px;
  border-right: 1px solid #1a1a1a;
  background: #141414;
  overflow: hidden;
}

.ide-sidebar-header {
  flex-shrink: 0;
  padding: 10px 16px;
  color: #9a9a9a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  user-select: none;
}

.ide-sidebar-section {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 6px 8px 6px 16px;
  border: 0;
  border-top: 1px solid #1e1e1e;
  border-radius: 0;
  background: #1a1a1a;
  color: #cccccc;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.ide-sidebar-section:hover {
  background: var(--hover);
}

.ide-file-tree {
  flex: 1;
  padding: 2px 0;
  overflow-y: auto;
}

.ide-file-tree.collapsed {
  display: none;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b0b0b0;
  font-family: var(--font-ui);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.tree-item:hover {
  background: #1e1e1e;
  color: var(--text);
}

.tree-item.active {
  background: #1e1e1e;
  color: #ffffff;
}

.tree-item-arrow {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #9a9a9a;
  font-size: 10px;
}

.tree-item-arrow.open {
  transform: rotate(90deg);
}

.tree-item-arrow.hidden {
  visibility: hidden;
}

.tree-item-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.tree-item-icon.folder-icon { color: #dcb67a; }
.tree-item-icon.file-icon-cpp { color: #519aba; }
.tree-item-icon.file-icon-c,
.tree-item-icon.file-icon-h { color: #599dd6; }
.tree-item-icon.file-icon-rs { color: #dea584; }
.tree-item-icon.file-icon-py { color: #4b8bbe; }
.tree-item-icon.file-icon-toml,
.tree-item-icon.file-icon-cmake,
.tree-item-icon.file-icon-default { color: #9a9a9a; }

.tree-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-children.collapsed {
  display: none;
}

.ide-editor-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  background: #0f0f0f;
  overflow: hidden;
}

.ide-tab-bar {
  display: flex;
  flex-shrink: 0;
  min-height: 35px;
  border-bottom: 1px solid #1a1a1a;
  background: #111111;
  overflow-x: auto;
}

.ide-tab {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 35px;
  padding: 0 14px;
  margin-bottom: -1px;
  border-bottom: 1px solid #0f0f0f;
  background: #0f0f0f;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.ide-tab::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
}

.ide-tab-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ide-breadcrumb {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 4px 16px;
  border-bottom: 1px solid #1a1a1a;
  background: #0f0f0f;
  color: #8a8a8a;
  font-size: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.ide-breadcrumb-sep {
  color: #8a8a8a;
  font-size: 10px;
}

.ide-breadcrumb-item:last-child {
  color: #cccccc;
}

.ide-code-area {
  position: relative;
  flex: 1;
  background: #0f0f0f;
  overflow: auto;
}

.ide-code-area pre {
  display: flex;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ide-code-area pre code {
  display: block;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c8c8c8;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  tab-size: 4;
  white-space: pre;
}

.code-line {
  position: relative;
  display: block;
  height: 20px;
  padding: 0 16px 0 0;
  line-height: 20px;
}

.code-line.active {
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.indent-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.ide-gutter {
  flex-shrink: 0;
  min-width: 54px;
  background: #0f0f0f;
  text-align: right;
  user-select: none;
}

.gutter-line {
  display: block;
  height: 20px;
  padding: 0 16px 0 8px;
  color: #7a7a7a;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
}

.gutter-line.active {
  color: #d0d0d0;
}

.ide-status-bar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  border-top: 1px solid #1a1a1a;
  background: #0e0e0e;
}

.ide-status-left,
.ide-status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ide-status-left {
  flex: 1;
}

.ide-status-item {
  color: #9a9a9a;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .project-detail-header {
    flex-direction: column;
  }

  .ide-container {
    height: auto;
    min-height: 0;
  }

  .ide-activity-bar {
    display: none;
  }

  .ide-body {
    flex-direction: column;
  }

  .ide-sidebar-panel {
    width: auto;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid #1a1a1a;
  }

  .ide-code-area {
    height: 460px;
    flex: none;
  }
}
