/**
 * LongevityCreation Unified Sidebar Styles
 * Version: 2.1.0
 */

:root {
    --advisor-color: #0088FF;
    /* Vibrant Light Blue */
    --advisor-bg: #E6F3FF;
    --profile-color: #10B981;
    --profile-bg: #ECFDF5;
    --protocols-color: #8B5CF6;
    --protocols-bg: #F5F3FF;
    --library-color: #F59E0B;
    --library-bg: #FFFBEB;

    --sidebar-text-primary: #1F2937;
    --sidebar-text-secondary: #4B5563;
    --sidebar-text-muted: #9CA3AF;
    --sidebar-bg: #FFFFFF;
    --sidebar-border: #F3F4F6;
}

.sidebar {
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 24px 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--sidebar-text-primary);
    font-weight: 700;
    font-size: 18px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #4A443D;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.3s ease;
}

.nav-links {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--sidebar-text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #F8F6F2;
    color: var(--sidebar-text-primary);
}

.nav-link.active {
    background: #F8F6F2;
    font-weight: 600;
}

/* Theme specifics for Nav Links */
body.page-advisor .nav-link.active {
    color: var(--advisor-color);
    background: var(--advisor-bg);
}

body.page-profile .nav-link.active {
    color: var(--profile-color);
    background: var(--profile-bg);
}

body.page-protocols .nav-link.active {
    color: var(--protocols-color);
    background: var(--protocols-bg);
}

body.page-library .nav-link.active {
    color: var(--library-color);
    background: var(--library-bg);
}

/* Theme specifics for Logo Icon */
body.page-advisor .logo-icon {
    background: var(--advisor-color);
}

body.page-profile .logo-icon {
    background: var(--profile-color);
}

body.page-protocols .logo-icon {
    background: var(--protocols-color);
}

body.page-library .logo-icon {
    background: var(--library-color);
}

/* Primary Button Styles */
.new-chat-btn {
    margin: 16px 12px;
    padding: 14px;
    background: #4A443D;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-chat-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Theme specifics for Action Button */
body.page-advisor .new-chat-btn {
    background: var(--advisor-color);
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.3);
}

body.page-profile .new-chat-btn {
    background: var(--profile-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

body.page-protocols .new-chat-btn {
    background: var(--protocols-color);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

body.page-library .new-chat-btn {
    background: var(--library-color);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Session List Styles */
.session-list-header {
    padding: 24px 24px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-text-muted);
}

.session-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.session-item:hover {
    background: #F8F6F2;
}

.session-item.active {
    background: var(--advisor-bg);
    color: var(--advisor-color);
    font-weight: 600;
}

.session-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.session-actions {
    display: none;
    gap: 4px;
}

.session-item:hover .session-actions {
    display: flex;
}

.session-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--sidebar-text-muted);
}

.session-action-btn:hover {
    color: var(--sidebar-text-primary);
}

/* Secondary Nav & Footer */
.sidebar-secondary-nav {
    padding: 16px 12px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link.secondary {
    font-size: 13px;
    padding: 8px 12px;
    color: var(--sidebar-text-muted);
}

.sidebar-footer {
    padding: 16px 12px 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F8F6F2;
    border-radius: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--sidebar-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email-small {
    font-size: 11px;
    color: var(--sidebar-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: #EF4444;
    background: #FEE2E2;
}