/* ─── Android Studio / Darcula Theme ───────────────────── */

body {
  background: #1e1e1e;
  color: #a9b7c6;
  font-family: 'JetBrains Mono', monospace;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Title Bar ─────────────────────────────────────────── */
.as-titlebar {
  height: 38px;
  background: #2b2b2b;
  border-bottom: 1px solid #3c3f41;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.as-titlebar-left  { display: flex; align-items: center; gap: 12px; }
.as-titlebar-right { display: flex; align-items: center; gap: 8px; color: #8d9095; font-size: 14px; }

/* Traffic lights */
.traffic-lights { display: flex; gap: 6px; }
.tl {
  width: 12px; height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.2s;
}
.tl:hover { opacity: 0.75; }
.tl-close { background: #ff5f57; }
.tl-min   { background: #febc2e; }
.tl-max   { background: #28c840; }

.as-project-badge {
  background: linear-gradient(135deg, #7b5ea7, #4a90d9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.as-project-name   { font-size: 11px; color: #ccc; }
.as-project-branch { font-size: 11px; color: #8d9095; }

/* Center toolbar */
.as-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #8d9095;
}

.as-device-chip {
  background: #3c3f41;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.as-run-btn {
  background: #499c54;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 24px; height: 22px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.as-run-btn:hover { background: #5aaf65; }

.as-debug-btn { cursor: pointer; font-size: 14px; }
.as-icon { cursor: pointer; }

/* ─── IDE Layout ────────────────────────────────────────── */
.as-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.as-sidebar {
  width: 280px;
  background: #2b2b2b;
  border-right: 1px solid #3c3f41;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.as-sidebar-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #8d9095;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #3c3f41;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.as-file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.as-file-tree::-webkit-scrollbar { width: 4px; }
.as-file-tree::-webkit-scrollbar-thumb { background: #4a4a4a; border-radius: 2px; }

/* Tree items */
.tree-item, .file-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: #a9b7c6;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 2px;
  margin: 0 4px;
  transition: background 0.15s;
}

.tree-item:hover, .file-item:hover { background: rgba(255, 255, 255, 0.06); }
.file-item.active { background: rgba(107, 189, 107, 0.15); color: #fff; }

.tree-arrow { font-size: 8px; color: #555; min-width: 10px; }
.folder-icon { font-size: 13px; }

/* Indentation levels */
.indent-1 { padding-left: 16px; }
.indent-2 { padding-left: 28px; }
.indent-3 { padding-left: 40px; }
.indent-4 { padding-left: 52px; }
.indent-5 { padding-left: 64px; }
.indent-6 { padding-left: 76px; }

/* Project root badge (small, in tree) */
.project-badge-sm {
  background: linear-gradient(135deg, #7b5ea7, #4a90d9);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 14px; height: 14px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tree-path { color: #4a4a4a; font-size: 10px; }
.tree-dim  { color: #4a4a4a; }

/* Kotlin badge */
.kt-badge {
  background: #6897bb;
  color: #1e1e1e;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
  min-width: 16px;
  text-align: center;
}

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

/* Tabs */
.as-tabs {
  height: 34px;
  display: flex;
  background: #2b2b2b;
  border-bottom: 1px solid #3c3f41;
  overflow-x: auto;
  flex-shrink: 0;
}
.as-tabs::-webkit-scrollbar { height: 3px; }
.as-tabs::-webkit-scrollbar-thumb { background: #4a4a4a; }

.as-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 12px;
  color: #8d9095;
  cursor: pointer;
  border-right: 1px solid #3c3f41;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.as-tab:hover { background: rgba(255, 255, 255, 0.04); color: #bbb; }
.as-tab.active { background: #1e1e1e; color: #fff; border-top: 2px solid #6bbd6b; }

.kt-badge-sm {
  background: #6897bb;
  color: #1e1e1e;
  font-size: 7px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
}

.tab-close { font-size: 10px; color: #444; margin-left: 2px; }
.tab-close:hover { color: #fff; }

/* Breadcrumb */
.as-breadcrumb {
  height: 24px;
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 4px;
  font-size: 11px;
  color: #555;
  flex-shrink: 0;
}
.bc { cursor: pointer; color: inherit; text-decoration: none; }
.bc:hover { color: #a9b7c6; }
.bc.active { color: #a9b7c6; }
.bc-home { color: #555; }
.bc-home:hover { color: #a9b7c6; }
.bc-sep { color: #3a3a3a; }

/* Code panels */
.code-panels { flex: 1; position: relative; overflow: hidden; min-height: 0; }

.code-panel {
  display: none;
  height: 100%;
  flex-direction: column;
}
.code-panel.active { display: flex; }

.code-scroll {
  flex: 1;
  display: flex;
  overflow: auto;
  min-height: 0;
}
.code-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.code-scroll::-webkit-scrollbar-track { background: #1e1e1e; }
.code-scroll::-webkit-scrollbar-thumb { background: #4a4a4a; border-radius: 4px; }

/* Line numbers */
.line-numbers {
  background: #1e1e1e;
  color: #555;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px 12px 16px 16px;
  text-align: right;
  user-select: none;
  flex-shrink: 0;
  min-width: 48px;
  border-right: 1px solid #2d2d2d;
}

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

.code {
  font-size: 13px;
  line-height: 1.6;
  color: #a9b7c6;
  white-space: pre;
  tab-size: 4;
}

/* ─── Syntax colours — Darcula palette ──────────────────── */
.kw  { color: #cc7832; font-weight: 600; }   /* keyword  */
.cls { color: #ffc66d; }                      /* class    */
.fn  { color: #ffc66d; }                      /* function */
.str { color: #6a8759; }                      /* string   */
.cmt { color: #629755; font-style: italic; }  /* comment  */
.ann { color: #bbb529; }                      /* annotation */
.pkg { color: #9876aa; }                      /* package  */
.op  { color: #a9b7c6; }                      /* operator */
.num { color: #6897bb; }                      /* number   */

/* ─── Run terminal ──────────────────────────────────────── */
.as-terminal {
  height: 200px;
  background: #1e1e1e;
  border-top: 1px solid #3c3f41;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.as-terminal.hidden { display: none; }

.terminal-bar {
  height: 30px;
  background: #2b2b2b;
  border-bottom: 1px solid #3c3f41;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  font-size: 11px;
  color: #8d9095;
}
.terminal-tab-active {
  background: #1e1e1e;
  color: #fff;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
}
.terminal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 12px;
}
.terminal-close:hover { color: #fff; }

.terminal-body {
  flex: 1;
  padding: 8px 14px;
  font-size: 12px;
  color: #6bbd6b;
  overflow-y: auto;
  line-height: 1.6;
}

/* ─── Right gutter ──────────────────────────────────────── */
.as-gutter {
  width: 32px;
  background: #2b2b2b;
  border-left: 1px solid #3c3f41;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 12px;
  flex-shrink: 0;
}

.gutter-icon {
  font-size: 14px;
  cursor: pointer;
  color: #555;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}
.gutter-icon:hover  { color: #a9b7c6; background: rgba(255, 255, 255, 0.05); }
.gutter-icon.active { color: #4d9c5f; }
.gutter-icon.back   { margin-top: auto; color: #cc7832; }

/* ─── Status bar ────────────────────────────────────────── */
.as-statusbar {
  height: 22px;
  background: #3c3f41;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  color: #8d9095;
  flex-shrink: 0;
}

.status-left, .status-right { display: flex; align-items: center; gap: 8px; }
.status-git { color: #9876aa; }
.status-sep { color: #555; }

/* ─── Git popup ─────────────────────────────────────────── */
.git-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  background: #2b2b2b;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  z-index: 200;
}
.git-popup.hidden { display: none; }

.git-popup-bar {
  background: #3c3f41;
  padding: 8px 14px;
  font-size: 12px;
  color: #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 6px 6px 0 0;
}
.git-popup-bar button {
  background: none; border: none;
  color: #888; cursor: pointer; font-size: 13px;
}
.git-popup-bar button:hover { color: #fff; }

.git-popup-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }

.git-commit {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 12px; padding: 4px 6px; border-radius: 3px;
  cursor: default;
}
.git-commit:hover { background: rgba(255, 255, 255, 0.04); }
.git-hash { color: #6897bb; min-width: 62px; }
.git-msg  { color: #a9b7c6; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .as-sidebar { width: 180px; }
  .code { font-size: 11px; }
}
@media (max-width: 600px) {
  .as-sidebar { display: none; }
}
