/* ============================================================
   Circuitry OS — Sidebar Pro v3.0
   Aesthetic: Dark industrial OS — sharp, dense, precise
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Syne:wght@500;600;700;800&display=swap');

/* ── RESET / TOKENS ── */
:root {
  --cq-bg:        #0d0d0f;
  --cq-surface:   #13131a;
  --cq-border:    rgba(255,255,255,0.07);
  --cq-text:      #c8c8d4;
  --cq-text-dim:  #5a5a72;
  --cq-accent:    #e8ff47;        /* electric yellow-green */
  --cq-accent2:   #47b4ff;        /* sky blue for AI */
  --cq-vendor:    #ff9047;        /* orange for vendor */
  --cq-w:         240px;
  --cq-radius:    10px;
  --cq-font:      'Syne', sans-serif;
  --cq-mono:      'IBM Plex Mono', monospace;
  --cq-transition: 220ms cubic-bezier(0.4,0,0.2,1);
}

/* ── SHELL ── */
.cq-shell {
  position: fixed;
  top: 0; left: 0;
  z-index: 9000;
  pointer-events: none; /* children re-enable */
}

/* ── SIDEBAR ── */
.cq-sidebar {
  pointer-events: all;
  position: fixed;
  top: 0; left: 0;
  width: var(--cq-w);
  height: 100vh;
  background: var(--cq-bg);
  border-right: 1px solid var(--cq-border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  z-index: 9010;
  box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  transition: transform var(--cq-transition);
}

/* nudge main content right — add to body via JS or theme */
body.has-cq-sidebar {
  padding-left: var(--cq-w);
}

/* ── LOGO ── */
.cq-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--cq-border);
  font-family: var(--cq-font);
  font-size: 15px;
  color: var(--cq-text);
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.cq-logo-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 6px var(--cq-accent));
}
.cq-logo-text { font-weight: 500; }
.cq-logo-text strong { color: var(--cq-accent); font-weight: 800; }

/* ── SEARCH ── */
.cq-search {
  position: relative;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cq-border);
  flex-shrink: 0;
}
.cq-search input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--cq-border);
  border-radius: 6px;
  color: var(--cq-text);
  font-family: var(--cq-mono);
  font-size: 12px;
  padding: 7px 30px 7px 10px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--cq-transition), background var(--cq-transition);
}
.cq-search input::placeholder { color: var(--cq-text-dim); }
.cq-search input:focus {
  border-color: rgba(232,255,71,0.4);
  background: rgba(255,255,255,0.08);
}
.cq-search-icon {
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%);
  color: var(--cq-text-dim);
  font-size: 16px;
  pointer-events: none;
}

/* ── NAV ── */
.cq-nav {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--cq-border) transparent;
}
.cq-nav::-webkit-scrollbar { width: 3px; }
.cq-nav::-webkit-scrollbar-thumb { background: var(--cq-border); border-radius: 2px; }

/* ── NAV ITEMS ── */
.cq-item,
.cq-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 20px;
  font-family: var(--cq-font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cq-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--cq-transition), background var(--cq-transition), padding-left var(--cq-transition);
  position: relative;
  box-sizing: border-box;
  text-align: left;
}

.cq-item:hover,
.cq-group-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
  padding-left: 24px;
}

.cq-item.active {
  color: var(--cq-accent);
  background: rgba(232,255,71,0.07);
}
.cq-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--cq-accent);
  border-radius: 0 2px 2px 0;
}

/* AI item special treatment */
.cq-item.cq-ai {
  color: var(--cq-accent2);
  background: rgba(71,180,255,0.06);
}
.cq-item.cq-ai:hover {
  background: rgba(71,180,255,0.12);
  color: #fff;
}

/* ── ICONS ── */
.cq-icon {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.8;
  width: 18px;
  text-align: center;
}

/* ── BADGE ── */
.cq-badge {
  margin-left: auto;
  font-size: 9px;
  font-family: var(--cq-mono);
  font-weight: 500;
  background: var(--cq-accent2);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── CHEVRON ── */
.cq-chevron {
  margin-left: auto;
  font-size: 16px;
  color: var(--cq-text-dim);
  transition: transform var(--cq-transition);
  line-height: 1;
}
.cq-group-toggle[aria-expanded="true"] .cq-chevron {
  transform: rotate(90deg);
}

/* ── SUBMENU ── */
.cq-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms cubic-bezier(0.4,0,0.2,1);
}
.cq-submenu.open {
  max-height: 600px;
}

.cq-sub {
  display: block;
  padding: 7px 20px 7px 48px;
  font-family: var(--cq-font);
  font-size: 12.5px;
  color: var(--cq-text-dim);
  text-decoration: none;
  transition: color var(--cq-transition), padding-left var(--cq-transition);
}
.cq-sub:hover { color: var(--cq-text); padding-left: 52px; }
.cq-sub.active { color: var(--cq-accent); }

