/* VSCode Exact Layout */

/* D2Coding Font for Korean */
@font-face {
  font-family: 'D2Coding';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_three@1.0/D2Coding.woff') format('woff2'),
       url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_three@1.0/D2Coding.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'D2Coding';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_three@1.0/D2Coding.woff') format('woff2'),
       url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_three@1.0/D2Coding.woff') format('woff');
  font-weight: bold;
  font-display: swap;
  font-style: normal;
}

/* VSCode Color Variables */
:root {
  --activity-bar-bg: #333333;
  --activity-bar-active: #007acc;
  --sidebar-bg: #252526;
  --editor-bg: #1e1e1e;
  --titlebar-bg: #3c3c3c;
  --tab-bg: #2d2d2d;
  --tab-active-bg: #1e1e1e;
  --statusbar-bg: #007acc;

  --text-primary: #cccccc;
  --text-secondary: #969696;
  --border-color: #1e1e1e;

  --keyword: #569cd6;
  --string: #ce9178;
  --function: #dcdcaa;
  --comment: #6a9955;
  --variable: #9cdcfe;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'D2Coding', 'Segoe UI', 'Consolas', monospace;
  background: var(--editor-bg);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

/* Main Container */
.vscode-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Title Bar (맨 위) */
.vscode-titlebar {
  height: 35px;
  background: var(--titlebar-bg);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
  -webkit-app-region: drag;
  border-bottom: 1px solid var(--border-color);
}

.vscode-titlebar .title {
  flex: 1;
  text-align: center;
  color: var(--text-secondary);
}

/* Main Layout (Activity Bar + Sidebar + Editor) */
.vscode-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Activity Bar (맨 왼쪽, 아이콘 바) */
.vscode-activitybar {
  width: 48px;
  background: var(--activity-bar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  border-right: 1px solid var(--border-color);
}

.activity-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 24px;
  position: relative;
  transition: color 0.2s;
}

.activity-icon:hover {
  color: var(--text-primary);
}

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

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

/* Side Bar (파일 탐색기) */
.vscode-sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  height: 35px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  padding: 5px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.sidebar-item {
  padding: 5px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.1s;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-item .icon {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

/* Editor Group (탭 + 에디터) */
.vscode-editor-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--editor-bg);
}

/* Tab Bar */
.vscode-tabs {
  height: 35px;
  background: var(--tab-bg);
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.vscode-tab {
  min-width: 120px;
  max-width: 200px;
  height: 35px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  background: var(--tab-bg);
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
}

.vscode-tab.active {
  background: var(--tab-active-bg);
  color: var(--text-primary);
}

.vscode-tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--activity-bar-active);
}

.tab-icon {
  margin-right: 6px;
}

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

/* Editor */
.vscode-editor {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px;
  max-width: 1000px;
}

/* Status Bar (맨 아래) */
.vscode-statusbar {
  height: 22px;
  background: var(--statusbar-bg);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  color: white;
  justify-content: space-between;
}

.statusbar-left,
.statusbar-right {
  display: flex;
  gap: 15px;
}

/* Content Styling */
.post-header-meta {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 600;
}

