.history-sidebar {
    width: 50px;
    background-color: white;
    display: flex;
    flex-direction: column;
    height: 50px;
    overflow: hidden;
    transition: 
        width 0.1s ease,
        box-shadow 0.2s ease,
        backdrop-filter 0.2s ease;
    position: relative;
    z-index: 100;
    position: absolute;
    /* Initial state - no shadow */
    box-shadow: none;
}

.history-sidebar.expanded {
    width: 18rem;
    border-right: 1px solid #e6e6e6;
    height: 100dvh !important;
    z-index: 100 !important;
    /* Enhanced visual effects for expanded state */
    box-shadow: 
        2px 0 8px rgba(0, 0, 0, 0.1),
        4px 0 16px rgba(0, 0, 0, 0.05),
        8px 0 24px rgba(0, 0, 0, 0.03),
        inset -1px 0 0 rgba(255, 255, 255, 0.1); /* Subtle inner glow */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* position: relative; */
    /* Add subtle background gradient for depth */
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.98) 100%);
        @media screen and (max-width: 768px) {
            position: absolute;
        }
}

/* Backdrop overlay for mobile expanded state */
.history-sidebar.expanded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 18rem;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .history-sidebar.expanded::before {
        left: 85%; /* Match mobile sidebar width */
        opacity: 1;
        pointer-events: auto;
    }
    
    .history-sidebar.expanded {
        /* Enhanced mobile shadow */
        box-shadow: 
            2px 0 12px rgba(0, 0, 0, 0.15),
            4px 0 20px rgba(0, 0, 0, 0.08),
            8px 0 32px rgba(0, 0, 0, 0.05);
    }
}

.history-toggle-btn {
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 6px;
    top: 8px;
    background: none;
    border: none;
    color: #c93891;
    font-size: 24px;
    cursor: pointer;
    display: block;
    z-index: 101;
}


@media (min-width: 768px) {
    .history-toggle-btn:hover {
        border-radius: 5px;
        background: #dedede;
    }
}

.sidebar-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4px;
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 20px;
    color: #555;
    cursor: pointer;
}

.sidebar-icon.active {
    color: #c93891;
}

.sidebar-content {
    width: 100%;
    display: none;
    background-color: #f2f2f2;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-right: 1px solid #e6e6e6;
    flex-direction: column;
    overflow: hidden;
}

.history-sidebar.expanded .sidebar-content {
    display: flex;
}

.sidebar-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    white-space: nowrap;
}

.search-icon {
    color: #333;
    font-size: 24px;
}

.new-task-button {
    margin: 10px 10px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
}

.new-task-button .plus-btn {
    color: white;
    fill: #fff;
    font-size: 15px;
    font-weight: 600;
}

.new-task-button span {
    font-weight: 500;
    font-size: 13.5px;
    background: linear-gradient(71deg, #c93891 22.69%, #0147ff 110.27%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.new-task-button:hover {
    background:linear-gradient(71deg, #c938911f 22.69%, #0147ff4f 110.27%);;
    transition: background 0.3s ease;
}

.new-task-button i {
    margin-right: 10px;
}

.new-btn-background {
    background: linear-gradient(71deg, #c93891 22.69%, #0147ff 110.27%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
    margin-top: 6px;
}

.history-item {
    display: flex;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    align-items: center;
    margin: 2px 0;
    transition: width 0.1s ease;
}

.history-item:hover {
    background: rgba(201, 56, 145, 0.04);
}

.history-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.history-icon i {
    background: linear-gradient(71deg, #c93891 22.69%, #0147ff 110.27%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-size: 14px;
    opacity: 0.6;
}

.history-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.history-name {
    color: #2c2c2c;
    font-size: 14px;
    font-weight: 400;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    color: #666;
    font-size: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.history-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    background: #f2f2f2;
    border-radius: 4px;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-item:hover .history-actions {
    display: flex;
    opacity: 1;
}

.action-btn {
    padding: 4px;
    border-radius: 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #2c2c2c;
}

.action-btn i {
    font-size: 16px;
}

.history-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    right: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 1000;
    min-width: 150px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 4px;
}

.history-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #2c2c2c;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dropdown-item i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    color: #666;
}

.usage-cost {
    margin-left: auto;
    font-weight: 600;
    color: #c93891;
    font-size: 12px;
    background: rgba(201, 56, 145, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
}

.usage-loading {
    color: #999 !important;
    background: rgba(153, 153, 153, 0.1) !important;
}

.usage-item-loading {
    pointer-events: none;
    opacity: 0.7;
}

.history-preview {
    color: #777;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile {
    display: flex;
    align-items: center;
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: auto;
}


.profile-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #c93891 0%, #0147ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 16px;
    margin-right: 12px;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-info {
    flex: 1;
    overflow: hidden;
}

.profile-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .profile-name {
    color: #e0e0e0;
}

.profile-email {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    max-width: 200px;
}

[data-theme="dark"] .profile-email {
    color: #999;
}

.chat-section-view{
    flex: 0 0 0% !important;
}

/* Dark mode styles for history sidebar */
[data-theme="dark"] .history-sidebar {
    background-color: #1e1e1e;
    border-right: 1px solid #333333;
}

[data-theme="dark"] .history-sidebar.expanded {
    /* Enhanced dark theme shadow effects */
    box-shadow: 
        2px 0 12px rgba(0, 0, 0, 0.3),
        4px 0 20px rgba(0, 0, 0, 0.2),
        8px 0 32px rgba(0, 0, 0, 0.1),
        inset -1px 0 0 rgba(255, 255, 255, 0.05); /* Subtle inner glow for dark mode */
    border-right: 1px solid #404040;
    /* Dark theme background gradient */
    background: linear-gradient(90deg, 
        rgba(30, 30, 30, 1) 0%, 
        rgba(30, 30, 30, 0.98) 100%);
}

[data-theme="dark"] .history-sidebar.expanded::before {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

@media screen and (max-width: 768px) {
    [data-theme="dark"] .history-sidebar.expanded {
        /* Enhanced dark mobile shadow */
        box-shadow: 
            2px 0 16px rgba(0, 0, 0, 0.4),
            4px 0 24px rgba(0, 0, 0, 0.25),
            8px 0 40px rgba(0, 0, 0, 0.15);
    }
}

[data-theme="dark"] .history-toggle-btn:hover {
    background: #333333;
}

[data-theme="dark"] .sidebar-content {
    background-color: #1e1e1e;
    border-right: 1px solid #333333;
}

[data-theme="dark"] .history-item:hover {
    background: rgba(201, 56, 145, 0.1);
}

[data-theme="dark"] .history-name {
    color: #e0e0e0;
}

[data-theme="dark"] .history-time {
    color: #888888;
}

[data-theme="dark"] .history-preview {
    color: #888888;
}

[data-theme="dark"] .history-actions {
    background: #1e1e1e;
}

[data-theme="dark"] .action-btn {
    color: #e0e0e0;
}

[data-theme="dark"] .action-btn:hover {
    background: #333333;
}

[data-theme="dark"] .new-task-button {
    background: rgba(201, 56, 145, 0.05);
}

[data-theme="dark"] .new-task-button:hover {
    background: rgba(201, 56, 145, 0.1);
}


[data-theme="dark"] .bottom-icons {
    color: #888888;
}

[data-theme="dark"] .bottom-icon:hover {
    color: #e0e0e0;
    background: #333333;
}

/* Dark mode styles for usage */
[data-theme="dark"] .usage-cost {
    color: #ff6b9d;
    background: rgba(255, 107, 157, 0.15);
}