/* =========================================================
   NIGHT OWL DESIGN TOKENS
   ========================================================= */
:root {
  --bg: #011627;
  --bg-alt: #010e1a;
  --bg-elevated: #0e293f;
  --bg-hover: #112b42;
  --border: #122d42;

  --fg: #d6deeb;
  --dim: #637777;

  --purple: #c792ea;
  --blue: #82aaff;
  --yellow: #ffcb8b;
  --orange: #f78c6c;
  --green: #addb67;
  --string: #ecc48d;
  --cyan: #7fdbca;
  --red: #ef5350;

  --radius: 6px;
  --font-mono: 'Fira Code', ui-monospace, 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: #000d18;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-feature-settings: "calt" 1, "liga" 1;
  font-feature-settings: "calt" 1, "liga" 1;
  font-variant-ligatures: contextual;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

::selection { background: #1d3b53; color: #fff; }

/* Scrollbars, Night Owl style */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1d3b53; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c5773; }

a { color: inherit; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* =========================================================
   WINDOW FRAME
   ========================================================= */
.vscode {
  width: min(1180px, 100%);
  height: min(760px, 92vh);
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Titlebar */
.titlebar {
  height: 38px;
  flex: 0 0 auto;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.titlebar-dots { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-red { background: #ef5350; }
.dot-yellow { background: #ffcb8b; }
.dot-green { background: #addb67; }
.titlebar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--dim);
  font-size: 12.5px;
  letter-spacing: .2px;
}
.sidebar-toggle {
  display: none;
  margin-left: auto;
  color: var(--fg);
  padding: 4px;
}

/* =========================================================
   WORKBENCH LAYOUT
   ========================================================= */
.workbench {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* Activity bar */
.activitybar {
  width: 48px;
  flex: 0 0 auto;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 14px;
  gap: 18px;
}
.activity-icon {
  color: #4b6479;
  display: flex;
  padding: 4px;
  border-left: 2px solid transparent;
}
.activity-icon.active {
  color: var(--fg);
  border-left: 2px solid var(--cyan);
}

/* Sidebar */
.sidebar {
  width: 250px;
  flex: 0 0 auto;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-header {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--dim);
  padding: 14px 16px 8px;
  text-transform: uppercase;
}
.explorer-root {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 8px;
}
.folder-name {
  font-size: 12.5px;
  color: var(--fg);
  font-weight: 600;
  padding: 4px 16px;
  letter-spacing: .3px;
}
.file-tree { list-style: none; margin: 2px 0 0; padding: 0; }
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 28px;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  border-left: 2px solid transparent;
  white-space: nowrap;
}
.file-item:hover { background: var(--bg-hover); }
.file-item.active {
  background: #0d2438;
  border-left: 2px solid var(--cyan);
  color: #fff;
}
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  flex: 0 0 auto;
}
.icon-md { color: var(--blue); }
.icon-yaml { color: var(--purple); }
.icon-js { color: var(--yellow); font-size: 9px; }
.icon-json { color: var(--yellow); font-size: 10px; }
.icon-env { color: var(--green); }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 16px 14px;
  font-size: 11.5px;
  color: var(--dim);
}
.footer-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.accent-branch { color: var(--green); }
.status-open { color: var(--green); }

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(173,219,103,.5);
  animation: pulse 2.4s infinite;
  flex: 0 0 auto;
}
.pulse-dot.small { width: 6px; height: 6px; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(173,219,103,.55); }
  70%  { box-shadow: 0 0 0 6px rgba(173,219,103,0); }
  100% { box-shadow: 0 0 0 0 rgba(173,219,103,0); }
}

/* =========================================================
   EDITOR
   ========================================================= */
.editor {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.tabs {
  display: flex;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex: 0 0 auto;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 12.8px;
  color: var(--dim);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  border-top: 2px solid transparent;
}
.tab.active {
  background: var(--bg);
  color: var(--fg);
  border-top: 2px solid var(--cyan);
}
.tab:hover:not(.active) { background: var(--bg-hover); color: var(--fg); }
.tab-close { color: var(--dim); margin-left: 2px; }

.breadcrumb {
  font-size: 11.5px;
  color: var(--dim);
  padding: 6px 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
#breadcrumbCurrent { color: var(--fg); }

.editor-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 0 40px;
  position: relative;
}

.pane { display: none; padding: 0 26px; }
.pane.active { display: block; animation: fadeIn .18s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Code block + fake line numbers */
pre.code {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  counter-reset: line;
}
pre.code .ln {
  display: inline-block;
  width: 2.1em;
  margin-right: 1.2em;
  color: #2c4457;
  text-align: right;
  user-select: none;
}
pre.code .ln::before {
  counter-increment: line;
  content: counter(line);
}

.tok-comment { color: var(--dim); font-style: italic; }
.tok-keyword { color: var(--purple); }
.tok-class   { color: var(--yellow); font-weight: 600; }
.tok-string  { color: var(--string); }
.tok-green   { color: var(--green); }
.tok-orange  { color: var(--orange); }
.tok-cyan    { color: var(--cyan); }
.tok-punct   { color: #7fa8bf; }
.tok-key     { color: var(--blue); }
.tok-func    { color: var(--blue); text-decoration: none; border-bottom: 1px dashed rgba(130,170,255,.4); }
.tok-func:hover { border-bottom-style: solid; }

/* =========================================================
   EXPERIÊNCIA — job cards
   ========================================================= */
.job-list { padding-left: 3.3em; margin-top: 4px; }
.job-card {
  position: relative;
  background: rgba(255,255,255,.015);
  border-left: 2px solid var(--border);
  border-radius: 0 4px 4px 0;
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.job-card:hover {
  border-left-color: var(--cyan);
  background: rgba(127,219,202,.04);
}
.job-card::before {
  content: "{";
  position: absolute;
  left: -1.6em;
  color: #2c4457;
}
.job-head { color: var(--fg); margin-bottom: 2px; }
.job-line { padding-left: 1.1em; color: var(--fg); }
.job-note { padding-left: 1.1em; margin-top: 4px; }
.stack-line { display: block; }
.chip {
  display: inline-block;
  background: #0e293f;
  border: 1px solid var(--border);
  color: var(--cyan);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 20px;
  margin: 3px 4px 0 0;
}

/* =========================================================
   CURSOS.JSON — foldable groups
   ========================================================= */
.json-groups { padding-left: 2.1em; }
.json-year {
  margin-bottom: 2px;
}
.json-year-head {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 6px 4px 4px;
  border-radius: 4px;
  color: var(--fg);
}
.json-year-head:hover { background: var(--bg-hover); }
.fold-caret {
  display: inline-flex;
  color: var(--dim);
  transition: transform .15s ease;
  flex: 0 0 auto;
}
.json-year.collapsed .fold-caret { transform: rotate(-90deg); }
.json-year-key { color: var(--blue); }
.json-year-count {
  color: var(--dim);
  font-size: 11.5px;
  margin-left: 4px;
}
.json-items {
  list-style: none;
  margin: 2px 0 10px 1.7em;
  padding: 0;
  border-left: 1px dashed var(--border);
}
.json-year.collapsed .json-items { display: none; }
.json-items li {
  padding: 2px 0 2px 14px;
  font-size: 13.3px;
  color: var(--fg);
}
.json-items .c-name { color: var(--string); }
.json-items .c-org { color: var(--yellow); }
.json-items .c-hours { color: var(--orange); }

.footer-line.status-open {
  align-items: flex-start;
}

.footer-line.status-open .pulse-dot {
  margin-top: 5px;
}

/* =========================================================
   STATUS BAR
   ========================================================= */
.statusbar {
  flex: 0 0 auto;
  height: 26px;
  background: #0e293f;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11.5px;
  color: #d6deeb;
}
.status-left, .status-right { display: flex; align-items: center; gap: 16px; }
.status-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-live { color: var(--green); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  body { padding: 0; align-items: stretch; }
  .vscode { width: 100%; height: 100vh; border-radius: 0; border: none; }
  .sidebar-toggle { display: inline-flex; }
  .activitybar { display: none; }
  .sidebar {
    position: absolute;
    top: 38px; bottom: 26px; left: 0;
    width: 230px;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .job-list { padding-left: 1.2em; }
  .json-groups { padding-left: .8em; }
  .pane { padding: 0 14px; }
  .status-item span:not(.pulse-dot) { display: inline; }
  .status-left .status-item:nth-child(2) { display: none; }
}

@media (max-width: 480px) {
  .titlebar-title { font-size: 11px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  pre.code { font-size: 12.5px; }
  .breadcrumb { font-size: 10.5px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
  .pane.active { animation: none; }
  * { transition: none !important; }
}