/* =========================================================
   VS Code Theme — Portfolio
   Mimics Visual Studio Code Dark+ theme
   ========================================================= */

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

:root {
  --vsc-bg:            #1e1e1e;
  --vsc-sidebar-bg:    #252526;
  --vsc-activitybar-bg:#333333;
  --vsc-titlebar-bg:   #3c3c3c;
  --vsc-statusbar-bg:  #007acc;
  --vsc-tab-active-bg: #1e1e1e;
  --vsc-tab-inactive-bg:#2d2d2d;
  --vsc-tab-border:    #252526;
  --vsc-border:        #3c3c3c;
  --vsc-text:          #d4d4d4;
  --vsc-text-dim:      #858585;
  --vsc-text-bright:   #ffffff;
  --vsc-keyword:       #569cd6;
  --vsc-string:        #ce9178;
  --vsc-comment:       #6a9955;
  --vsc-number:        #b5cea8;
  --vsc-type:          #4ec9b0;
  --vsc-function:      #dcdcaa;
  --vsc-variable:      #9cdcfe;
  --vsc-constant:      #4fc1ff;
  --vsc-link:          #3794ff;
  --vsc-highlight:     #264f78;
  --vsc-line-number:   #858585;
  --vsc-line-active:   #282828;
  --vsc-scrollbar:     #424242;
  --vsc-selection:     #264f78;
  --font-mono:         'Fira Code', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

html { font-size: 13px; }

body {
  font-family: var(--font-mono);
  background: var(--vsc-bg);
  color: var(--vsc-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: var(--vsc-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Title Bar ------------------------------------------ */
.titlebar {
  background: var(--vsc-titlebar-bg);
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  -webkit-app-region: drag;
  flex-shrink: 0;
  border-bottom: 1px solid #2b2b2b;
}

.titlebar-text {
  font-size: 11px;
  color: var(--vsc-text-dim);
  letter-spacing: 0.02em;
}

.titlebar-controls {
  position: absolute;
  right: 8px;
  display: flex;
  gap: 8px;
}

.titlebar-btn {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.titlebar-btn.close    { background: #f1605d; }
.titlebar-btn.minimize { background: #f5c040; }
.titlebar-btn.maximize { background: #60ca5e; }

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

/* --- Activity Bar --------------------------------------- */
.activitybar {
  width: 48px;
  background: var(--vsc-activitybar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  flex-shrink: 0;
  border-right: 1px solid var(--vsc-border);
}

.activitybar-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: var(--vsc-text-dim);
  cursor: pointer;
  font-size: 20px;
  position: relative;
  transition: color 0.15s;
}

.activitybar-icon:hover,
.activitybar-icon.active {
  color: var(--vsc-text-bright);
}

.activitybar-icon.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--vsc-text-bright);
  border-radius: 1px;
}

/* --- Sidebar -------------------------------------------- */
.sidebar {
  width: 260px;
  background: var(--vsc-sidebar-bg);
  border-right: 1px solid var(--vsc-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s ease;
}

.sidebar.collapsed { width: 0; border-right: none; }

.sidebar-header {
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--vsc-text-dim);
  user-select: none;
}

.file-tree { flex: 1; overflow-y: auto; padding-bottom: 12px; }

.tree-folder {
  padding: 3px 0 3px 12px;
  font-size: 12px;
  color: var(--vsc-text-dim);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tree-folder::before {
  content: '>';
  display: inline-block;
  transition: transform 0.15s;
  font-size: 10px;
  width: 12px;
}
.tree-folder.open::before { transform: rotate(90deg); }

.tree-folder-children { display: none; }
.tree-folder.open + .tree-folder-children { display: block; }

.tree-file {
  padding: 3px 0 3px 36px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--vsc-text);
  transition: background 0.1s;
}

.tree-file:hover { background: rgba(255,255,255,0.04); }
.tree-file.active { background: rgba(255,255,255,0.08); }

.file-icon {
  font-size: 11px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.file-icon.md    { color: var(--vsc-keyword); }
.file-icon.json  { color: var(--vsc-function); }
.file-icon.log   { color: var(--vsc-string); }
.file-icon.sh    { color: var(--vsc-type); }

/* --- Editor Area ---------------------------------------- */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* --- Tabs ----------------------------------------------- */
.tab-bar {
  display: flex;
  background: var(--vsc-tab-border);
  height: 35px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--vsc-text-dim);
  background: var(--vsc-tab-inactive-bg);
  border-right: 1px solid var(--vsc-tab-border);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
  user-select: none;
  min-width: 0;
}

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

.tab.active {
  background: var(--vsc-tab-active-bg);
  color: var(--vsc-text-bright);
  border-bottom: 1px solid var(--vsc-tab-active-bg);
  margin-bottom: -1px;
}

.tab-close {
  font-size: 14px;
  opacity: 0;
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  line-height: 1;
  transition: opacity 0.1s, background 0.1s;
}
.tab:hover .tab-close,
.tab.active .tab-close { opacity: 0.6; }
.tab-close:hover { opacity: 1 !important; background: rgba(255,255,255,0.1); }

.tab-icon { font-size: 11px; }

/* --- Editor Content ------------------------------------- */
.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  border-top: 1px solid var(--vsc-border);
  position: relative;
}

.editor-panel {
  display: none;
  padding: 0 24px 24px 64px;
  position: relative;
  min-height: 100%;
}
.editor-panel.active { display: block; }

/* Line numbers gutter */
.editor-panel::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 56px;
  background: var(--vsc-bg);
}

.line {
  padding: 1px 0;
  min-height: 1.5em;
  position: relative;
}
.line:hover { background: var(--vsc-line-active); }
.line::before {
  counter-increment: line-number;
  content: counter(line-number);
  position: absolute;
  left: -48px;
  width: 36px;
  text-align: right;
  color: var(--vsc-line-number);
  font-size: 12px;
  user-select: none;
}

.editor-panel { counter-reset: line-number; }

/* Syntax coloring */
.kw    { color: var(--vsc-keyword); }
.str   { color: var(--vsc-string); }
.cmt   { color: var(--vsc-comment); }
.num   { color: var(--vsc-number); }
.type  { color: var(--vsc-type); }
.fn    { color: var(--vsc-function); }
.var   { color: var(--vsc-variable); }
.const { color: var(--vsc-constant); }
.punct { color: var(--vsc-text-dim); }
.hl    { background: var(--vsc-highlight); padding: 1px 4px; border-radius: 2px; }

/* Indent helper */
.indent-1 { padding-left: 2ch; }
.indent-2 { padding-left: 4ch; }
.indent-3 { padding-left: 6ch; }

/* Section heading in editor */
.editor-heading {
  font-size: 16px;
  color: var(--vsc-keyword);
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--vsc-border);
  margin-bottom: 8px;
}

/* Job card in editor */
.editor-job {
  margin: 12px 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.editor-job-title {
  font-size: 13px;
}

.editor-job-meta {
  color: var(--vsc-text-dim);
  font-size: 12px;
  margin: 2px 0 6px;
}

.editor-job ul {
  list-style: none;
  margin: 4px 0;
}

.editor-job li {
  padding: 2px 0 2px 2ch;
  position: relative;
  line-height: 1.6;
}

.editor-job li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: var(--vsc-comment);
}

.editor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.editor-tag {
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(86,156,214,0.15);
  color: var(--vsc-keyword);
  border-radius: 3px;
}

/* Cert cards */
.editor-cert {
  display: inline-flex;
  flex-direction: column;
  padding: 8px 14px;
  margin: 4px 8px 4px 0;
  border: 1px solid var(--vsc-border);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.editor-cert-issuer {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--vsc-text-dim);
  letter-spacing: 0.08em;
}

.editor-cert-name {
  color: var(--vsc-function);
  font-size: 12px;
}

/* Award items */
.editor-award {
  padding: 4px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.editor-award-icon {
  color: var(--vsc-function);
  flex-shrink: 0;
}

.editor-award-title { color: var(--vsc-text); }
.editor-award-source { color: var(--vsc-text-dim); font-size: 12px; }
.editor-award-quote {
  color: var(--vsc-comment);
  font-style: italic;
  font-size: 12px;
  margin-top: 2px;
}

/* Skill tags in editor */
.editor-skill-group {
  margin: 8px 0;
}

.editor-skill-label {
  color: var(--vsc-comment);
  font-size: 12px;
}

.editor-skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Welcome tab README */
.readme-hero {
  padding: 24px 0;
}

.readme-title {
  font-size: 24px;
  color: var(--vsc-keyword);
  margin-bottom: 4px;
}

.readme-subtitle {
  font-size: 14px;
  color: var(--vsc-type);
  margin-bottom: 16px;
}

.readme-summary {
  line-height: 1.7;
  max-width: 72ch;
  margin-bottom: 16px;
}

.readme-links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.readme-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--vsc-statusbar-bg);
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.readme-link:hover { opacity: 0.85; text-decoration: none; }

/* Section separator */
.editor-sep {
  border: none;
  border-top: 1px solid var(--vsc-border);
  margin: 16px 0;
}

/* Subsection heading */
.editor-subheading {
  font-size: 13px;
  color: var(--vsc-type);
  padding: 6px 0 4px;
  margin-top: 12px;
}

/* --- Status Bar ----------------------------------------- */
.statusbar {
  height: 22px;
  background: var(--vsc-statusbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

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

.statusbar a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}
.statusbar a:hover { opacity: 1; text-decoration: underline; }

/* --- Scrollbar Styling ---------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--vsc-scrollbar); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
::-webkit-scrollbar-corner { background: var(--vsc-bg); }

/* --- Responsive ----------------------------------------- */
@media (max-width: 768px) {
  .activitybar { display: none; }
  .sidebar { width: 0; border-right: none; }
  .sidebar.mobile-open { width: 260px; position: absolute; z-index: 100; height: calc(100vh - 52px); top: 30px; }
  .titlebar-text { font-size: 10px; }
  .editor-panel { padding-left: 48px; }
  .line::before { left: -40px; width: 28px; }
  .mobile-toggle {
    display: flex !important;
  }
}

.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 28px;
  left: 8px;
  z-index: 200;
  width: 36px; height: 36px;
  background: var(--vsc-statusbar-bg);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
