/* ============================================================
   HopeBridge Career Core Tools — premium shell
   Matches Career Path Finder + Moshe CV Builder
   ============================================================ */

:root {
  --page: radial-gradient(900px 620px at 8% -5%, rgba(31,122,110,.38), transparent 60%),
          radial-gradient(860px 640px at 100% 105%, rgba(92,104,220,.26), transparent 60%), #060b1a;
  --shell: rgba(14,22,45,.86);
  --card: #111a33;
  --surface: #17223f;
  --surface2: #1e2b4e;
  --inset: #0b1226;
  --line: rgba(255,255,255,.07);
  --line2: rgba(255,255,255,.13);
  --tx: #eaf0fa;
  --mut: #8c98b3;
  --teal: #1F7A6E;
  --teal2: #4fd1b8;
  --teal-soft: rgba(79,209,184,.12);
  --gold: #d9bf6a;
  --gold2: #e6ca65;
  --ink: #1F7A6E;
  --ink-h: #25897b;
  --danger: #ef6b6b;
  --warn: #f59e0b;
  --ok: #34d399;
  --shadow: 0 30px 80px -30px rgba(0,0,0,.8);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.3,.7,.3,1);
  --rail-w: 72px;
  --panel-w: 280px;
}

[data-theme="light"] {
  --page: radial-gradient(900px 620px at 0% 0%, #c9efe6, transparent 60%),
          radial-gradient(900px 640px at 100% 100%, #d8d5f8, transparent 60%), #e6edf8;
  --shell: rgba(244,247,252,.82);
  --card: #fff;
  --surface: #f3f6fb;
  --surface2: #e8edf6;
  --inset: #eef2f8;
  --line: rgba(15,26,51,.08);
  --line2: rgba(15,26,51,.15);
  --tx: #0f1a33;
  --mut: #667391;
  --teal2: #12806f;
  --teal-soft: rgba(31,122,110,.1);
  --gold: #a8860f;
  --gold2: #b8960f;
  --ink: #0f1a33;
  --ink-h: #1b2a4d;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 30px 80px -40px rgba(40,50,110,.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.tools-app {
  font: 15px/1.65 var(--font);
  color: var(--tx);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- Top bar ---------- */
.tools-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--shell);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.tools-top .back {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--mut);
  transition: .15s;
}
.tools-top .back:hover { background: var(--surface); color: var(--tx); }
.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--teal-soft);
  color: var(--teal2);
  display: grid; place-items: center;
  flex: none;
}
.brand-icon svg { width: 18px; height: 18px; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.2; }
.brand .sub { margin: 0; font-size: 12px; color: var(--mut); }
.tools-status {
  font-size: 12.5px; font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--surface);
  color: var(--mut);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tools-status.is-active {
  background: var(--teal-soft);
  color: var(--teal2);
  box-shadow: inset 0 0 0 1.5px var(--teal2);
}
.theme-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: var(--mut);
  background: none; border: 0; cursor: pointer;
  transition: .15s;
}
.theme-btn:hover { background: var(--surface); color: var(--tx); }
.theme-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="light"] .ic-moon { display: none; }
[data-theme="dark"] .ic-sun, :root:not([data-theme]) .ic-sun { display: none; }
[data-theme="light"] .ic-sun { display: block; }

/* ---------- Shell layout ---------- */
.tools-shell {
  display: grid;
  grid-template-columns: var(--rail-w) 0 minmax(0, 1fr);
  height: calc(100vh - 65px);
  height: calc(100dvh - 65px);
  transition: grid-template-columns .3s var(--ease);
}
.tools-shell.is-expanded {
  grid-template-columns: var(--rail-w) var(--panel-w) minmax(0, 1fr);
}

/* ---------- Rail (icons only — never double) ---------- */
.tools-rail {
  background: var(--shell);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 20;
}
.tools-rail::-webkit-scrollbar { display: none; }

.rail-toggle {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: none; border: 0;
  color: var(--mut);
  cursor: pointer;
  margin-bottom: 8px;
  transition: .15s;
}
.rail-toggle:hover { background: var(--surface); color: var(--tx); }
.rail-toggle svg { width: 20px; height: 20px; }

.rail-group-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 10px 0 4px;
  opacity: .7;
}

.rail-item {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: none; border: 0;
  color: var(--mut);
  cursor: pointer;
  position: relative;
  transition: .15s;
  flex: none;
}
.rail-item svg {
  width: 20px; height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.rail-item:hover { background: var(--surface); color: var(--tx); }
.rail-item.is-active {
  background: var(--teal-soft);
  color: var(--teal2);
  box-shadow: inset 0 0 0 1.5px var(--teal2);
}
.rail-item.is-locked { opacity: .55; }
.rail-item.is-soon { opacity: .4; }

/* Tooltip on hover (rail only) */
.rail-item[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  color: var(--tx);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 30;
}
.tools-shell:not(.is-expanded) .rail-item:hover::after { opacity: 1; }

/* ---------- Panel (names + icons) ---------- */
.tools-panel {
  background: var(--shell);
  border-right: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.panel-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 800; }
.panel-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--mut); }

.panel-section { padding: 12px 10px 6px; }
.panel-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 10px 8px;
}

