/* /css/style.css v7 - CubiFlow unified theme (dashboard + forms + account + pricing)
   - Primary: #111, bg #f4f5f6, accent #ff5c00, font B612 Mono
   - Ensures sidebar sticky, nav-sub constrained, images cropped, forms styled.
*/
@import url('https://fonts.googleapis.com/css2?family=B612+Mono:wght@400;700&display=swap');

:root{
  --bg: #f4f5f6;
  --panel: #ffffff;
  --text: #111;
  --muted: #6b7280;
  --accent: #ff5c00;
  --radius: 12px;
  --card-shadow: 0 10px 30px rgba(17,17,17,0.06);
  --sidebar-w: 260px;
  --gutter: 28px;
  --brand-font: 'B612 Mono', monospace;
}

/* === Reset & base === */
* { box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; background:var(--bg); color:var(--text); font-family:var(--brand-font); -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; text-transform: capitalize; }
a { color:var(--accent); text-decoration:none; }
button,input,textarea,select { font-family:var(--brand-font); }

/* === Layout root === */
.app { display:grid; grid-template-columns: var(--sidebar-w) 1fr; min-height:100vh; gap:0; }

/* === SIDEBAR === */
.sidebar{
  background:var(--panel);
  padding:24px 18px;
  border-right:1px solid rgba(0,0,0,0.04);
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;             /* allow scrolling if nav long */
  -webkit-overflow-scrolling:touch;
}
.brand .logo { font-size:20px; font-weight:800; display:block; }
.brand small{ font-size:12px; color:var(--muted); display:block; margin-top:6px; }

.nav { margin-top:22px; }
.nav-section { margin-bottom:16px; }
.nav-link { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; border-radius:8px; cursor:pointer; font-weight:700; color:var(--text); }
.nav-link:hover { background: rgba(0,0,0,0.03); }
.badge { background:#f3f4f6; padding:4px 8px; border-radius:12px; font-size:12px; color:var(--muted); }

/* NAV-SUB: constrained and scrollable, NOT full-width */
.nav-sub {
  display:none;                 /* hidden by default */
  margin-top:8px;
  padding-left:6px;
  flex-direction:column;
  gap:6px;
  max-height: 52vh;            /* limit height */
  overflow:auto;
  border-left: 2px solid rgba(0,0,0,0.02);
  padding-left:10px;
}
.nav-sub.open { display:flex; }

/* nav item */
.nav-item {
  padding:8px 10px;
  border-radius:8px;
  color:var(--muted);
  font-weight:600;
  font-size:13px;
  cursor:pointer;
  white-space:nowrap;
}
.nav-item:hover { background: rgba(0,0,0,0.03); color:var(--text); }

/* auth link bottom */
.nav-auth { display:inline-block; margin-top:18px; color:var(--accent); font-weight:700; }

/* === MAIN / TOPBAR === */
.main { padding:24px 32px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.plan-pill { background: rgba(255,92,0,0.08); color:var(--accent); padding:7px 12px; border-radius:10px; font-weight:700; font-size:13px; }
.search-bar { display:flex; align-items:center; gap:10px; background:var(--panel); padding:8px 10px; border-radius:10px; border:1px solid rgba(0,0,0,0.03); }

/* === CONTENT grid === */
.content { display:grid; grid-template-columns: 1fr 360px; gap:28px; align-items:start; }

/* left list */
.controls { display:flex; gap:12px; align-items:center; margin-bottom:14px; }
.controls .search input, .search-bar input { padding:10px 12px; border-radius:10px; border:1px solid rgba(0,0,0,0.06); width:100%; }

/* === CARDS GRID === */
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap:22px; }

/* card base */
.tool-card, .component {
  background:var(--panel);
  border-radius:14px;
  padding:14px;
  box-shadow:var(--card-shadow);
  transition:transform .16s ease, box-shadow .16s ease;
  overflow:hidden;
}
.tool-card:hover, .component:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,0.06); }

/* tool card */
.tool-card .title { font-weight:700; font-size:15px; margin-bottom:6px; display:flex; justify-content:space-between; align-items:center; }
.tool-card .desc { color:var(--muted); font-size:13px; margin-bottom:10px; }

/* thumbnail handling: crop, not overflow */
.component img, .component .thumb {
  width:100%;
  height:180px;
  object-fit:cover;
  border-radius:10px;
  display:block;
  background:#f6f7fa;
}

/* component meta area */
.component .meta { padding-top:10px; }
.component .title { font-weight:700; margin-bottom:6px; }
.component .desc { color:var(--muted); font-size:13px; margin-bottom:10px; }

/* ensure no raw pre/code shown */
#components-list pre, #components-list code, #tools-list pre, #tools-list code { display:none !important; }

/* JSON placeholder button area */
.json-placeholder { background:#fbfbfc; padding:8px; border-radius:8px; color:var(--muted); font-size:13px; }

/* === INSPECTOR (right panel) === */
.inspector {
  background:var(--panel);
  border-radius:12px;
  padding:18px;
  box-shadow:var(--card-shadow);
  position:sticky;
  top:24px;
  height: calc(100vh - 48px);
  overflow:auto;
}

/* === FORMS (signin/signup/reset/account) === */
.container { max-width:1100px; margin:18px auto; padding:0 16px; }
.form-card { max-width:540px; margin:18px auto; background:var(--panel); padding:22px; border-radius:12px; box-shadow:var(--card-shadow); }
label { display:block; margin:10px 0 6px; font-weight:700; font-size:13px; color:var(--text); }
input[type="email"], input[type="password"], input[type="text"], textarea {
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid rgba(0,0,0,0.06); background:#fff; color:var(--text);
}
.button { display:inline-block; background:var(--accent); color:#fff; padding:10px 14px; border-radius:10px; border:0; font-weight:700; cursor:pointer; }

/* small text */
.small { font-size:13px; color:var(--muted); }
.muted { color:var(--muted); }

/* === RESPONSIVE === */
@media (max-width:1100px) {
  .content { grid-template-columns: 1fr; }
  .app { grid-template-columns: 200px 1fr; }
}
@media (max-width:900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position:relative; height:auto; border-right:none; }
  .inspector { position:relative; height:auto; top:auto; }
}