/* ==========================================
   SIDEBAR
========================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    background: #171717;
    width: var(--sidebar-width);
    transition: width .25s ease;
}

/* ==========================================
   TOP SECTION
========================================== */

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-secondary);

    transition: .2s;
}

.menu-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.new-chat-btn {
    height: 44px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 14px;

    border-radius: 12px;

    background: transparent;

    transition: .2s;
}

.new-chat-btn:hover {
    background: var(--surface);
}

.new-chat-btn span:first-child {
    font-size: 1.3rem;
    font-weight: 400;
}

.new-chat-btn span:last-child {
    font-size: .95rem;
    font-weight: 500;
}

/* ==========================================
   HISTORY
========================================== */

.chat-history {
    padding: 12px 8px;
}

.chat-history h3 {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;

    color: var(--text-secondary);

    margin: 18px 12px 10px;
}

/* ==========================================
   HISTORY ITEM
========================================== */

.history-item {

    display: flex;
    align-items: center;

    width: 100%;

    padding: 11px 12px;

    border-radius: 10px;

    font-size: .92rem;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    transition:
        background .18s,
        color .18s;
}

.history-item:hover {
    background: #2A2A2A;
}

.history-item.active {
    background: #2F2F2F;
}

.history-item:focus-visible {
    outline: 2px solid #5b9cff;
    outline-offset: 2px;
}

/* ==========================================
   BOTTOM
========================================== */

.sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,.05);

    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ==========================================
   SETTINGS
========================================== */

.sidebar-item {

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 11px 12px;

    border-radius: 10px;

    font-size: .92rem;

    transition: .2s;
}

.sidebar-item:hover {
    background: #2A2A2A;
}

/* ==========================================
   PROFILE
========================================== */

.profile-btn {

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 10px 12px;

    border-radius: 12px;

    transition: .2s;
}

.profile-btn:hover {
    background: #2A2A2A;
}

/* ==========================================
   AVATAR
========================================== */

.avatar {

    width: 34px;
    height: 34px;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #10A37F,
        #0B8A6A
    );

    color: white;

    font-size: .9rem;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

/* ==========================================
   PROFILE INFO
========================================== */

.profile-info {
    overflow: hidden;
}

.profile-info strong {

    display: block;

    font-size: .9rem;

    font-weight: 500;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-info small {

    display: block;

    color: var(--text-secondary);

    font-size: .75rem;

    margin-top: 2px;
}

/* ==========================================
   SCROLLBAR
========================================== */

.chat-history::-webkit-scrollbar {
    width: 8px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 20px;
}

.chat-history:hover::-webkit-scrollbar-thumb {
    background: #3F3F3F;
}

/* ==========================================
   COLLAPSED SIDEBAR
========================================== */

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .new-chat-btn span:last-child,
.sidebar.collapsed .history-item,
.sidebar.collapsed .chat-history h3,
.sidebar.collapsed .sidebar-item,
.sidebar.collapsed .profile-info {
    display: none;
}

.sidebar.collapsed .new-chat-btn,
.sidebar.collapsed .sidebar-item,
.sidebar.collapsed .profile-btn {
    justify-content: center;
}

.sidebar.collapsed .avatar {
    margin: 0;
}