﻿/*
 * Main sidebar, navigation, and account/footer styles.
 * Extracted from the base layout chunk; later sidebar overrides remain in legacy.css for cascade compatibility.
 */

/* =========================
   SIDEBAR
========================= */

#sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #0c0e12;
  border-right: 1px solid #1f2937;
  overflow: hidden;
  min-height: 0;
}

.sidebar-controls {
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}

.sidebar-controls select {
  width: 100%;
  padding: 5px 7px;
  background: #161a22;
  color: #e2e8f0;
  border: 1px solid #2a2f3a;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 0;
}

.sidebar-controls select:focus {
  outline: none;
  border-color: #3b82f6;
}

#sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 4px;
  overflow: hidden;
  gap: 1px;
}

.sidebar-workspace-actions {
  padding: 6px 6px 8px;
  margin-bottom: 2px;
}

.sidebar-workspace-actions .workspace-switcher {
  width: 100%;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.sidebar-workspace-actions .workspace-switcher button {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.sidebar-primary-action {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(231, 199, 143, 0.22);
  background: rgba(151, 103, 34, 0.28);
  color: #ffe2ad;
  font-weight: 800;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
}

.sidebar-primary-action:hover {
  background: rgba(151, 103, 34, 0.38);
  color: #fff7eb;
}

.chat-session-list-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 6px 10px;
  overflow: hidden;
}

.chat-session-list-wrap.hidden {
  display: none;
}

.chat-session-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.chat-session-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.chat-session-row.active {
  border-color: rgba(231, 199, 143, 0.22);
  background: linear-gradient(180deg, rgba(231, 199, 143, 0.15), rgba(151, 103, 34, 0.11));
  box-shadow: inset 3px 0 0 rgba(223, 184, 109, 0.82);
}

.chat-session-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 7px 8px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #d8cbb8;
  text-align: left;
  cursor: pointer;
}

.chat-session-open:hover {
  background: rgba(67, 57, 47, 0.58);
  color: #fff7eb;
}

.chat-session-title {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.chat-session-empty {
  color: #8d806f;
  font-size: 11px;
  line-height: 1.45;
  padding: 10px 9px;
}

.chat-session-delete {
  flex: 0 0 28px;
  align-self: center;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #8d806f;
  cursor: pointer;
  opacity: 0.72;
}

.chat-session-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding-right: 3px;
}

.chat-session-icon {
  flex: 0 0 28px;
  align-self: center;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #8d806f;
  cursor: pointer;
  opacity: 0.66;
  padding: 0;
}

.chat-session-row.active .chat-session-icon,
.chat-session-row:hover .chat-session-icon {
  opacity: 1;
}

.chat-session-icon:hover {
  border-color: rgba(231, 199, 143, 0.18);
  color: #f7d28d;
  background: rgba(67, 57, 47, 0.42);
}

.chat-session-save {
  color: #cfe6b2;
}

.chat-session-confirm-delete {
  align-self: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(239, 68, 68, 0.34);
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.chat-session-confirm-delete:hover {
  background: rgba(127, 29, 29, 0.42);
}

.chat-session-rename-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 5px 0 5px 6px;
  padding: 6px 8px;
  border: 1px solid rgba(231, 199, 143, 0.34);
  border-radius: 10px;
  background: rgba(38, 31, 26, 0.95);
  color: #fff7eb;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.chat-session-row.renaming,
.chat-session-row.confirming-delete {
  border-color: rgba(231, 199, 143, 0.16);
  background: rgba(67, 57, 47, 0.32);
}

.chat-session-row.active .chat-session-delete,
.chat-session-row:hover .chat-session-delete {
  opacity: 1;
}

.chat-session-delete:hover {
  border-color: rgba(239, 68, 68, 0.32);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.22);
}

.nav-group {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
}

.nav-group + .nav-group {
  border-top: 1px solid #1a1f28;
  margin-top: 4px;
}

#sidebar-nav button {
  text-align: left;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  margin: 0;
  transition: background 0.1s, color 0.1s;
}

#sidebar-nav button:hover {
  background: #161a22;
  color: #e2e8f0;
}

#sidebar-nav button.active {
  background: #1e3a5f;
  color: #93c5fd;
  border-left: 2px solid #3b82f6;
  padding-left: 10px;
}

#sidebar-nav .chat-session-open {
  width: auto;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 7px 8px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #d8cbb8;
  font-size: inherit;
  text-align: left;
  overflow: hidden;
}

#sidebar-nav .chat-session-delete {
  width: auto;
  padding: 0;
  border-radius: 10px;
  color: #8d806f;
}

#sidebar-nav .chat-session-icon,
#sidebar-nav .chat-session-confirm-delete {
  width: auto;
}

#sidebar-nav .sidebar-primary-action {
  justify-content: flex-start;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(231, 199, 143, 0.22);
  background: rgba(151, 103, 34, 0.28);
  color: #ffe2ad;
  font-weight: 800;
  padding: 9px 12px;
}

#sidebar-nav .sidebar-primary-action:hover {
  background: rgba(151, 103, 34, 0.38);
  color: #fff7eb;
}

#sidebar-footer {
  padding: 10px;
  border-top: 1px solid #1f2937;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-utility-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-utility-nav button {
  display: flex;
  align-items: center;
  min-height: 38px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #cdbfad;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.sidebar-utility-nav button:hover {
  background: rgba(67, 57, 47, 0.78);
  color: #fff7eb;
}

#user-bar-email {
  display: block;
  font-size: 11px;
  color: #4b5563;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sidebar-support-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 24px;
  padding: 2px 4px;
  border-radius: 8px;
  color: #8d806f;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.14s ease, background 0.14s ease;
}

.sidebar-support-link:hover,
.sidebar-support-link:focus-visible {
  background: rgba(67, 57, 47, 0.38);
  color: #d8cbb8;
  outline: none;
}

