/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: #1e1e1e;
  color: #cccccc;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* VS Code Window */
.vscode-window {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
}

/* Title Bar - Mac Style */
.title-bar {
  height: 38px;
  background: #323233;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  user-select: none;
  border-bottom: 1px solid #252526;
  position: relative;
}

.title-left {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.window-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
}

.control-dot.red {
  background: #ff5f56;
}

.control-dot.yellow {
  background: #ffbd2e;
}

.control-dot.green {
  background: #27c93f;
}

.control-dot:hover {
  filter: brightness(0.9);
}

.title-center {
  font-size: 13px;
  color: #cccccc;
  font-weight: 400;
}

.title-right {
  position: absolute;
  right: 16px;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Activity Bar */
.activity-bar {
  width: 48px;
  background: #333333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
  border-right: 1px solid #252526;
}

.activity-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #858585;
  position: relative;
}

.activity-icon .codicon {
  font-size: 24px;
}

.activity-icon:hover {
  color: #cccccc;
}

.activity-icon.active {
  color: #ffffff;
}

.activity-icon.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #007acc;
}

.activity-bar-spacer {
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: #252526;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e1e1e;
}

.sidebar-header {
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 600;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
}

.section-header {
  padding: 4px 8px 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 700;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-header:hover {
  background: #2a2d2e;
}

.section-header:hover .section-actions {
  opacity: 1;
}

.section-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.1s;
}

.section-action-btn {
  background: transparent;
  border: none;
  color: #cccccc;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  padding: 0;
}

.section-action-btn:hover {
  background: #3e3e42;
}

.section-action-btn .codicon {
  font-size: 16px;
}

.section-icon {
  font-size: 10px;
  color: #cccccc;
  transition: transform 0.1s;
}

/* Inline input for new file/folder */
.tree-input-wrapper {
  display: flex;
  align-items: center;
  padding: 1px 8px 1px 20px;
  gap: 6px;
  height: 24px;
}

.tree-input-wrapper .tree-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tree-input {
  flex: 1;
  background: #3c3c3c;
  color: #cccccc;
  border: 1px solid #007acc;
  outline: none;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding: 1px 4px;
  border-radius: 2px;
  height: 20px;
}

/* Folder inline action buttons */
.tree-item.folder {
  position: relative;
}

.tree-item.folder .tree-name {
  flex: 1;
}

.tree-item-actions {
  display: none;
  margin-left: auto;
  gap: 1px;
  padding-right: 4px;
}

.tree-item.folder:hover .tree-item-actions {
  display: flex;
}

.tree-item-action {
  background: transparent;
  border: none;
  color: #cccccc;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  padding: 0;
}

.tree-item-action:hover {
  background: #3e3e42;
}

.tree-item-action .codicon {
  font-size: 14px;
}

/* File Tree */
.file-tree {
  padding: 4px 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.tree-item {
  display: flex;
  align-items: center;
  padding: 3px 8px 3px 20px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #cccccc;
  gap: 6px;
  height: 22px;
}

.tree-item:hover {
  background: #2a2d2e;
}

.tree-item.selected {
  background: #094771;
}

/* VS Code File Icons - Using Seti UI theme (VS Code default) */
.tree-item .tree-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Folder icons - Text chevron that rotates */
.tree-item.folder .tree-icon {
  background-image: none;
}

.tree-item.folder .tree-icon::before {
  content: '›';
  font-size: 16px;
  color: #cccccc;
  transition: transform 0.15s ease;
  display: inline-block;
  font-weight: 300;
}

.tree-item.folder.expanded .tree-icon::before {
  transform: rotate(90deg);
}

/* README.md - Blue info icon */
.tree-item.file[data-filename="README.md"] .tree-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/info.svg');
  filter: invert(59%) sepia(93%) saturate(451%) hue-rotate(167deg) brightness(91%) contrast(88%);
}

/* Regular .md files - Blue down arrow markdown icon */
.tree-item.file[data-ext="md"]:not([data-filename="README.md"]) .tree-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/markdown.svg');
}

/* JSON files - Yellow curly braces */
.tree-item.file[data-ext="json"] .tree-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/json.svg');
}

/* TXT files */
.tree-item.file[data-ext="txt"] .tree-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/text.svg');
}

/* JS files */
.tree-item.file[data-ext="js"] .tree-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/javascript.svg');
}

/* Python files */
.tree-item.file[data-ext="py"] .tree-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/python.svg');
}

