/* ========== SIDEBAR ========== */
.sidebar {
    width: 378px;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    /* Changed from overflow-y: auto */
}

/* Persistent Header Section */
.sidebar-fixed-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
    padding: 40px 40px 0 40px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 48px;
}

.sidebar-menu-btn {
    background: #e7edf3;
    border: none;
    border-radius: 100px;
    padding: 12px 24px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 18px;
}

.sidebar-menu-icon {
    width: 20px;
    height: 20px;
    stroke: #809dbc;
}

.sidebar-logo {
    height: 21.4px;
    width: 60px;
}

/* Search Section */
.sidebar-search {
    margin-bottom: 48px;
    position: relative;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 10px 12px;
    height: 40px;
    border: 2px solid #E7EDF3;
    border-radius: 100px;
    background: #fff;
}

.search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: #809dbc;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.search-input::placeholder {
    color: #809dbc;
    font-size: 14px;
    font-weight: var(--font-weight-regular);
}

/* Chats Section Title */
.sidebar-section-title {
    font-weight: var(--font-weight-semibold);
    font-size: 12px;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    color: #000000;
    margin-bottom: 24px;
    margin-top: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Onboarding widget under search */
.onboarding-widget {
    border: none;
    border-radius: 16px;
    padding: 24px;
    background: #f0f7ff;
    margin-bottom: 48px;
    overflow: hidden;
}

.onboarding-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.onboarding-headline {
    font-weight: var(--font-weight-medium);
    font-size: 20px;
    line-height: 1.4;
    color: #000000;
}

.onboarding-subtitle {
    font-weight: var(--font-weight-medium);
    font-size: 14px;
    line-height: 1.4;
    color: #000000;
}

.onboarding-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.onboarding-progress-bar {
    width: 100%;
    height: 5px;
    background: #90a9c4;
    border-radius: 100px;
    position: relative;
}

.onboarding-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 5px;
    width: 0%;
    background: #075CFB;
    border-radius: 100px;
    transition: width 0.25s ease;
}

.onboarding-progress-text {
    font-size: 12px;
    color: #90a9c4;
    font-weight: var(--font-weight-medium);
    width: 100%;
    text-align: right;
    line-height: 1;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 6px 0;
    text-align: left;
    cursor: pointer;
}

.onboarding-step .step-check-img {
    width: 14px;
    height: 14px;
    display: inline-block;
}

/* Vertically center finished item text to check icon */
.onboarding-step.complete .step-label {
    line-height: 14px;
    display: inline-block;
}

.onboarding-step .step-label {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: #075CFB;
}

.onboarding-step:hover .step-label {
    text-decoration: underline;
}

.onboarding-step.complete {
    cursor: default;
}

.onboarding-step.complete .step-label {
    color: #809dbc;
    text-decoration: none;
}

/* Scrollable Content Area */
.sidebar-scrollable-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 0 40px 40px 40px;
}

/* Gradient effects for scrollable content */
.sidebar-scrollable-content.has-scroll-bottom::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 378px;
    height: 300px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
    z-index: 1;
}

.sidebar-scrollable-content.has-scroll-top::before {
    content: '';
    position: fixed;
    top: 230px;
    left: 0;
    width: 378px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, transparent 100%);
    pointer-events: none;
    z-index: 15;
}

.sidebar-scrollable-content.has-scroll-both::before {
    content: '';
    position: fixed;
    top: 230px;
    left: 0;
    width: 378px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, transparent 100%);
    pointer-events: none;
    z-index: 15;
}

.sidebar-scrollable-content.has-scroll-both::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 378px;
    height: 300px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Custom scrollbar */
.sidebar-scrollable-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scrollable-content::-webkit-scrollbar-thumb {
    background: rgba(128, 157, 188, 0.3);
    border-radius: 2px;
}

.sidebar-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 157, 188, 0.5);
}

/* Chat History */
.chat-history {
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-history-group {
    margin-bottom: 32px;
}

.chat-history-date {
    font-weight: var(--font-weight-medium);
    font-size: 12px;
    color: #000000;
    margin-bottom: 8px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.chat-history-item {
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    line-height: 2.4;
    color: #809dbc;
    cursor: pointer;
    transition: color 0.2s;
    display: block;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.chat-history-item:hover {
    color: #075cfb;
}

.chat-history-item.selected {
    color: #075cfb;
    font-weight: var(--font-weight-medium);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== SLIDE-OUT MENU STYLES ========== */
/* Overlay backdrop */
.slide-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.slide-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* The sliding menu panel */
.slide-menu {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 270px;
    height: calc(100vh - 80px);
    background: #e7edf3;
    border-radius: 36px;
    padding: 0;
    box-sizing: border-box;
    transform: translateX(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    will-change: transform;
    transform: translateX(-100%) translateZ(0);
}

.slide-menu-overlay.active .slide-menu {
    transform: translateX(0);
}

.slide-menu-overlay .slide-menu {
    transition: transform 0.3s ease;
}

/* Menu header with close button and logo */
.slide-menu-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 24px 24px 24px;
    margin-bottom: 0;
}

.slide-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-menu-close svg {
    width: 18px;
    height: 18px;
}

.slide-menu-logo {
    width: 60px;
    height: auto;
}

/* Dividers */
.slide-menu-divider {
    height: 1px;
    background: #d0e0f0;
    margin: 0 24px 0 24px;
}

/* Menu content */
.slide-menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 0 0 0;
}

/* Menu items */
.slide-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    margin: 0 24px 16px 24px;
    border-radius: 100px;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    color: #809dbc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.slide-menu-item:hover {
    background: rgba(255, 255, 255, 0.3);
}

.slide-menu-item.active {
    background: #ffffff;
    color: #075cfb;
}

.slide-menu-item.active .slide-menu-icon path {
    stroke: #075cfb;
}

/* Filter for active navigation icons (img tags) */
.slide-menu-item.active .slide-menu-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(97%) saturate(2234%) hue-rotate(221deg) brightness(96%) contrast(101%);
}

.slide-menu-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Logout button specific spacing */
#slide-menu-logout {
    margin-top: 24px;
}

/* Bottom section */
.slide-menu-bottom {
    margin-top: auto;
    padding: 60px 0 24px 0;
}

/* User profile section */
.slide-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px;
    margin: 0 24px;
    border-radius: 24px;
    background: #d7e1ea;
    margin-top: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.slide-menu-user:hover {
    background: #c8d4e0;
}

.slide-menu-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #075cfb;
}

.user-avatar-initials {
    color: #ffffff;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.slide-menu-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slide-menu-user-name {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: #020426;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.slide-menu-user-company {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: #809dbc;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .slide-menu {
        top: 20px;
        left: 20px;
        width: 280px;
        height: calc(100vh - 40px);
        border-radius: 24px;
    }
}