/* ============================================
   Theme Switcher — Classic, IDE, CLI, MCP
   ============================================ */

/* --- Theme Switcher Controls --- */
.theme-switcher {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.theme-btn {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-btn:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.4);
}

.theme-btn.active {
  color: #fff;
  border-color: var(--color-accent, #D4A017);
  background: rgba(255,255,255,0.1);
}

/* ============================================
   LAYOUT — IDE chrome is JS-injected, hidden by default
   ============================================ */
.vscode-titlebar,
.vscode-activitybar,
.vscode-sidebar,
.vscode-editor-header,
.vscode-statusbar {
  display: none;
}

/* IDE mode: show chrome, restructure layout */
.theme-ide {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.theme-ide .vscode-titlebar { display: flex; }
.theme-ide .vscode-statusbar { display: flex; }

/* IDE hides normal header/footer */
.theme-ide .site-header,
.theme-ide .site-footer {
  display: none;
}

/* IDE main area: activity bar + sidebar + editor */
.theme-ide #site-content {
  flex: 1;
  overflow-y: auto;
  background: #1e1e1e;
}

/* Wrap activitybar + sidebar + content horizontally */
.theme-ide {
  display: grid;
  grid-template-rows: 30px 1fr 22px;
  grid-template-columns: 48px 240px 1fr;
  grid-template-areas:
    "titlebar titlebar titlebar"
    "activitybar sidebar editor"
    "statusbar statusbar statusbar";
}

.theme-ide .vscode-titlebar { grid-area: titlebar; display: flex; }
.theme-ide .vscode-activitybar { grid-area: activitybar; display: flex; }
.theme-ide .vscode-sidebar { grid-area: sidebar; display: block; }
.theme-ide .vscode-editor-header { display: block; }
.theme-ide #site-content { grid-area: editor; display: flex; flex-direction: column; }
.theme-ide .vscode-statusbar { grid-area: statusbar; display: flex; }

/* Dark theme LLM icon visibility — invert black SVGs to white */
.theme-ide .llm-icon img,
.theme-cli .llm-icon img,
.theme-mcp .llm-icon img {
  filter: invert(1);
}

/* ============================================
   CLASSIC THEME (default — no overrides)
   ============================================ */

/* ============================================
   IDE THEME — full VS Code
   ============================================ */
.theme-ide {
  --color-primary: #569cd6;
  --color-primary-dark: #4a8cc7;
  --color-secondary: #1e1e1e;
  --color-accent: #dcdcaa;
  --color-bg: #1e1e1e;
  --color-surface: #252526;
  --color-text: #d4d4d4;
  --color-text-light: #808080;
  --color-teal: #4ec9b0;
  --font-heading: 'JetBrains Mono', monospace;
  --font-body: 'JetBrains Mono', monospace;
  --radius: 0px;
  overflow: hidden;
}

/* VS Code titlebar */
.theme-ide .vscode-titlebar {
  display: flex;
  align-items: center;
  background: #323233;
  height: 30px;
  padding: 0 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #999;
  -webkit-app-region: drag;
}

.theme-ide .vscode-titlebar-controls {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}

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

.vscode-dot-close { background: #ff5f56; }
.vscode-dot-min { background: #ffbd2e; }
.vscode-dot-max { background: #27c93f; }

.vscode-titlebar-title {
  flex: 1;
  text-align: center;
}

.vscode-titlebar-spacer {
  width: 60px;
}

/* VS Code main area — sidebar + editor */
.theme-ide .vscode-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Activity bar */
.theme-ide .vscode-activitybar {
  width: 48px;
  background: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  flex-shrink: 0;
}

.vscode-activity-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #858585;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.vscode-activity-icon:hover {
  color: #d4d4d4;
}

.vscode-activity-icon.active {
  color: #d4d4d4;
  border-left-color: #d4d4d4;
}

/* Sidebar / Explorer */
.theme-ide .vscode-sidebar {
  width: 240px;
  background: #252526;
  border-right: 1px solid #1e1e1e;
  flex-shrink: 0;
  overflow-y: auto;
}

.vscode-sidebar-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #bbb;
  padding: 10px 20px 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vscode-sidebar-section {
  padding: 0;
}

.vscode-sidebar-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #ccc;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.vscode-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #ccc;
  padding: 3px 10px 3px 28px;
  cursor: pointer;
  white-space: nowrap;
}

.vscode-file:hover {
  background: #2a2d2e;
}

.vscode-file.active {
  background: #37373d;
}

.vscode-file-icon {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  margin-right: 6px;
  width: 16px;
  display: inline-block;
  text-align: center;
  color: #519aba;
}

.vscode-file-icon[data-ext="yaml"] { color: #cb171e; }
.vscode-file-icon[data-ext="toml"] { color: #9c4221; }
.vscode-file-icon[data-ext="tldr"] { color: #a78bfa; }

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

/* Tab bar */
.theme-ide .vscode-tabs {
  display: flex;
  background: #252526;
  height: 35px;
  align-items: stretch;
  border-bottom: 1px solid #1e1e1e;
}

.vscode-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #969696;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-right: 1px solid #1e1e1e;
  white-space: nowrap;
}

.vscode-tab:hover {
  background: #2d2d2d;
}

.vscode-tab.active {
  background: #1e1e1e;
  color: #d4d4d4;
  border-bottom: 1px solid #1e1e1e;
}

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

.vscode-tab-close {
  font-size: 16px;
  color: transparent;
  margin-left: 4px;
}

.vscode-tab:hover .vscode-tab-close,
.vscode-tab.active .vscode-tab-close {
  color: #969696;
}

/* Breadcrumb */
.theme-ide .vscode-breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #969696;
  padding: 4px 16px;
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
}

.vscode-breadcrumb span {
  color: #ccc;
}

/* Editor content — the actual page content rendered inside editor */
.theme-ide .vscode-editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #1e1e1e;
  counter-reset: line-number;
}

/* Content styling inside the editor */
.theme-ide .hero {
  text-align: left;
  padding: 1.5rem 2rem;
  background: #1e1e1e;
  border-bottom: none;
}

.theme-ide .hero h1 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #d4d4d4;
}

.theme-ide .hero h1::before {
  content: "# ";
  color: #569cd6;
}

.theme-ide .tagline {
  color: #6a9955;
  font-size: 0.9rem;
}

.theme-ide .tagline::before {
  content: "<!-- ";
  color: #6a9955;
}

.theme-ide .tagline::after {
  content: " -->";
  color: #6a9955;
}

.theme-ide .services-preview {
  padding: 1rem 2rem 2rem;
  background: #1e1e1e;
}

.theme-ide .services-preview h2 {
  text-align: left;
  color: #dcdcaa;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.theme-ide .services-preview h2::before {
  content: "## ";
  color: #569cd6;
}

.theme-ide .services-preview h2::after {
  content: "";
}

.theme-ide .card-grid {
  grid-template-columns: 1fr;
  gap: 2px;
}

.theme-ide .card {
  border: none;
  background: transparent;
  border-left: 3px solid #333;
  border-radius: 0;
  padding: 0.5rem 1rem;
  box-shadow: none;
}

.theme-ide .card:hover {
  border-left-color: #569cd6;
  background: #252526;
}

.theme-ide .card-icon {
  display: none;
}

.theme-ide .card h3 {
  color: #4ec9b0;
  font-size: 0.9rem;
  font-weight: 400;
}

.theme-ide .card h3::before {
  content: "### ";
  color: #569cd6;
  font-weight: 400;
}

.theme-ide .card p {
  color: #808080;
  font-size: 0.8rem;
}

/* Move theme switcher into the vscode tab bar area */
.theme-ide .site-header {
  display: none;
}

/* Status bar — always visible in ide-layout */
.theme-ide .vscode-statusbar {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  background: #007acc;
  height: 22px;
  padding: 0 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #fff;
}

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

.vscode-statusbar-item {
  padding: 0 6px;
  cursor: pointer;
  height: 22px;
  display: flex;
  align-items: center;
}

.vscode-statusbar-item:hover {
  background: rgba(255,255,255,0.12);
}

.vscode-statusbar-branch {
  background: rgba(255,255,255,0.08);
}

/* Theme switcher in IDE titlebar */
.theme-switcher-ide .theme-btn {
  border: none;
  border-radius: 0;
  font-size: 11px;
  padding: 0 8px;
  color: #999;
  height: 30px;
}

.theme-switcher-ide .theme-btn.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border: none;
}