.tree-item.folder {
  font-weight: 400;
}

.tree-item.file {
  padding-left: 36px;
}

.tree-item.nested-file {
  padding-left: 52px;
}

/* Editor Area */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  overflow: hidden;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  background: #252526;
  border-bottom: 1px solid #1e1e1e;
  overflow-x: auto;
  height: 35px;
}

.tab-bar::-webkit-scrollbar {
  height: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #2d2d2d;
  border-right: 1px solid #1e1e1e;
  cursor: pointer;
  font-size: 13px;
  color: #969696;
  min-width: 120px;
  user-select: none;
  height: 35px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.tab:hover {
  background: #323233;
}

.tab.active {
  background: #1e1e1e;
  color: #ffffff;
  border-top: 1px solid #007acc;
  border-bottom: 1px solid #1e1e1e;
}

/* Tab icons - using actual icon images */
/* Tab icons - using Seti UI theme */
.tab-icon {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* README.md tabs - Blue info icon */
.tab[data-filename="README.md"] .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/info.svg');
  filter: invert(59%) sepia(93%) saturate(451%) hue-rotate(167deg) brightness(91%) contrast(88%);
}

/* Regular .md tabs - Markdown icon */
.tab[data-ext="md"]:not([data-filename="README.md"]) .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/markdown.svg');
}

/* JSON tabs */
.tab[data-ext="json"] .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/json.svg');
}

/* TXT tabs */
.tab[data-ext="txt"] .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/text.svg');
}

/* JS tabs */
.tab[data-ext="js"] .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/javascript.svg');
}

/* Python tabs */
.tab[data-ext="py"] .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/python.svg');
}

/* Welcome tab */
.tab[data-type="welcome"] .tab-icon {
  background-image: url('https://raw.githubusercontent.com/jesseweed/seti-ui/master/icons/info.svg');
  filter: invert(59%) sepia(93%) saturate(451%) hue-rotate(167deg) brightness(91%) contrast(88%);
}

.tab-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close {
  opacity: 0;
  font-size: 18px;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 300;
  transition: opacity 0.1s;
}

.tab:hover .tab-close,
.tab.active .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: #424242;
}

/* Editor Content */
.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #1e1e1e;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
}

.editor-content::-webkit-scrollbar {
  width: 14px;
}

.editor-content::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.editor-content::-webkit-scrollbar-thumb {
  background: #424242;
  border: 3px solid #1e1e1e;
  border-radius: 7px;
}

.editor-content::-webkit-scrollbar-thumb:hover {
  background: #4e4e4e;
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #858585;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
}

.welcome-screen h1 {
  font-size: 32px;
  margin-bottom: 16px;
  color: #cccccc;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.welcome-screen p {
  font-size: 15px;
  font-weight: 400;
}

.welcome-screen code {
  background: #2d2d2d;
  padding: 3px 8px;
  border-radius: 3px;
  color: #ce9178;
  font-family: 'Menlo', monospace;
  font-size: 13px;
}

/* File Content Styles */
.file-content {
  color: #d4d4d4;
  white-space: pre-wrap;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  flex: 1;
}