.panel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 13px;
  background: none; border: 0;
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  transition: .15s;
  margin-bottom: 2px;
}
.panel-item:hover { background: var(--card); }
.panel-item.is-active {
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1.5px var(--teal2);
}
.panel-item .ico {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--surface);
  display: grid; place-items: center;
  flex: none;
  color: var(--teal2);
}
.panel-item .ico svg { width: 18px; height: 18px; }
.panel-item .meta { flex: 1; min-width: 0; }
.panel-item .meta strong { display: block; font-size: 13.5px; font-weight: 800; line-height: 1.25; }
.panel-item .meta span { font-size: 12px; color: var(--mut); }
.panel-item .tag {
  font-size: 10.5px; font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  flex: none;
}
.tag-free { background: var(--teal-soft); color: var(--teal2); }
.tag-paid { background: rgba(217,191,106,.15); color: var(--gold2); }
.tag-soon { background: var(--surface); color: var(--mut); }

/* ---------- Main workspace ---------- */
.tools-main {
  overflow-y: auto;
  padding: 28px 32px 48px;
  scrollbar-width: thin;
}

/* Welcome */
.tools-welcome { max-width: 720px; margin: 0 auto; }
.tools-welcome h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.5vw, 34px);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.tools-welcome .lead {
  color: var(--mut);
  font-size: 16px;
  margin: 0 0 28px;
  max-width: 54ch;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--tx);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: .2s;
}
.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1.5px var(--teal2);
}
.quick-card .ico {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--teal-soft);
  color: var(--teal2);
  display: grid; place-items: center;
  flex: none;
}
.quick-card .ico svg { width: 20px; height: 20px; }
.quick-card strong { display: block; font-size: 14.5px; font-weight: 800; }
.quick-card span span { font-size: 12.5px; color: var(--mut); }

/* Detail view */
.tools-detail { max-width: 640px; }
.detail-hero {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.big-ico {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--teal-soft);
  color: var(--teal2);
  display: grid; place-items: center;
  flex: none;
}
.big-ico.paid { background: rgba(217,191,106,.15); color: var(--gold2); }
.big-ico svg { width: 32px; height: 32px; }
.detail-badge {
  display: inline-block;
  font-size: 11.5px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}
.detail-badge.free { background: var(--teal-soft); color: var(--teal2); }
.detail-badge.paid { background: rgba(217,191,106,.15); color: var(--gold2); }
.detail-badge.soon { background: var(--surface); color: var(--mut); }
.tools-detail h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 30px);
  margin: 0 0 8px;
  letter-spacing: -.015em;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.feature-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.feature-list .tick {
  color: var(--teal2);
  font-weight: 800;
  flex: none;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 99px;
  font: inherit; font-weight: 800; font-size: 14px;
  border: 0; cursor: pointer;
  transition: transform .15s, background .2s;
  text-decoration: none;
  color: inherit;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold { background: var(--ink); color: #fff; }
.btn-gold:hover:not(:disabled) { background: var(--ink-h); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover:not(:disabled) { background: #25897b; }
.btn-outline {
  background: var(--card);
  color: var(--tx);
  box-shadow: inset 0 0 0 1px var(--line2);
}
.btn-outline:hover:not(:disabled) { background: var(--surface2); }

/* Pass card inside modal */
.hb-pass {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px;
  margin: 12px 16px 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.hb-pass-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.hb-pass-badge {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--teal-soft);
  display: grid; place-items: center;
  font-size: 18px;
  flex: none;
}
.hb-pass-title { margin: 0; font-size: 17px; font-weight: 800; }
.hb-pass-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--mut); }
.hb-pass-price { margin-bottom: 14px; }
.hb-pass-amount { font-size: 28px; font-weight: 800; color: var(--gold2); }
.hb-pass-terms { font-size: 13.5px; color: var(--mut); margin-left: 8px; }
.hb-pass-list { list-style: none; padding: 0; margin: 0 0 18px; }
.hb-pass-list li {
  display: flex; gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}
.hb-pass-list .tick { color: var(--teal2); font-weight: 800; flex: none; }
.hb-pass-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.hb-pass-fine { font-size: 12.5px; color: var(--mut); margin: 0; line-height: 1.5; }
.hb-unlock-row {
  display: flex; gap: 8px;
  margin: 12px 16px 16px;
}
.hb-unlock-row input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 12px;
  border: 0;
  background: var(--card);
  color: var(--tx);
  box-shadow: inset 0 0 0 1px var(--line2);
  font: inherit;
}

/* Modal */
.tools-modal {
  position: fixed; inset: 0;
  background: rgba(6,11,26,.72);
  z-index: 80;
  display: grid; place-items: center;
  padding: 16px;
}
.tools-modal[hidden] { display: none; }
.tools-modal-sheet {
  background: var(--card);
  border-radius: 22px;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.tools-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: #0b1430;
  color: #fff;
}
.tools-modal-head p { margin: 0; font-weight: 800; }
.tools-modal-body { overflow-y: auto; }

/* Toast */
.tools-toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  z-index: 99;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.6);
  max-width: calc(100vw - 32px);
}

/* Responsive */
@media (max-width: 900px) {
  .tools-shell {
    grid-template-columns: var(--rail-w) 0 minmax(0, 1fr);
  }
  .tools-shell.is-expanded {
    grid-template-columns: var(--rail-w) min(280px, 72vw) minmax(0, 1fr);
  }
  .tools-main { padding: 20px 16px 40px; }
  .detail-hero { flex-direction: column; gap: 14px; }
}
@media (max-width: 600px) {
  .tools-shell.is-expanded {
    grid-template-columns: var(--rail-w) 0 minmax(0, 1fr);
  }
  .tools-panel {
    position: fixed;
    left: var(--rail-w);
    top: 65px;
    bottom: 0;
    width: min(300px, 80vw);
    z-index: 40;
    transform: translateX(-110%);
    transition: transform .3s var(--ease);
    box-shadow: var(--shadow);
  }
  .tools-shell.is-expanded .tools-panel {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}