.theme-switcher-ide .theme-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

/* ============================================
   CLI THEME — Terminal
   ============================================ */
.theme-cli {
  --color-primary: #00ff41;
  --color-primary-dark: #00cc33;
  --color-secondary: #0a0a0a;
  --color-accent: #ffb800;
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-text: #00ff41;
  --color-text-light: #00aa2a;
  --color-teal: #00cccc;
  --font-heading: 'JetBrains Mono', monospace;
  --font-body: 'JetBrains Mono', monospace;
  --radius: 0px;
}

.theme-cli .site-header {
  border-bottom: 1px solid #00ff41;
}

.theme-cli .hero {
  text-align: left;
  padding: 3rem 0 4rem;
}

.theme-cli .hero h1 {
  font-size: 1.8rem;
  font-weight: 400;
}

.theme-cli .hero h1::before {
  content: "$ whoami\n> ";
  white-space: pre;
  color: #00aa2a;
  font-size: 0.9rem;
}

.theme-cli .tagline {
  color: #00aa2a;
}

.theme-cli .tagline::before {
  content: "$ echo $MISSION\n> ";
  white-space: pre;
  color: #555;
  font-size: 0.85rem;
}

.theme-cli .services-preview {
  border-top: 1px solid #1a1a1a;
}

.theme-cli .services-preview h2 {
  text-align: left;
  color: #ffb800;
  font-size: 1rem;
  font-weight: 400;
}

