/* ═══════════════════════════════════════════════════════
   WADSIH AI LIFT-OFF — Shared Styles
   All pages link this file. Page-specific accent colours
   are controlled via --accent / --accent-s / --accent-g
   custom properties defined inline per page.
═══════════════════════════════════════════════════════ */

/* ── RESET & BASE ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  font-family: var(--font-sans, 'Space Grotesk', sans-serif);
  background: var(--space-bg, #04060d);
  color: var(--space-text, #e8ecf8);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── STAR FIELD CANVAS ─────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── GRID OVERLAY ──────────────────────────────────── */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── GLOW CURSOR ───────────────────────────────────── */
.glow-cursor {
  position: fixed;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(117,139,253,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.15s ease, opacity 0.3s;
  transform: translate(-50%, -50%);
}

/* ── FLOATING PARTICLES ────────────────────────────── */
.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float linear infinite;
}

/* ── SPLASH PAGE LAYOUT ────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── APP SHELL (sidebar layout) ────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 100vh;
}

/* ── TOP NAV (splash page) ─────────────────────────── */
.topnav {
  display: flex;
  align-items: center;
  padding: 20px 48px;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  animation: fadeDown 0.6s ease both;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo-mark {
  height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.nav-logo-mark img { height: 40px; }
.nav-title {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 14px; font-weight: 700;
  color: var(--space-text, #e8ecf8); letter-spacing: -0.3px;
}
.nav-pipe { width: 1px; height: 24px; background: rgba(255,255,255,0.15); margin: 0 4px; }
.nav-sub {
  font-size: 12px; color: rgba(255,255,255,0.6);
  font-family: var(--font-mono, 'Space Mono', monospace);
}
.nav-status {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 11px; color: rgba(255,255,255,0.6);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, #758BFD);
  box-shadow: 0 0 8px var(--accent, #758BFD);
  animation: pulse 2s ease infinite;
}

/* ── TOP BAR (app pages) ───────────────────────────── */
.topbar {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  background: rgba(7,9,15,.96);
  border-bottom: 1px solid var(--space-border, rgba(255,255,255,0.07));
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
  height:min-content;
}
/* Left: brand block — logo stacked above "AI LIFT-OFF" */
.tb-brand {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 12px 2px;
  border-right: 1px solid var(--space-border, rgba(255,255,255,0.07));
  flex-shrink: 0; text-decoration: none;
}
.tb-brand img { width: 120px; }
.tb-title {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 16px; font-weight: 700; letter-spacing: 0.15em;
  text-align: center; text-transform: uppercase; color: var(--primary);
  

}
/* Middle: page title (tool pages) */
.tb-page-title {
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  font-family: var(--font-sans, 'Space Grotesk', sans-serif);
  font-size: 24px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--space-text, #e8ecf8); text-transform: uppercase;
}
/* Middle: nav links (module pages) */
.tb-nav-links {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 0 16px;
}
.tb-nav-links a {
  font-size: 0.78rem; font-weight: 500; color: var(--space-text, #e8ecf8);
  text-decoration: none; padding: 4px 10px; border-radius: 6px; transition: all 0.15s;
}
.tb-nav-links a:hover, .tb-nav-links a.active { background: var(--space-faint, #1e2540); }
.tb-nav-links a.nav-home { color: var(--orange, #FE7900); }
/* Right: user info */
.tb-right {
  display: flex; flex-direction: row;
  align-items: center; justify-content: center;
  gap: 4px; padding: 0 20px; margin: auto; flex-shrink: 0;
}
.tb-name,
.tb-btn {
  padding: 2px 6px; align-items: center; justify-content: center;
  border-radius: 4px; height: 26px;
}
.tb-name {
  display: inline-flex;
  font-size: 14px; font-family: var(--font-mono, 'Space Mono', monospace);
  white-space: nowrap; font-weight: 700; letter-spacing: 0.04em; cursor: default;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
.tb-btn {
  color: var(--space-dim, #5a6480);
  background: var(--space-s2, #0c1020);
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  cursor: pointer; transition: all .18s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
button.tb-btn img { height: 18px; width: 18px; }
.tb-btn:hover { background: var(--space-faint, #1e2540); border-color: var(--space-border2, rgba(255,255,255,0.14)); }
/* Tool-bar variant: right section for pages with action buttons */
.topbar.tb-tools-bar .tb-right { flex-direction: row; align-items: center; gap: 8px; }
.tb-sep { width: 1px; height: 20px; background: var(--space-border, rgba(255,255,255,0.07)); flex-shrink: 0; }

/* ── SIDEBAR ───────────────────────────────────────── */
.sidebar {
  background: var(--space-s1, #07090f);
  border-right: 1px solid var(--space-border, rgba(255,255,255,0.07));
  padding: 18px 0;
  position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
}
.sb-label {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--space-dim, #1e2540); padding: 0 16px 6px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  cursor: pointer; border-left: 2px solid transparent;
  font-size: 13px; font-weight: 500;
  color: var(--space-dim, #5a6480); transition: all .15s;
}
.sb-item:hover { background: var(--space-s2, #0c1020); color: var(--space-text, #e8ecf8); }
.sb-item.active {
  background: var(--accent-s, rgba(117,139,253,0.08));
  border-left-color: var(--accent, #758BFD);
  color: var(--space-text, #e8ecf8);
}
.sb-item .ico { font-size: 15px; width: 18px; text-align: center; }
.sb-div { height: 1px; background: var(--space-border, rgba(255,255,255,0.07)); margin: 8px 16px; }

/* ── MAIN CONTENT ──────────────────────────────────── */
.main { padding: 32px 36px; overflow-y: auto; }
.view { display: none; animation: fadeUp .25s var(--ease, cubic-bezier(.4,0,.2,1)); }
.view.active { display: block; }

/* ── PAGE HEADER ───────────────────────────────────── */
.ph { margin-bottom: 28px; }
.ph-eye {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent, #758BFD); margin-bottom: 6px;
}
.ph-title {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 24px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 5px;
}
.ph-sub { font-size: 13px; color: var(--space-text, #5a6480); max-width: 520px; line-height: 1.6; }

/* ── SECTION ROW ───────────────────────────────────── */
.sec-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sec-t { font-family: var(--font-mono, 'Space Mono', monospace); font-size: 14px; font-weight: 700; }
.sec-ct { font-size: 12px; color: var(--space-dim, #5a6480); margin-left: 8px; }

/* ── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: none;
  font-family: var(--font-sans, 'Space Grotesk', sans-serif);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .18s; white-space: nowrap;
}
.btn-primary { background: var(--accent, #758BFD); color: #fff; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-ghost {
  background: var(--space-s2, #0c1020); color: var(--space-dim, #5a6480);
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
}
.btn-ghost:hover { color: var(--space-text, #e8ecf8); border-color: var(--space-border2, rgba(255,255,255,0.14)); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ── CLASS CARDS ───────────────────────────────────── */
.cls-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; margin-bottom: 36px; }
.cls-card {
  background: var(--space-s1, #07090f);
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  border-radius: 14px; padding: 20px; transition: all .2s;
  position: relative; overflow: hidden;
}
.cls-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--clr, var(--accent, #758BFD));
}
.cls-card:hover {
  border-color: var(--space-border2, rgba(255,255,255,0.14));
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.cc-name {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 14px; font-weight: 700; line-height: 1.3; flex: 1; padding-right: 10px;
}
.cc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; background: var(--clr, var(--accent, #758BFD)); }
.cc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cc-acts { display: flex; gap: 6px;  
  }
.cc-btn {
  flex: 1; padding: 10px 0; border-radius: 9px;
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  background: transparent; color: var(--space-dim, #5a6480);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
  font-family: var(--font-sans, 'Space Grotesk', sans-serif);
  display: flex; align-items: center; justify-content: center; gap: 5px;
 
}
.cc-btn:hover { background: var(--space-s2, #0c1020); color: var(--space-text, #e8ecf8); }
.cc-btn.launch {
  background: var(--accent-s, rgba(117,139,253,0.08));
  color: var(--accent, #758BFD);
  border-color: var(--accent-g, rgba(117,139,253,0.22));
}
.cc-btn.launch:hover { background: var(--accent, #758BFD); color: #fff; border-color: var(--accent, #758BFD); }

/* ── TAGS ──────────────────────────────────────────── */
.tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
  background: var(--space-s3, #121830);
  color: var(--space-dim, #5a6480);
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  font-family: var(--font-mono, 'Space Mono', monospace);
}
.tag.accent {
  color: var(--accent, #758BFD);
  background: var(--accent-s, rgba(117,139,253,0.08));
  border-color: var(--accent-g, rgba(117,139,253,0.22));
}

/* ── EMPTY STATE ───────────────────────────────────── */
.empty {
  grid-column: 1/-1;
  border: 1px dashed rgba(255,255,255,.07);
  border-radius: 14px; padding: 48px; text-align: center;
}
.empty-ico { font-size: 40px; margin-bottom: 12px; }
.empty-txt { font-size: 13px; color: var(--space-dim, #5a6480); margin-bottom: 18px; line-height: 1.6; }

/* ── FORM ELEMENTS ─────────────────────────────────── */
.f-label {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--space-dim, #5a6480); margin-bottom: 7px; display: block;
}
.f-group { margin-bottom: 18px; }
.f-input, .f-sel {
  width: 100%;
  background: var(--space-s2, #0c1020);
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  border-radius: 8px;
  color: var(--space-text, #e8ecf8);
  font-family: var(--font-sans, 'Space Grotesk', sans-serif);
  font-size: 14px; padding: 10px 14px; outline: none; transition: border-color .15s;
}
.f-input:focus, .f-sel:focus {
  border-color: var(--accent, #758BFD);
  box-shadow: 0 0 0 3px var(--accent-s, rgba(117,139,253,0.08));
}
.f-input::placeholder { color: var(--space-dim-placeholder, #1e2540); }
.f-sel option { background: var(--space-s2, #0c1020); }

/* ── INLINE SELECT (inp) ──────────────────────────── */
.inp {
  background: var(--space-s2, #0c1020);
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  border-radius: 8px;
  color: var(--space-text, #e8ecf8);
  font-family: var(--font-sans, 'Space Grotesk', sans-serif);
  font-size: 13px; padding: 8px 28px 8px 12px;
  outline: none; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6480' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.inp:hover { border-color: var(--space-border2, rgba(255,255,255,0.14)); }
.inp:focus {
  border-color: var(--accent, #758BFD);
  box-shadow: 0 0 0 3px var(--accent-s, rgba(117,139,253,0.08));
}
.inp option { background: var(--space-s2, #0c1020); color: var(--space-text, #e8ecf8); }
.inp-sm { padding: 6px 26px 6px 10px; font-size: 12px; border-radius: 7px; }

/* ── MODAL ─────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.78); backdrop-filter: blur(6px);
  z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; animation: fi .18s ease; }
.modal {
  background: var(--space-s1, #07090f);
  border: 1px solid var(--space-border2, rgba(255,255,255,0.14));
  border-radius: 18px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  animation: su .22s var(--ease, cubic-bezier(.4,0,.2,1));
}
.m-head { padding: 24px 28px 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.m-title { font-family: var(--font-mono, 'Space Mono', monospace); font-size: 18px; font-weight: 700; }
.m-close {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--space-border, rgba(255,255,255,0.07));
  background: var(--space-s2, #0c1020); color: var(--space-dim, #5a6480);
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.m-close:hover { color: var(--space-text, #e8ecf8); background: var(--space-s3, #121830); }
.m-body { padding: 0 28px 28px; }
.m-foot { display: flex; gap: 8px; padding-top: 18px; border-top: 1px solid var(--space-border, rgba(255,255,255,0.07)); margin-top: 6px; }

/* ── TOAST ─────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--space-s1, #07090f);
  border: 1px solid var(--accent-g, rgba(117,139,253,0.22));
  border-radius: 10px; padding: 11px 16px;
  font-size: 13px; color: var(--accent, #758BFD);
  z-index: 400;
  transform: translateY(6px); opacity: 0; transition: all .25s; pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.err { border-color: var(--danger-border); color: var(--danger); }

/* ── FOOTER ────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px 48px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 11px; color: rgba(255,255,255,0.45);
  animation: fadeUp 0.7s 0.6s ease both;
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.footer-sep { opacity: 0.3; }

/* ── ANIMATIONS ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes scan {
  0%   { top: -2px; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes float {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-20vh) rotate(720deg); opacity: 0; }
}
@keyframes fi { from { opacity: 0; } to { opacity: 1; } }
@keyframes su {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--space-s3, #121830); border-radius: 2px; }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 700px) {

  .topnav { padding: 16px 20px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px 16px; }
  .footer { flex-direction: column; gap: 6px; }
}
