NeonRyan
UI: sidebar redesign + chat header signout cleanup (#56)
00f7e20 unverified
Raw
History Blame Contribute Delete
16.6 kB
/* Sidebar.css */
.sidebar {
width: 300px;
height: 100vh;
background: var(--bg-primary, #ffffff);
border-right: 1px solid var(--border-light, #e5e7eb);
display: flex;
flex-direction: column;
position: fixed;
left: 0;
top: 0;
z-index: 100;
overflow: hidden;
transition: width 0.3s ease;
}
/* Collapsed state */
.sidebar.collapsed {
width: 70px;
}
/* Dark theme support */
.dark .sidebar {
background: var(--bg-primary-dark, #1f2937);
border-right-color: var(--border-dark, #374151);
}
/* Toggle Button - Matches User Menu Style */
.sidebar-toggle {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
padding: 0;
border: none;
background: none;
border-radius: 6px;
cursor: pointer;
color: var(--text-secondary, #6b7280);
transition: all 0.2s ease;
}
.sidebar-toggle:hover {
background: var(--bg-secondary, #f3f4f6);
color: var(--text-primary, #111827);
}
.dark .sidebar-toggle:hover {
background: var(--bg-secondary-dark, #374151);
color: var(--text-primary-dark, #f9fafb);
}
/* Toggle button as collapsed user avatar replacement */
.collapsed-toggle-avatar {
width: 40px;
height: 40px;
background: var(--primary-color, #3b82f6);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
flex-shrink: 0;
cursor: pointer;
transition: all 0.2s ease;
}
.collapsed-toggle-avatar:hover {
background: var(--primary-color-hover, #2563eb);
transform: scale(1.05);
}
/* Header Section */
.sidebar-header {
padding: 20px;
border-bottom: 1px solid var(--border-light, #e5e7eb);
flex-shrink: 0;
transition: all 0.3s ease;
}
.sidebar.collapsed .sidebar-header {
padding: 20px 10px;
}
.dark .sidebar-header {
border-bottom-color: var(--border-dark, #374151);
}
/* Collapsed Header */
.collapsed-header {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.collapsed-user-avatar {
width: 40px;
height: 40px;
background: var(--primary-color, #3b82f6);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
flex-shrink: 0;
}
.collapsed-new-chat {
width: 40px;
height: 40px;
background: var(--primary-color, #3b82f6);
color: white;
border: none;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.collapsed-new-chat:hover {
background: var(--primary-color-hover, #2563eb);
transform: scale(1.1);
}
.user-section {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.user-info {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
min-width: 0;
}
.user-avatar {
width: 36px;
height: 36px;
background: var(--primary-color, #3b82f6);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
flex-shrink: 0;
}
.user-details {
display: flex;
flex-direction: column;
min-width: 0;
}
.user-name {
font-weight: 600;
color: var(--text-primary, #111827);
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.dark .user-name {
color: var(--text-primary-dark, #f9fafb);
}
.user-email {
font-size: 12px;
color: var(--text-secondary, #6b7280);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.dark .user-email {
color: var(--text-secondary-dark, #9ca3af);
}
/* User Menu */
.user-menu-container {
position: relative;
}
.user-menu-button {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
padding: 0;
border: none;
background: none;
border-radius: 6px;
cursor: pointer;
color: var(--text-secondary, #6b7280);
transition: all 0.2s ease;
}
.user-menu-button:hover {
background: var(--bg-secondary, #f3f4f6);
color: var(--text-primary, #111827);
}
.dark .user-menu-button:hover {
background: var(--bg-secondary-dark, #374151);
color: var(--text-primary-dark, #f9fafb);
}
.user-menu {
position: absolute;
top: 100%;
right: 0;
background: var(--bg-primary, #ffffff);
border: 1px solid var(--border-light, #e5e7eb);
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
padding: 8px;
min-width: 150px;
z-index: 200;
}
.dark .user-menu {
background: var(--bg-primary-dark, #1f2937);
border-color: var(--border-dark, #374151);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.user-menu-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
width: 100%;
border: none;
background: none;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
color: var(--text-primary, #111827);
transition: background-color 0.2s ease;
}
.dark .user-menu-item {
color: var(--text-primary-dark, #f9fafb);
}
.user-menu-item:hover {
background: var(--bg-secondary, #f3f4f6);
}
.dark .user-menu-item:hover {
background: var(--bg-secondary-dark, #374151);
}
.user-menu-item.sign-out {
color: #ef4444;
}
.user-menu-item.sign-out:hover {
background: #fef2f2;
}
.dark .user-menu-item.sign-out:hover {
background: #7f1d1d;
}
/* New Chat Button */
.new-chat-button {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 12px 16px;
background: var(--primary-color, #3b82f6);
color: white;
border: none;
border-radius: 8px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.new-chat-button:hover {
background: var(--primary-color-hover, #2563eb);
transform: translateY(-1px);
}
/* Search Section */
.sidebar-search {
display: flex;
align-items: center;
gap: 8px;
padding: 16px 20px;
border-bottom: 1px solid var(--border-light, #e5e7eb);
flex-shrink: 0;
transition: all 0.3s ease;
}
.sidebar-search .search-container {
flex: 1;
}
.new-chat-icon-btn {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
flex-shrink: 0;
border: none;
border-radius: 8px;
background: #2663EB;
color: #fff;
cursor: pointer;
transition: background 0.15s ease, transform 0.15s ease;
}
.new-chat-icon-btn:hover {
background: #1d4fc4;
transform: translateY(-1px);
}
.new-chat-icon-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
.dark .sidebar-search {
border-bottom-color: var(--border-dark, #374151);
}
.search-container {
position: relative;
}
.search-icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--text-secondary, #6b7280);
}
.search-input {
width: 100%;
padding: 10px 12px 10px 36px;
border: 1px solid var(--border-light, #e5e7eb);
border-radius: 8px;
background: var(--bg-secondary, #f9fafb);
color: var(--text-primary, #111827);
font-size: 14px;
transition: all 0.2s ease;
}
.dark .search-input {
border-color: var(--border-dark, #374151);
background: var(--bg-secondary-dark, #374151);
color: var(--text-primary-dark, #f9fafb);
}
.search-input:focus {
outline: none;
border-color: var(--primary-color, #3b82f6);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-input::placeholder {
color: var(--text-secondary, #6b7280);
}
.dark .search-input::placeholder {
color: var(--text-secondary-dark, #9ca3af);
}
/* Chat Sessions */
.chat-sessions {
flex: 1;
overflow-y: auto;
padding: 0 20px 20px;
transition: padding 0.3s ease;
}
.sidebar.collapsed .chat-sessions {
padding: 0 10px 20px;
}
.loading-sessions {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
color: var(--text-secondary, #6b7280);
gap: 12px;
}
.sidebar.collapsed .loading-sessions {
padding: 40px 5px;
}
.dark .loading-sessions {
color: var(--text-secondary-dark, #9ca3af);
}
.loading-spinner {
width: 24px;
height: 24px;
border: 2px solid var(--border-light, #e5e7eb);
border-top: 2px solid var(--primary-color, #3b82f6);
border-radius: 50%;
animation: spin 1s linear infinite;
}
.dark .loading-spinner {
border-color: var(--border-dark, #374151);
border-top-color: var(--primary-color, #3b82f6);
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.no-sessions {
text-align: center;
padding: 40px 20px;
color: var(--text-secondary, #6b7280);
font-size: 14px;
}
.sidebar.collapsed .no-sessions {
padding: 40px 5px;
}
.dark .no-sessions {
color: var(--text-secondary-dark, #9ca3af);
}
.sessions-list {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 16px;
}
/* Session Item */
.session-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
border: 1px solid transparent;
group: true;
}
.session-item.collapsed {
justify-content: center;
padding: 12px 8px;
}
.session-item:hover {
background: var(--bg-secondary, #f3f4f6);
border-color: var(--border-light, #e5e7eb);
}
.dark .session-item:hover {
background: var(--bg-secondary-dark, #374151);
border-color: var(--border-dark, #4b5563);
}
.session-item.active {
background: rgba(59, 130, 246, 0.1);
border-color: var(--primary-color, #3b82f6);
}
.dark .session-item.active {
background: rgba(59, 130, 246, 0.2);
border-color: var(--primary-color, #3b82f6);
}
.session-content {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
min-width: 0;
}
.session-item.collapsed .session-content {
justify-content: center;
flex: none;
}
.session-icon {
color: var(--text-secondary, #6b7280);
flex-shrink: 0;
}
.dark .session-icon {
color: var(--text-secondary-dark, #9ca3af);
}
.session-item.active .session-icon {
color: var(--primary-color, #3b82f6);
}
.session-details {
flex: 1;
min-width: 0;
}
.session-title {
font-weight: 500;
color: var(--text-primary, #111827);
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 2px;
}
.dark .session-title {
color: var(--text-primary-dark, #f9fafb);
}
.session-meta {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
color: var(--text-secondary, #6b7280);
}
.dark .session-meta {
color: var(--text-secondary-dark, #9ca3af);
}
.session-date::after {
content: "•";
margin-left: 8px;
}
.new-chat-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.collapsed-new-chat:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.loading-sessions {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 16px;
color: var(--text-secondary);
font-size: 14px;
}
.loading-spinner {
width: 16px;
height: 16px;
border: 2px solid var(--border-color);
border-top: 2px solid var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Style for creating new chat state */
.new-chat-button span {
transition: all 0.2s ease;
}
.new-chat-button:disabled span {
opacity: 0.7;
}
/* Ensure active session remains highlighted during creation */
.session-item.active {
background-color: var(--primary-color);
color: white;
border-radius: 8px;
}
.session-menu-button {
opacity: 0;
padding: 6px;
border: none;
background: none;
border-radius: 4px;
cursor: pointer;
color: var(--text-secondary, #6b7280);
transition: all 0.2s ease;
flex-shrink: 0;
}
.session-item:hover .session-menu-button {
opacity: 1;
}
.session-menu-button:hover {
background: var(--bg-tertiary, #f3f4f6);
color: #ef4444;
}
.dark .session-menu-button:hover {
background: var(--bg-tertiary-dark, #4b5563);
}
/* Sidebar Footer */
.sidebar-footer {
flex-shrink: 0;
padding: 20px;
border-top: 1px solid var(--border-light, #e5e7eb);
background: var(--bg-primary, #ffffff);
}
.dark .sidebar-footer {
border-top-color: var(--border-dark, #374151);
background: var(--bg-primary-dark, #1f2937);
}
.sidebar-neon-link {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 8px;
color: var(--text-primary, #111827);
text-decoration: none;
font-size: 28px;
font-weight: bold;
transition: opacity 0.2s ease;
}
.sidebar-neon-link:hover {
opacity: 0.8;
}
.dark .sidebar-neon-link {
color: var(--text-primary-dark, #f9fafb);
}
.sidebar-neon-logo {
height: 1em;
width: auto;
flex-shrink: 0;
}
.sidebar-copyright-text {
margin: 8px 0 0 0;
font-size: 10px;
line-height: 1.4;
color: var(--text-secondary, #6b7280);
}
.dark .sidebar-copyright-text {
color: var(--text-secondary-dark, #9ca3af);
}
.sidebar-patents-link {
color: var(--text-secondary, #6b7280);
text-decoration: underline;
}
.dark .sidebar-patents-link {
color: var(--text-secondary-dark, #9ca3af);
}
.sidebar-footer.collapsed .sidebar-neon-link {
justify-content: center;
}
.sidebar-footer.collapsed .sidebar-neon-logo {
height: 28px;
}
/* Tooltip for collapsed state */
.session-item.collapsed {
position: relative;
}
.mobile-sidebar-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 150;
display: none;
}
.mobile-sidebar-overlay.visible {
display: block;
}
.session-item.collapsed:hover::after {
content: attr(title);
position: absolute;
left: 100%;
top: 50%;
transform: translateY(-50%);
background: var(--bg-primary, #ffffff);
border: 1px solid var(--border-light, #e5e7eb);
border-radius: 6px;
padding: 8px 12px;
margin-left: 8px;
white-space: nowrap;
font-size: 12px;
color: var(--text-primary, #111827);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
z-index: 1000;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
}
.dark .session-item.collapsed:hover::after {
background: var(--bg-primary-dark, #1f2937);
border-color: var(--border-dark, #374151);
color: var(--text-primary-dark, #f9fafb);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.sidebar-canvas-btn {
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
padding: 13px 20px;
background: linear-gradient(180deg, #7B7BF0 0%, #5957E8 100%);
border: 1px solid rgba(255, 255, 255, 0.14);
border-radius: 999px;
color: #ffffff;
cursor: pointer;
font-size: 14px;
font-weight: 700;
letter-spacing: -0.005em;
margin-top: 14px;
margin-bottom: 8px;
box-shadow:
0 0 32px -10px rgba(99, 102, 241, 0.45),
0 4px 14px -4px rgba(89, 87, 232, 0.45),
inset 0 1px 0 rgba(255, 255, 255, 0.18);
transition:
transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
background 0.25s ease;
}
/* Sliding shimmer that sweeps across on hover */
.sidebar-canvas-btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
transparent 0%,
rgba(255, 255, 255, 0.25) 50%,
transparent 100%
);
transition: left 0.6s ease;
pointer-events: none;
}
.sidebar-canvas-btn > * {
position: relative;
z-index: 1;
}
.sidebar-canvas-btn svg {
color: #ffffff;
flex-shrink: 0;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-canvas-btn:hover {
transform: translateY(-2px) scale(1.015);
background: linear-gradient(180deg, #8C8CF7 0%, #6663EE 100%);
box-shadow:
0 0 80px -8px rgba(124, 124, 240, 0.85),
0 12px 28px -6px rgba(89, 87, 232, 0.7),
inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.sidebar-canvas-btn:hover::before {
left: 100%;
}
.sidebar-canvas-btn:hover svg {
transform: rotate(-8deg) scale(1.1);
}
.sidebar-canvas-btn:active {
transform: translateY(0) scale(1);
transition-duration: 0.1s;
}
.sidebar.collapsed .sidebar-canvas-btn span {
display: none;
}
.sidebar.collapsed .sidebar-canvas-btn {
justify-content: center;
padding: 12px;
}
/* Responsive Design */
@media (max-width: 768px) {
.sidebar {
width: 280px;
transform: translateX(-100%);
transition: transform 0.3s ease, width 0.3s ease;
z-index: 200; /* Higher z-index for mobile */
}
.sidebar.collapsed {
width: 70px;
transform: translateX(-100%); /* Keep hidden when collapsed on mobile */
}
.sidebar.mobile-open {
transform: translateX(0);
}
.mobile-sidebar-overlay.visible {
display: block;
}
}