/* VS Code Dark+ Theme - Personal Homepage */

:root {
  --bg-outer: #111;
  --bg-editor: #1e1e1e;
  --bg-titlebar: #323233;
  --bg-tab-active: #1e1e1e;
  --bg-tab-inactive: #2d2d2d;
  --bg-terminal: #1e1e1e;
  --bg-statusbar: #007acc;
  --bg-activity: #333;
  --bg-minimap: #1a1a1a;
  --text-primary: #d4d4d4;
  --text-secondary: #858585;
  --line-number: #858585;
  --kw: #c586c0;
  --fn: #dcdcaa;
  --cls: #4ec9b0;
  --str: #ce9178;
  --cm: #6a9955;
  --param: #9cdcfe;
  --op: #d4d4d4;
  --builtin: #dcdcaa;
  --font-mono: 'JetBrains Mono', monospace;
  --font-size: 14px;
  --line-height: 1.5;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-outer);
  font-family: var(--font-mono);
  font-size: var(--font-size);
  color: var(--text-primary);
}

/* Editor container — floating window */
.editor {
  max-width: 1100px;
  width: 95%;
  height: 92vh;
  margin: 4vh auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* Title bar */
.titlebar {
  height: 35px;
  min-height: 35px;
  background: var(--bg-titlebar);
  display: flex;
  align-items: center;
  padding: 0 12px;
  -webkit-app-region: drag;
  border-radius: 8px 8px 0 0;
}

.window-controls {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.window-dot.red { background: #ff5f56; }
.window-dot.yellow { background: #ffbd2e; }
.window-dot.green { background: #27c93f; }

.titlebar-text {
  font-size: 12px;
  color: var(--text-secondary);
  user-select: none;
}

/* Tabs */
.tabs {
  height: 35px;
  min-height: 35px;
  background: var(--bg-tab-inactive);
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #252526;
}

.tab-btn {
  padding: 0 20px;
  background: var(--bg-tab-inactive);
  color: var(--text-secondary);
  border: none;
  border-right: 1px solid #252526;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: background 0.1s, color 0.1s;
}

.tab-btn:hover {
  background: var(--bg-tab-active);
}

.tab-btn.active {
  background: var(--bg-tab-active);
  color: var(--text-primary);
  border-top: 2px solid var(--bg-statusbar);
}

.tab-btn .icon {
  color: #519aba;
  font-size: 11px;
}

/* Tab close button */
.tab-close {
  margin-left: 8px;
  font-size: 14px;
  color: #858585;
  opacity: 0;
  transition: opacity 0.15s ease;
  line-height: 1;
  pointer-events: none;
}

.tab-btn:hover .tab-close {
  opacity: 0.6;
}

.tab-btn:hover .tab-close:hover {
  opacity: 1;
}

/* Breadcrumb bar */
.breadcrumb {
  height: 24px;
  min-height: 24px;
  background: var(--bg-editor);
  display: flex;
  align-items: center;
  padding: 0 12px 0 12px;
  font-size: 11px;
  color: var(--text-secondary);
  border-bottom: 1px solid #252526;
  user-select: none;
}

.breadcrumb-sep {
  margin: 0 4px;
  color: #555;
  font-size: 10px;
}

.breadcrumb-file {
  color: var(--text-primary);
}

/* Editor middle row: activity bar + editor body + minimap */
.editor-middle {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Activity bar */
.activity-bar {
  width: 48px;
  min-width: 48px;
  background: var(--bg-activity);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 4px;
  border-right: 1px solid #252526;
}

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

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

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

/* Editor body */
.editor-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  background: var(--bg-editor);
  min-width: 0;
}

/* Tab content visibility */
.tab-content {
  display: none;
  width: 100%;
}

.tab-content.active {
  display: flex;
}

/* Line numbers */
.line-numbers {
  min-width: 50px;
  padding: 8px 12px 8px 0;
  text-align: right;
  color: var(--line-number);
  user-select: none;
  font-family: var(--font-mono);
  font-size: var(--font-size);
  line-height: var(--line-height);
  flex-shrink: 0;
}

.line-numbers span {
  display: block;
  transition: color 0.1s ease;
}

.line-numbers span.active {
  color: #c6c6c6;
}

/* Code area */
.code-area {
  flex: 1;
  padding: 8px 0 8px 16px;
  min-width: 0;
}

.code-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--text-primary);
}

/* Syntax highlighting */
.kw { color: var(--kw); }
.fn { color: var(--fn); }
.cls { color: var(--cls); }
.str { color: var(--str); }
.cm { color: var(--cm); }
.op { color: var(--op); }
.param { color: var(--param); }
.builtin { color: var(--builtin); }
.num { color: #b5cea8; }

/* Code lines — blame on hover/active */
.code-line {
  display: block;
  white-space: pre;
  position: relative;
  transition: background 0.1s ease;
}

.code-line[data-blame]:hover,
.code-line.active {
  background: rgba(255, 255, 255, 0.04);
}

.code-line[data-blame]::after {
  transition: opacity 0.15s ease;
}

.code-line[data-blame]:hover::after,
.code-line.active::after {
  content: "    " attr(data-blame);
  color: #6e7681;
  font-style: italic;
  font-size: 0.82em;
  pointer-events: none;
  opacity: 0.75;
}

.code-line.active::after {
  color: #858585;
  opacity: 1;
}

/* Links styled as strings */
.code-area a {
  color: var(--str);
  text-decoration: none;
}

.code-area a:hover {
  text-decoration: underline;
}

/* Minimap */
.minimap {
  width: 60px;
  min-width: 60px;
  background: var(--bg-minimap);
  border-left: 1px solid #252526;
  position: relative;
  overflow: hidden;
  padding: 8px 6px;
}

.minimap-viewport {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 1;
}

.minimap-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mm-line {
  height: 2px;
  border-radius: 1px;
  opacity: 0.55;
}

.mm-line.mm-blank {
  height: 2px;
  background: transparent;
}

/* Terminal */
.terminal {
  height: 110px;
  min-height: 80px;
  background: var(--bg-terminal);
  border-top: 1px solid #414141;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  overflow-y: auto;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid #414141;
  padding-bottom: 4px;
}

.terminal-header span.active-term {
  color: var(--text-primary);
}

.terminal-prompt {
  color: #27c93f;
}

.terminal-cmd {
  color: var(--text-primary);
}

.terminal-links {
  display: flex;
  gap: 24px;
  padding-left: 18px;
  margin-top: 4px;
}

.terminal-links a {
  color: var(--param);
  text-decoration: none;
  font-size: 13px;
}

.terminal-links a:hover {
  text-decoration: underline;
  color: #fff;
}

/* Status bar */
.statusbar {
  height: 22px;
  min-height: 22px;
  background: var(--bg-statusbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  color: #fff;
  border-radius: 0 0 8px 8px;
}

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

/* Scrollbar styling */
.editor-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.editor-body::-webkit-scrollbar-track {
  background: var(--bg-editor);
}

.editor-body::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 0;
}

.editor-body::-webkit-scrollbar-thumb:hover {
  background: #4f4f4f;
}

.editor-body::-webkit-scrollbar-corner {
  background: var(--bg-editor);
}

.terminal::-webkit-scrollbar {
  width: 8px;
}

.terminal::-webkit-scrollbar-track {
  background: var(--bg-terminal);
}

.terminal::-webkit-scrollbar-thumb {
  background: #424242;
}

/* Responsive */
@media (max-width: 480px) {
  :root {
    --font-size: 12px;
  }

  .activity-bar {
    display: none;
  }

  .minimap {
    display: none;
  }

  .line-numbers {
    display: none;
  }

  .code-area {
    padding-left: 12px;
  }

  .terminal {
    height: 80px;
    min-height: 60px;
  }

  .terminal-links {
    gap: 16px;
  }

  .tab-btn {
    padding: 0 12px;
    font-size: 12px;
  }

  .titlebar-text {
    font-size: 11px;
  }

  .breadcrumb {
    padding-left: 8px;
  }
}

@media (max-width: 768px) {
  .editor {
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .titlebar {
    border-radius: 0;
  }

  .statusbar {
    border-radius: 0;
    font-size: 11px;
  }

  .minimap {
    display: none;
  }
}