.post-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.post-content h2,
.post-content h3 {
  color: var(--keyword);
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

.post-content h2 { font-size: 22px; }
.post-content h3 { font-size: 18px; }

.post-content p {
  line-height: 1.8;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.post-content a {
  color: var(--activity-bar-active);
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-content code {
  background: var(--sidebar-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--string);
}

.post-content pre {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 15px;
  overflow-x: auto;
  margin: 20px 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.post-content ul,
.post-content ol {
  margin-left: 30px;
  margin-bottom: 15px;
}

.post-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.post-content blockquote {
  border-left: 3px solid var(--activity-bar-active);
  padding-left: 15px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Post List (Home) */
.post-list {
  list-style: none;
}

.post-list-item {
  padding: 15px 20px;
  margin-bottom: 2px;
  background: var(--sidebar-bg);
  cursor: pointer;
  transition: background 0.1s;
}

.post-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.post-list-title {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.post-list-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 5px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .vscode-activitybar {
    width: 40px;
  }

  .vscode-sidebar {
    width: 200px;
  }

  .vscode-editor {
    padding: 15px 20px;
  }
}

@media (max-width: 600px) {
  .vscode-sidebar {
    display: none;
  }

  .vscode-activitybar {
    display: none;
  }
}

/* Codicon adjustments */
.activity-icon .codicon {
  font-size: 24px;
}

.sidebar-item .codicon.icon {
  font-size: 16px;
}

.tab-icon.codicon {
  font-size: 16px;
}

.statusbar-left .codicon,
.statusbar-right .codicon {
  font-size: 14px;
}

/* Right Panel (Outline + Minimap) */
.vscode-right-panel {
  width: 250px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-panel-section {
  border-bottom: 1px solid var(--border-color);
  overflow-y: auto;
}

.right-panel-section.outline {
  flex: 0 0 40%;
}

.right-panel-section.minimap {
  flex: 1;
}

.right-panel-header {
  height: 35px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: var(--tab-bg);
}

.outline-item {
  padding: 6px 15px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  transition: background 0.1s;
  display: flex;
  align-items: center;
}

.outline-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.outline-item.level-2 {
  padding-left: 20px;
}

.outline-item.level-3 {
  padding-left: 35px;
  font-size: 11px;
}

.outline-item .codicon {
  margin-right: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Minimap */
.minimap-content {
  padding: 10px;
  font-size: 3px;
  line-height: 3px;
  opacity: 0.4;
  user-select: none;
  overflow: hidden;
  word-wrap: break-word;
}

/* Terminal Panel (하단) */
.vscode-terminal-panel {
  height: 250px;
  background: var(--editor-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.terminal-tabs {
  height: 35px;
  background: var(--tab-bg);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 0 10px;
  gap: 10px;
}

.terminal-tab {
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid transparent;
}

.terminal-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--activity-bar-active);
}

.terminal-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
}

.terminal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.terminal-tag {
  background: var(--sidebar-bg);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s;
}

.terminal-tag:hover {
  background: var(--activity-bar-active);
}

/* Layout adjustment with terminal */
.vscode-main.with-terminal {
  flex: 1;
  min-height: 0;
}

.vscode-editor-group.with-right-panel {
  display: flex;
}

.vscode-editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .vscode-right-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .vscode-terminal-panel {
    height: 180px;
  }
}

/* Terminal Panel Toggle */
.vscode-terminal-panel.hidden {
  display: none;
}

.statusbar-toggle {
  cursor: pointer;
  padding: 0 10px;
  transition: background 0.2s;
  user-select: none;
}

.statusbar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.statusbar-toggle .codicon {
  margin-right: 5px;
}

/* Language switcher */
.statusbar-lang {
  cursor: pointer;
  padding: 0 5px;
  transition: all 0.2s;
  user-select: none;
}

.statusbar-lang:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: underline;
}

.statusbar-lang-disabled {
  padding: 0 5px;
  opacity: 0.6;
  cursor: default;
  user-select: none;
}

/* Comments section in terminal */
.terminal-comments {
  padding: 0;
}

.terminal-comments .utterances {
  max-width: none;
}
/* Critical Fixes */

/* Fix: Body overflow and height */
body {
  font-family: 'D2Coding', 'Segoe UI', 'Consolas', monospace !important;
  background: var(--editor-bg);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

/* Fix: Main layout height calculation */
.vscode-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Fix: Editor needs to scroll */
.vscode-editor {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 20px 40px;
  height: 100%;
  width: 100%;
}

/* Fix: Editor wrapper height */
.vscode-editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Fix: Editor group height with right panel */
.vscode-editor-group {
  flex: 1;
  display: flex;
  flex-direction: row;
  background: var(--editor-bg);
  overflow: hidden;
  min-height: 0;
}

/* Fix: Right panel should be visible */
.vscode-right-panel {
  width: 250px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border-color);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* Fix: Ensure post content uses D2Coding */
.post-content,
.post-content p,
.post-content li,
.post-content td,
.post-content th {
  font-family: 'D2Coding', 'Segoe UI', 'Consolas', monospace !important;
}

/* Fix: Terminal panel height */
.vscode-terminal-panel {
  height: 250px;
  background: var(--editor-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

/* Terminal resize handle */
.terminal-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  cursor: ns-resize;
  background: transparent;
  z-index: 10;
  transition: background 0.2s;
}

.terminal-resize-handle:hover {
  background: rgba(14, 99, 156, 0.5);
}

.terminal-resize-handle:active {
  background: rgba(14, 99, 156, 0.8);
}

/* Fix: Container layout with terminal */
.vscode-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.vscode-main.with-terminal {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Terminal Style Comments */
.terminal-comments {
  padding: 0;
  background: #1a1a1a;
}

.terminal-header {
  background: #0a0a0a;
  padding: 8px 15px;
  border-bottom: 1px solid #333;
  font-family: 'D2Coding', monospace;
  font-size: 12px;
  color: #4EC9B0;
  display: flex;
  align-items: center;
}

.terminal-prompt {
  color: #4EC9B0;
  margin-right: 10px;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #4EC9B0;
  margin-left: 5px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.terminal-comments-wrapper {
  padding: 15px;
  background: #0a0a0a;
  min-height: 150px;
}

/* Override utterances styles */
.terminal-comments .utterances {
  max-width: none !important;
}

.terminal-comments iframe.utterances-frame {
  border-radius: 0 !important;
  border: none !important;
}

/* Terminal intro text */
.terminal-intro {
  font-family: 'D2Coding', monospace;
  font-size: 13px;
  color: #4EC9B0;
  margin-bottom: 15px;
  line-height: 1.6;
}

.terminal-intro .comment-sign {
  color: #6a9955;
}

.terminal-intro .prompt-line {
  color: #858585;
  margin: 5px 0;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
  /* Hide sidebar and activitybar completely */
  .vscode-activitybar {
    display: none !important;
  }
  
  .vscode-sidebar {
    display: none !important;
  }
  
  /* Editor takes full width */
  .vscode-editor-group {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Hide right panel (outline, minimap) on mobile */
  .vscode-right-panel {
    display: none !important;
  }
  
  /* Full width editor */
  .vscode-editor {
    padding: 10px 15px;
    max-width: 100%;
  }
  
  /* Adjust title bar */
  .vscode-titlebar {
    padding: 0 10px;
    font-size: 12px;
  }
  
  /* Status bar adjustments */
  .vscode-statusbar {
    flex-wrap: wrap;
    padding: 5px 10px;
  }
  
  .statusbar-left,
  .statusbar-right {
    font-size: 11px;
  }
  
  /* Terminal panel smaller on mobile */
  .vscode-terminal-panel {
    height: 200px;
  }
  
  /* Post content adjustments */
  .post-content h1 { font-size: 24px; }
  .post-content h2 { font-size: 20px; }
  .post-content h3 { font-size: 18px; }
  
  .post-content pre {
    font-size: 12px;
    padding: 10px;
    overflow-x: auto;
  }
  
  .post-content code {
    font-size: 12px;
  }
  
  .post-content table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .vscode-titlebar {
    font-size: 11px;
  }
  
  .vscode-editor {
    padding: 8px 12px;
  }
  
  .post-content h1 { font-size: 20px; }
  .post-content h2 { font-size: 18px; }
  .post-content h3 { font-size: 16px; }
  
  .post-content {
    font-size: 14px;
  }
}

/* ================================
   Git Terminal Comment System
   ================================ */

.git-terminal {
  width: 100%;
  background-color: #1e1e1e;
  color: #cccccc;
  font-family: 'D2Coding', 'Consolas', monospace !important;
  font-size: 14px;
  line-height: 1.6;
  padding: 16px;
  border-radius: 4px;
}

.terminal-output {
  margin-bottom: 12px;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terminal-output div {
  margin: 2px 0;
}

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

.terminal-prompt {
  color: #858585;
  flex-shrink: 0;
  user-select: none;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #cccccc;
  font-family: 'D2Coding', 'Consolas', monospace !important;
  font-size: 14px;
  caret-color: #cccccc;
}

.terminal-input::selection {
  background-color: #264f78;
}

.terminal-output::-webkit-scrollbar {
  width: 10px;
}

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

.terminal-output::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 5px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
  background: #4e4e4e;
}

/* ================================
   Git Graph Visualization
   ================================ */

.git-graph-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-family: 'D2Coding', 'Consolas', monospace !important;
}

.git-graph-header {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.git-branch-filters {
  display: flex;
  gap: 15px;
  font-size: 12px;
}

.git-branch-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.git-branch-filter input[type="checkbox"] {
  cursor: pointer;
}

.branch-color {
  font-size: 14px;
}

.branch-color.dev {
  color: #007acc; /* VSCode blue */
}

.branch-color.blog {
  color: #4ec9b0; /* VSCode green */
}

.git-graph-content {
  padding: 5px 0;
}

.git-commit-row {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  transition: background 0.2s;
}

.git-commit-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.git-graph-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}

.git-node {
  font-size: 16px;
  line-height: 1;
}

.git-node.dev {
  color: #007acc;
}

.git-node.blog {
  color: #4ec9b0;
}

.git-line {
  flex: 1;
  width: 2px;
  margin: 2px 0;
  font-style: normal;
}

.git-line.dev {
  color: #007acc;
}

.git-line.blog {
  color: #4ec9b0;
}

.git-commit-info {
  flex: 1;
  min-width: 0;
}

.git-commit-message {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-commit-row.dev .git-commit-message {
  color: #cccccc;
}

.git-commit-row.blog .git-commit-message {
  color: #4ec9b0;
  font-weight: 500;
}

.git-commit-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.git-commit-hash {
  color: #858585;
  font-family: 'D2Coding', monospace;
}

.git-commit-date {
  color: #858585;
}

.git-commit-categories {
  color: #569cd6;
  font-size: 10px;
}

.git-commit-row[style*="cursor: pointer"] {
  cursor: pointer;
}

.git-commit-row[style*="cursor: pointer"]:hover .git-commit-message {
  color: #4fc1ff;
  text-decoration: underline;
}
