/* ═══════════════════════════════════════════════
   CLARIX — SIDEBAR CSS
═══════════════════════════════════════════════ */

/* Backdrop */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: all 0.3s var(--ease);
}
.sidebar-backdrop.open { opacity: 1; visibility: visible; }

/* Sidebar panel */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 300px; z-index: 260;
  background: #0a0a0a;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease-out);
  will-change: transform;
}
.sidebar.open { transform: translateX(0); }
/* On mobile: account for bottom nav bar height */
@media (max-width: 768px) {
  .sidebar { padding-bottom: 74px; }
}

/* Sidebar header */
.sidebar-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-logo {
  font-family: var(--font-head); font-size: 20px; font-weight: 900;
  color: var(--accent); display: flex; align-items: center; gap: 8px;
}
.sidebar-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: none; color: #666; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s;
}
.sidebar-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* User info */
.sidebar-user {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff9800);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 16px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 14px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user-lang { font-size: 11px; color: #555; margin-top: 2px; }
.sidebar-user-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  background: rgba(255,112,67,0.12); color: var(--accent);
  border: 1px solid rgba(255,112,67,0.25); font-weight: 700;
  flex-shrink: 0;
}

/* Nav links */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-nav {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sidebar-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: #666; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none; margin-bottom: 1px;
}
.sidebar-nav-link:hover { background: rgba(255,255,255,0.05); color: #ccc; }
.sidebar-nav-link.active { background: rgba(255,112,67,0.1); color: var(--accent); font-weight: 600; }
.sidebar-nav-link .snl-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-nav-link .snl-badge {
  margin-left: auto; font-size: 9px; font-weight: 700;
  background: rgba(255,112,67,0.2); color: var(--accent);
  padding: 2px 6px; border-radius: 20px;
}

/* Usage — now in footer */
.sidebar-usage {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
}
.sidebar-usage-label { font-size: 11px; color: #444; margin-bottom: 8px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.sidebar-usage-bar-track { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; margin-bottom: 6px; }
.sidebar-usage-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #ff9800);
  transition: width 0.6s var(--ease);
}
.sidebar-usage-text { font-size: 11px; color: #555; }
.sidebar-usage-text span { color: var(--accent); font-weight: 700; }

/* Recent prompts */
.sidebar-recent { flex: 1; overflow-y: auto; padding: 10px 12px; min-height: 60px; }
.sidebar-recent-title { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #333; margin-bottom: 6px; padding: 0 2px; }
.sb-recent-empty { font-size: 11px; color: #333; padding: 8px 4px; text-align: center; border: 1px dashed rgba(255,255,255,0.06); border-radius: 8px; }
.sidebar-recent-item {
  padding: 10px 10px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s; margin-bottom: 2px;
}
.sidebar-recent-item:hover { background: rgba(255,255,255,0.06); }
.sidebar-recent-text {
  font-size: 12px; color: #8a8a8a; line-height: 1.45;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.sidebar-recent-item:hover .sidebar-recent-text { color: #bbb; }
.sidebar-recent-meta { font-size: 10px; color: #555; margin-top: 4px; }
.sidebar-recent-empty { padding: 20px 10px; font-size: 12px; color: #444; text-align: center; }

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sidebar-upgrade-btn {
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, rgba(255,112,67,0.15), rgba(255,152,0,0.1));
  border: 1px solid rgba(255,112,67,0.3);
  border-radius: 12px; color: var(--accent); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 10px;
}
.sidebar-upgrade-btn:hover { background: linear-gradient(135deg, rgba(255,112,67,0.25), rgba(255,152,0,0.18)); }
.sidebar-footer-links { display: flex; gap: 16px; justify-content: center; margin-top: 8px; }
.sidebar-footer-link { font-size: 11px; color: #333; cursor: pointer; transition: color 0.15s; text-decoration: none; }
.sidebar-footer-link:hover { color: #666; }
.sidebar-logout-btn {
  width: 100%; padding: 9px;
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: #555; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
  margin-top: 8px;
}
.sidebar-logout-btn:hover { background: rgba(255,255,255,0.05); color: #888; border-color: rgba(255,255,255,0.15); }

/* Sidebar toggle button (hamburger) */
.sidebar-toggle-btn {
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 8px;
  display: flex; flex-direction: column; gap: 5px;
  transition: all 0.2s;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.07); }
.sidebar-toggle-btn span {
  display: block; width: 20px; height: 1.5px;
  background: #888; border-radius: 2px; transition: all 0.3s;
}