.theme-cli .services-preview h2::before {
  content: "$ ls services/\n";
  color: #555;
  white-space: pre;
}

.theme-cli .card-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.theme-cli .card {
  background: transparent;
  border: none;
  border-bottom: 1px solid #1a1a1a;
  border-radius: 0;
  padding: 1rem 0;
  box-shadow: none;
}

.theme-cli .card-icon { display: none; }

.theme-cli .card h3 {
  color: #00ff41;
  font-weight: 400;
  font-size: 0.95rem;
}

.theme-cli .card h3::before {
  content: "drwxr-xr-x  ";
  color: #555;
}

.theme-cli .card p {
  color: #00aa2a;
  font-size: 0.85rem;
  padding-left: 2rem;
}

.theme-cli .card p::before {
  content: "# ";
  color: #555;
}

.theme-cli .site-footer {
  border-top: 1px solid #00ff41;
  background: #0a0a0a;
  color: #00aa2a;
}

.theme-cli .social-link { color: #00aa2a; }
.theme-cli .social-link:hover { color: #00ff41; }
.theme-cli .theme-btn.active { border-color: #00ff41; }

.theme-cli .hero h1::after {
  content: "█";
  animation: blink 1s step-end infinite;
  color: #00ff41;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   MCP THEME — Structured data view
   ============================================ */
.theme-mcp {
  --color-primary: #a78bfa;
  --color-primary-dark: #8b5cf6;
  --color-secondary: #18181b;
  --color-accent: #fbbf24;
  --color-bg: #18181b;
  --color-surface: #27272a;
  --color-text: #e4e4e7;
  --color-text-light: #a1a1aa;
  --color-teal: #2dd4bf;
  --font-heading: 'JetBrains Mono', monospace;
  --font-body: 'JetBrains Mono', monospace;
  --radius: 4px;
}

.theme-mcp .hero {
  text-align: left;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid #27272a;
}

.theme-mcp .hero h1 {
  font-size: 1rem;
  font-weight: 400;
  color: #a1a1aa;
}

.theme-mcp .hero h1::before {
  content: "entity: ";
  color: #a78bfa;
}

.theme-mcp .tagline {
  font-size: 0.9rem;
  color: #a1a1aa;
}

.theme-mcp .tagline::before {
  content: "tagline: ";
  color: #a78bfa;
}

.theme-mcp .services-preview h2 {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 400;
  color: #a78bfa;
  margin-bottom: 1rem;
}

.theme-mcp .services-preview h2::before {
  content: "type: ";
  color: #a1a1aa;
}

.theme-mcp .card-grid {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.theme-mcp .card {
  background: #27272a;
  border: 1px solid #3f3f46;
  padding: 1rem 1.25rem;
}

.theme-mcp .card-icon { display: none; }

.theme-mcp .card h3 {
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 400;
}

.theme-mcp .card h3::before {
  content: "- name: ";
  color: #a78bfa;
}

.theme-mcp .card p {
  color: #a1a1aa;
  font-size: 0.8rem;
  padding-left: 1rem;
}

.theme-mcp .card p::before {
  content: "  desc: ";
  color: #71717a;
}

.theme-mcp .site-footer {
  border-top: 1px solid #3f3f46;
  background: #18181b;
}

.theme-mcp .theme-btn.active {
  border-color: #a78bfa;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .theme-ide .vscode-activitybar,
  .theme-ide .vscode-sidebar {
    display: none;
  }
}