/* nested submenu extra indent */
.cq-nested .cq-sub { padding-left: 64px; }
.cq-nested .cq-sub:hover { padding-left: 68px; }
.cq-nested .cq-group-toggle { padding-left: 48px; font-size: 12.5px; }

/* ── DIVIDER ── */
.cq-divider {
  padding: 16px 20px 6px;
}
.cq-divider span {
  font-family: var(--cq-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cq-text-dim);
}

/* ── BOTTOM ACTIONS ── */
.cq-bottom {
  flex-shrink: 0;
  border-top: 1px solid var(--cq-border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cq-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--cq-accent);
  color: #000;
  font-family: var(--cq-font);
  font-weight: 700;
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: 7px;
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: opacity var(--cq-transition), transform var(--cq-transition);
}
.cq-action-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.cq-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--cq-border);
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color var(--cq-transition);
}
.cq-avatar:hover { border-color: rgba(255,255,255,0.25); }
.cq-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cq-avatar-icon { font-size: 16px; color: var(--cq-text-dim); }

/* ── MOBILE TOGGLE BUTTON ── */
.cq-mobile-btn {
  display: none;
  pointer-events: all;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 9020;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}
.cq-mobile-btn span {
  display: block;
  width: 20px; height: 2px;
  background: var(--cq-text);
  border-radius: 2px;
  transition: transform var(--cq-transition), opacity var(--cq-transition);
}
.cq-mobile-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cq-mobile-btn.open span:nth-child(2) { opacity: 0; }
.cq-mobile-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── OVERLAY ── */
.cq-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  z-index: 9005;
  transition: opacity var(--cq-transition);
  backdrop-filter: blur(2px);
}
.cq-overlay.visible {
  pointer-events: all;
  opacity: 1;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  .cq-sidebar {
    transform: translateX(calc(-1 * var(--cq-w)));
  }
  .cq-sidebar.open {
    transform: translateX(0);
  }
  .cq-mobile-btn { display: flex; }
  body.has-cq-sidebar { padding-left: 0; }
}

/* ════════════════════════════════════════════════
   DOKAN DASHBOARD SIDEBAR OVERRIDE
   ════════════════════════════════════════════════ */

.cq-dokan-sidebar {
  width: 220px;
  background: var(--cq-bg);
  border-right: 1px solid var(--cq-border);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  font-family: var(--cq-font);
}

.cq-store-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--cq-border);
}
.cq-store-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cq-vendor);
}
.cq-store-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.cq-store-info a {
  font-size: 11px;
  color: var(--cq-accent2);
  text-decoration: none;
  font-family: var(--cq-mono);
}

.cq-dokan-nav {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  flex: 1;
}

.cq-dokan-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-family: var(--cq-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--cq-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: color var(--cq-transition), background var(--cq-transition);
}
.cq-dokan-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.cq-dokan-link.active {
  color: var(--cq-vendor);
  background: rgba(255,144,71,0.08);
}

.cq-dokan-footer {
  border-top: 1px solid var(--cq-border);
  padding: 14px 16px;
}
.cq-back-link {
  font-size: 12px;
  font-family: var(--cq-mono);
  color: var(--cq-text-dim);
  text-decoration: none;
}
.cq-back-link:hover { color: var(--cq-text); }

/* ════════════════════════════════════════════════
   HOME SHORTCODE
   ════════════════════════════════════════════════ */

.cq-home {
  padding: 60px 40px 40px;
  font-family: var(--cq-font);
  color: var(--cq-text);
  max-width: 900px;
}

.cq-hero {
  margin-bottom: 48px;
}
.cq-eyebrow {
  font-family: var(--cq-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cq-text-dim);
  margin: 0 0 8px;
}
.cq-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  color: #fff;
  line-height: 1.05;
  margin: 0 0 14px;
  letter-spacing: -1.5px;
}
.cq-hero h1 span { color: var(--cq-accent); }
.cq-tagline {
  font-size: 16px;
  color: var(--cq-text-dim);
  margin: 0 0 28px;
}

.cq-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cq-accent);
  color: #000;
  font-family: var(--cq-font);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 200ms, transform 200ms;
}
.cq-hero-btn:hover { opacity: 0.85; transform: translateY(-2px); }

.cq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.cq-card {
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  text-decoration: none;
  transition: border-color 200ms, transform 200ms, background 200ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cq-card:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  transform: translateY(-3px);
}
.cq-card-icon { font-size: 28px; filter: drop-shadow(0 0 8px var(--cq-accent)); }
.cq-card-label { font-family: var(--cq-font); font-size: 13px; font-weight: 600; color: var(--cq-text); }
