/* Job Hunt — Phase 1 inventory shell (app-specific layout) */
/* Theme tokens: ../assets/vendors/ofni/ofni-theme-default.css (ADK canonical) */

:root {
  --jh-accounts-width: 220px;
  --jh-detail-width: 320px;
  --jh-splitter: 6px;

  /* Aliases for app CSS written before ADK token rename */
  --org-active: var(--surface-active);
  --repo-private: var(--tile-private);
  --repo-public: var(--tile-public);
  --repo-private-active: var(--tile-private-active);
  --repo-public-active: var(--tile-public-active);
  --repo-hover-border: var(--hover-border);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}

ofni-job-hunt, ofni-github { display: block; }
ofni-job-hunt { height: 100%; }

.jh {
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100%;
  min-height: 100vh;
}

.jh-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.jh-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.jh-mark {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 12px;
}
.jh-brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.jh-ver { color: var(--muted); font-size: 12px; }
.jh-status { margin: 0; color: var(--muted); flex: 1; min-width: 160px; }
.jh-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  align-items: center;
}

button, .jh-import, select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
button:hover, .jh-import:hover, select:hover { border-color: var(--accent); }
.jh-theme-toggle {
  min-width: 2.5rem;
  font-size: 16px;
  line-height: 1;
}
.jh-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  margin-top: 8px;
}
html[data-theme="dark"] .jh-primary { color: #041018; }
.jh-import { display: inline-flex; align-items: center; }

.jh-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.jh-toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
}
.jh-toolbar label { color: var(--muted); display: flex; gap: 6px; align-items: center; }
.jh-toolbar select { min-width: 160px; }
.jh-filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.jh-body {
  display: grid;
  grid-template-columns:
    var(--jh-accounts-width)
    var(--jh-splitter)
    minmax(0, 1fr)
    var(--jh-splitter)
    var(--jh-detail-width);
  min-height: 0;
  height: 100%;
}

.jh-orgs, .jh-repos, .jh-detail {
  overflow: auto;
  min-height: 0;
}
.jh-orgs, .jh-detail {
  background: var(--bg-2);
  padding: 12px;
}
.jh-repos { padding: 12px 16px; }

.jh-split {
  width: var(--jh-splitter);
  background: var(--line);
  cursor: col-resize;
  position: relative;
  touch-action: none;
  user-select: none;
}
.jh-split:hover,
.jh-split.is-dragging {
  background: var(--accent);
}
.jh-split::after {
  content: "";
  position: absolute;
  inset: 0 -4px;
}

.jh-orgs h2, .jh-repos-head h2, .jh-detail h2, .jh-detail h3, .jh-detail h4 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.jh-detail h2 { font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--text); }
.jh-detail h3 { margin-top: 18px; }

.jh-org {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  gap: 2px;
}
.jh-org.is-active { border-color: var(--accent); background: var(--org-active); }
.jh-org--all {
  border-style: dashed;
  margin-bottom: 10px;
}
.jh-org-name { font-weight: 600; }
.jh-org-meta { color: var(--muted); font-size: 12px; }

.jh-count {
  display: inline-block;
  background: var(--bg-3);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--muted);
  font-size: 11px;
}

.jh-repo-list { list-style: none; margin: 0; padding: 0; }
.jh-repo {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
}
.jh-repo--private { background: var(--repo-private); }
.jh-repo--public { background: var(--repo-public); }
.jh-repo:hover { border-color: var(--repo-hover-border); }
.jh-repo--private.is-active {
  border-color: var(--accent);
  background: var(--repo-private-active);
}
.jh-repo--public.is-active {
  border-color: var(--accent);
  background: var(--repo-public-active);
}

.jh-repo-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.jh-repo-desc {
  margin: 6px 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jh-repo-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.jh-repo-owner { color: var(--accent); }

.jh-flags { display: flex; gap: 4px; flex-wrap: wrap; }
.jh-flag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  color: var(--muted);
}
.jh-flag--private { color: #6b4ea3; }
.jh-flag--public { color: #b33a3a; }
html[data-theme="dark"] .jh-flag--private { color: #c4b0e8; }
html[data-theme="dark"] .jh-flag--public { color: #f0a0a0; }
.jh-flag--empty { color: var(--danger); }
.jh-flag--archived { color: #7a6a9a; }
.jh-flag--fork { color: var(--accent); }

.jh-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.jh-chip {
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.jh-chip--analysis { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.jh-chip--user { border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line)); color: var(--chip-user); }
.jh-chip--filter { border-color: var(--accent); color: var(--accent); }

.jh-tag-group { margin-bottom: 10px; }
.jh-tag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  background: var(--bg-3);
}
.jh-tag-toggle:has(input:checked) {
  border-color: var(--accent-2);
  background: var(--tag-checked-bg);
}

.jh-dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 10px;
  margin: 12px 0;
}
.jh-dl dt { color: var(--muted); }
.jh-dl dd { margin: 0; word-break: break-word; }

.jh-detail textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px;
  font: inherit;
  resize: vertical;
}
.jh-muted { color: var(--muted); }
.jh-detail a { color: var(--accent); }

.jh-filter-toggle {
  font-weight: 600;
  color: var(--text);
}

.jh-modal {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  max-width: min(920px, 96vw);
  width: 920px;
  max-height: 90vh;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}
.jh-modal::backdrop {
  background: rgba(15, 20, 25, 0.45);
}
.jh-modal__form {
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: 90vh;
}
.jh-modal__head,
.jh-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.jh-modal__foot {
  border-bottom: none;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}
.jh-modal__head h2 {
  margin: 0;
  font-size: 16px;
}
.jh-modal__body {
  overflow: auto;
  padding: 16px;
}
.jh-modal__section { margin-bottom: 20px; }
.jh-modal__section h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.jh-modal__defaults,
.jh-modal__group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 10px;
}
.jh-modal__group-row strong {
  min-width: 90px;
  text-transform: capitalize;
}
.jh-modal__tags {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.jh-modal__tag {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.jh-modal__tag-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.jh-modal__tag label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.jh-modal__full { grid-column: 1 / -1; }
.jh-modal__tag input[type="text"],
.jh-modal__tag select {
  width: 100%;
}
.jh-modal__tag input[type="color"] {
  width: 48px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.jh-chip {
  border: 1px solid transparent;
}

@media (max-width: 960px) {
  .jh-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(240px, 40vh) auto minmax(280px, 1fr);
  }
  .jh-split { display: none; }
  .jh-orgs, .jh-detail {
    width: auto !important;
    border: none;
    border-bottom: 1px solid var(--line);
  }
}