.file-content.markdown {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.file-content.markdown h1 {
  color: #4ec9b0;
  font-size: 28px;
  margin: 20px 0 12px;
  border-bottom: 1px solid #404040;
  padding-bottom: 8px;
  font-weight: 600;
}

.file-content.markdown h2 {
  color: #4ec9b0;
  font-size: 22px;
  margin: 18px 0 10px;
  font-weight: 600;
}

.file-content.markdown h3 {
  color: #4ec9b0;
  font-size: 18px;
  margin: 14px 0 8px;
  font-weight: 600;
}

.file-content.markdown p {
  margin: 10px 0;
  line-height: 1.7;
}

.file-content.markdown ul {
  margin: 10px 0 10px 20px;
  line-height: 1.7;
}

.file-content.markdown li {
  margin: 6px 0;
}

.file-content.markdown strong {
  color: #dcdcaa;
  font-weight: 600;
}

.file-content.markdown code {
  background: #2d2d2d;
  padding: 2px 6px;
  border-radius: 3px;
  color: #ce9178;
  font-family: 'Menlo', monospace;
  font-size: 13px;
}

.file-content.json {
  color: #ce9178;
  font-family: 'Menlo', monospace;
}

.json-key {
  color: #9cdcfe;
}

.json-string {
  color: #ce9178;
}

.json-number {
  color: #b5cea8;
}

.json-boolean {
  color: #569cd6;
}

/* Status Bar */
.status-bar {
  height: 22px;
  background: #007acc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  color: #ffffff;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.status-left,
.status-right {
  display: flex;
  gap: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.status-item svg {
  width: 14px;
  height: 14px;
}

/* Terminal */
.terminal-container {
  height: 200px;
  background: #1e1e1e;
  border-top: 1px solid #2d2d2d;
  display: flex;
  flex-direction: column;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.terminal-container.minimized {
  height: 35px;
}

.terminal-container.minimized .terminal-content {
  display: none;
}

.terminal-header {
  height: 35px;
  background: #252526;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #1e1e1e;
}

.terminal-tabs {
  display: flex;
  gap: 0;
}

.terminal-tab {
  padding: 8px 16px;
  font-size: 11px;
  color: #cccccc;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.terminal-tab:hover {
  color: #ffffff;
}

.terminal-tab.active {
  color: #ffffff;
  border-bottom: 2px solid #007acc;
}

.terminal-controls {
  display: flex;
  gap: 4px;
}

.terminal-btn {
  background: transparent;
  border: none;
  color: #cccccc;
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.terminal-btn:hover {
  background: #3e3e42;
}

.terminal-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}

.terminal-content::-webkit-scrollbar {
  width: 14px;
}

.terminal-content::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.terminal-content::-webkit-scrollbar-thumb {
  background: #424242;
  border: 3px solid #1e1e1e;
  border-radius: 7px;
}

#terminal-output {
  color: #cccccc;
  margin-bottom: 4px;
}

.terminal-line {
  margin: 2px 0;
  font-family: 'Menlo', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-error {
  color: #f48771;
}

.terminal-success {
  color: #89d185;
}

.command-hint {
  color: #608b4e;
}

.terminal-input-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.terminal-prompt {
  color: #4ec9b0;
  white-space: nowrap;
  font-family: 'Menlo', monospace;
  line-height: 1.5;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #cccccc;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  caret-color: #cccccc;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  
  .activity-bar {
    width: 40px;
  }
  
  .terminal-container {
    height: 150px;
  }
  
  .title-center {
    display: none;
  }
}
.file-content.markdown a {
  color: #3794ff;
  text-decoration: none;
  transition: color 0.2s;
}

.file-content.markdown a:hover {
  color: #4fc3f7;
  text-decoration: underline;
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 8px;
  background: #252526;
  border-bottom: 1px solid #1e1e1e;
  margin: -20px -20px 12px -20px;
}

.editor-toggle-btn {
  background: #3c3c3c;
  color: #cccccc;
  border: 1px solid #505050;
  padding: 3px 12px;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}

.editor-toggle-btn:hover {
  background: #505050;
  color: #ffffff;
}

/* Editor Textarea */
.editor-textarea {
  width: 100%;
  flex: 1;
  min-height: calc(100% - 40px);
  background: #1e1e1e;
  color: #d4d4d4;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  padding: 0;
  tab-size: 2;
  white-space: pre-wrap;
  word-wrap: break-word;
  caret-color: #cccccc;
}

.editor-textarea::selection {
  background: #264f78;
}

.editor-textarea::-webkit-scrollbar {
  width: 14px;
}

.editor-textarea::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.editor-textarea::-webkit-scrollbar-thumb {
  background: #424242;
  border: 3px solid #1e1e1e;
  border-radius: 7px;
}

/* Breadcrumbs */
.editor-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
  margin: -20px -20px 0 -20px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 12px;
  min-height: 22px;
  flex-shrink: 0;
}

.breadcrumb-item {
  color: #969696;
  cursor: default;
}

.breadcrumb-item.breadcrumb-active {
  color: #cccccc;
}

.breadcrumb-sep {
  color: #606060;
  font-size: 10px;
}

/* Line-numbered editor */
.editor-lined-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.editor-gutter {
  width: 48px;
  flex-shrink: 0;
  background: #1e1e1e;
  color: #858585;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
  padding: 0 8px 0 0;
  overflow: hidden;
  user-select: none;
  border-right: 1px solid #2d2d2d;
}

.gutter-line {
  height: 1.7em;
}

.editor-lined-wrapper .editor-textarea {
  padding-left: 12px;
}

/* Tab modified dot */
.tab-close.tab-modified {
  opacity: 1;
  font-size: 10px;
  color: #cccccc;
}