/* Hide chat history by default */
#sidebar-chat-history{
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show chat history with animation */
#sidebar-chat-history.show{
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Loading state for chat history */
#sidebar-chat-history-list.loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

/* Modern skeleton loader items */
.chat-history-skeleton-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    animation: pulse 1.5s ease-in-out infinite;
}

.chat-history-skeleton-title {
    width: 75%;
    height: 16px;
    background: linear-gradient(90deg, #e9ecef 25%, #dee2e6 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Chat history list styles */
#sidebar-chat-history-list {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.sidebar-chat-history-list-item {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-chat-history-list-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.sidebar-chat-history-list-item.chat-item {
    background-color: #ffffff;
}

.sidebar-chat-history-list-item.chat-item:hover {
    background-color: #f1f8ff;
    border-color: #42A8C3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 168, 195, 0.15);
}

.chat-item-content {
    display: flex;
    flex-direction: column;
}

.chat-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #132D2F;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-chat-history-list-item.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #889596;
    font-style: italic;
}

/* Sidebar */
#sidebar{
    width: 22%;
    height: 100%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #D9EEF3;
    box-sizing: border-box;
    z-index: 2;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.expanded {
    width: 40%;
    min-width: 40%;
}

#sidebar-body{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#sidebar-list{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#sidebar-list .sidebar-list-item{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    outline: none;
    text-decoration: none;
}

#sidebar-list .sidebar-list-item a{
    width: 100%;
    height: 100%;
    padding: 8px 8px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-text-priority-3);
    transition: ease 0.3s all;
}

#sidebar-list .sidebar-list-item a:hover{
    background-color: #F2F3F3;
}

#sidebar-list .sidebar-list-item svg{
    width: 24px;
    margin-right: 5px;
}

#sidebar-list .sidebar-list-item svg{
    color: #292D32;
}

/* Active sidebar item */
#sidebar-list .sidebar-list-item.active a{
    background-color: #F2F3F3;
    color: var(--color-secondary);
}







/* Sidebar Footer */
#sidebar-footer{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    border-top: 2px solid #D9EEF3;
    padding: 10px 20px 20px 20px;
}

#sidebar-profile-card{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
}

#sidebar-profile-card #sidebar-profile-picture-container{
    width: 40px;
    height: 40px;
    background-color: var(--color-profile-picture-bg);
    padding: 1px;
    border-radius: 100px;
}

#sidebar-profile-card #sidebar-profile-picture{
    width: 100%;
    height: 100%;
    border-radius: 100px;
    box-sizing: border-box;
    background-position: center;
    background-size: cover;
}

#sidebar-profile-card #sidebar-profile-card-content{
    width: fit-content;
    height: fit-content;
    display: flex;
    flex-direction: column;
    font-size: 11px;
    margin: auto 8px;
}

#sidebar-profile-card #sidebar-profile-card-content #sidebar-profile-card-name{
    font-size: 14px;
    font-weight: bold;
}

#sidebar-profile-card #sidebar-profile-card-btn-options{
    width: 30px;
    height: 30px;
    display: flex;
    margin: auto 0 auto auto;
    padding: 5px;
    box-sizing: border-box;
    cursor: pointer;
}

#sidebar-profile-card #sidebar-profile-card-btn-options img{
    width: 100%;
}

#sidebar-footer-nav{
    width: 100%;
    height: fit-content;
    display: flex;
    padding: 20px 0 20px 0;
}

#sidebar-footer-nav #sidebar-footer-nav-list{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

#sidebar-footer-nav .sidebar-footer-nav-list-item{
    width: 100%;
    height: fit-content;
}

#sidebar-footer-nav .sidebar-footer-nav-list-item .sidebar-footer-nav-item{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    color: var(--color-text-priority-2);
    font-size: 14px;
    border-radius: 5px;
    padding: 10px 0;
    transition: ease 0.3s all;
}

#sidebar-footer-nav .sidebar-footer-nav-list-item .sidebar-footer-nav-item:hover{
    background: #eaeaea6e;
}

#sidebar-footer-nav .sidebar-footer-nav-list-item .sidebar-footer-nav-item svg{
    width: 20px;
    height: 20px;
}

#sidebar-footer-nav .sidebar-footer-nav-list-item .sidebar-footer-nav-item span{
    width: fit-content;
    height: fit-content;
    margin-left: 10px;
}

#sidebar-profile-options-container{
    width: 200px;
    height: fit-content;
    position: absolute;
    left: 100px;
    bottom: 70px;
    background: var(--color-background);
    box-shadow: 0px 2px 9px -4px var(--color-black);
    border-radius: 5px;
    color: var(--color-primary);
    display: none;
    z-index: 1;
}

.sidebar-options-expanded{
    display: flex !important;
}

#sidebar-profile-options-container ul{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

#sidebar-profile-options-container ul li{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
    padding: 8px;
    align-items: center;
    justify-content: end;
    font-size: 13px;
    cursor: pointer;
}

#sidebar-profile-options-container ul li svg{
    width: 20px;
    height: 20px;
    margin-left: 10px;
}