/**
 * css/views/sidebar.css
 * ---------------------
 * Collapsible left sidebar drawer styling inspired by Discord channels & ChatGPT chat history:
 * - Expandable (260px) and collapsed (68px) states with smooth cubic-bezier transitions
 * - "+ New Post Audit" action button
 * - Scrollable thread history list with platform icons, audit names, risk badges, and active highlights
 * - Bottom user/agent status badge
 */

.sidebar-drawer {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow: hidden;
}

.sidebar-drawer.collapsed {
  width: 68px;
  min-width: 68px;
}

/* Sidebar Top Section */
.sidebar-top {
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
}

.new-audit-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid var(--accent-emerald);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
}

.new-audit-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.3));
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.sidebar-drawer.collapsed .new-audit-btn {
  padding: 10px 0;
  width: 40px;
  flex: 0 0 40px;
}

.sidebar-drawer.collapsed .new-audit-btn .btn-text {
  display: none;
}

.collapse-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.collapse-toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-drawer.collapsed .collapse-toggle-btn {
  margin: 0 auto;
}

.sidebar-drawer.collapsed .collapse-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

/* Sidebar Section Title */
.sidebar-section-title {
  padding: 14px 18px 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-drawer.collapsed .sidebar-section-title {
  display: none;
}

.count-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

/* Thread History List */
.thread-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thread-history-list::-webkit-scrollbar {
  width: 4px;
}
.thread-history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}

.thread-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.06);
}

.thread-item.active {
  background: rgba(16, 185, 129, 0.12);
  color: #fff;
  border-color: rgba(16, 185, 129, 0.3);
}

.thread-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Thread metadata block (name + platform/time sub-line) */
.thread-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-drawer.collapsed .thread-meta {
  display: none;
}

.thread-name {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Risk grade badge on thread row */
.thread-risk-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid currentColor;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.sidebar-drawer.collapsed .thread-risk-badge {
  display: none;
}

.sidebar-drawer.collapsed .thread-item {
  justify-content: center;
  padding: 10px 0;
}

/* Sidebar Footer (Agent Vector Status) */
.sidebar-footer-profile {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.user-avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-drawer.collapsed .user-meta {
  display: none;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.user-role {
  font-size: 10px;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  white-space: nowrap;
}

