#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(81.5vh - 100px); /* Высота контейнера, учитывая футер */
    overflow-y: auto; /* Включаем прокрутку */
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
}


/* Стили для планшетов (ширина экрана от 768px до 1024px) */
@media (max-height: 850px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(79vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

/* Стили для планшетов (ширина экрана от 768px до 1024px) */
@media (max-height: 750px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(75vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

/* Стили для телефонов (ширина экрана до 768px) */
@media (max-height: 650px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(70vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

/* Стили для телефонов (ширина экрана до 768px) */
@media (max-height: 550px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(65vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

/* Стили для телефонов (ширина экрана до 768px) */
@media (max-height: 450px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(60vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

/* Стили для телефонов (ширина экрана до 768px) */
@media (max-height: 350px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(50vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

/* Стили для телефонов (ширина экрана до 768px) */
@media (max-height: 250px) {
#sidebar {
    width: 260px;
    margin: 0 0 10px -15px;
    height: calc(40vh - 100px);
    overflow-y: auto;
    user-select: none;
    display: none;
    transition: transform 0.3s ease-in-out;
  }
}

.chat-title-container {
    width: 85%;
    display: flex;
    align-items: center;
}

.chat-logo {
    margin-left: 6px;
    margin-right: -4px;
    width: 24px; /* Размер логотипа */
    height: 24px;
    border-radius: 50%; /* Круглый логотип */
    object-fit: cover; /* Чтобы изображение не искажалось */
}

#chat-list {
    margin-left: 10px;
    margin-right: 5px;
    flex: 1; /* Занимает все доступное пространство */
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto; /* Включаем прокрутку для списка */
}

::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Стили для элементов чата */
.chat-item {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    user-select: none;
    height: 34px;
}

.chat-item::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 0;
    background: transparent;
    border-radius: 5px;
    transform: translateY(-50%);
    z-index: -1;
}

.chat-item:hover::before,
.chat-item.active::before {
    height: 100%;
    background: #2d2d2d;
}

.chat-item.active,
.chat-item:hover {
    background: none;
}

.chat-title {
    flex: 1;
    margin: 0 0 0 9px;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.chat-actions {
    position: relative;
    user-select: none;
}

.menu-icon {
    vertical-align: middle;
    cursor: pointer;
    fill: #888;
    padding: 5px;
    user-select: none;
    opacity: 0;
}

.chat-item:hover .menu-icon,
.bot-message:hover .menu-icon,
.menu-icon:hover {
    opacity: 1;
}

.menu-icon:hover {
    opacity: 1;
    fill: #fff;
}

.menu {
    display: none;
    position: fixed;
    background-color: #2d2d2d;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    min-width: 150px;
    padding: 5px;
    user-select: none;
}

.menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    gap: 8px;
    user-select: none;
}

.menu button:hover {
    background-color: #3d3d3d;
}

.menu button.delete {
    color: #ff4444;
}

.confirmation {
    color: #fff;
    display: none;
    position: fixed;
    background-color: #2d2d2d;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    min-width: 150px;
    padding: 5px;
    user-select: none;
}

.confirmation button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 12px;
    text-align: center;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    gap: 8px;
    user-select: none;
}

.confirmation button:hover {
    background-color: #3d3d3d;
}

.confirmation button.yes {
    color: #ff4444;
}

.confirmation button.no {
    color: #fff;
}

.delete-confirmation {
    color: #fff;
    display: none;
    position: fixed;
    background-color: #2d2d2d;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    min-width: 150px;
    padding: 5px;
    user-select: none;
}

.delete-confirmation button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 12px;
    text-align: center;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    gap: 8px;
    user-select: none;
}

.delete-confirmation button:hover {
    background-color: #3d3d3d;
}

.delete-confirmation button.yes {
    color: #ff4444;
}

.delete-confirmation button.no {
    color: #fff;
}

.chat-item input {
    width: 120px;
    padding: 5px;
    font-size: 14px;
    color: #fff;
    background-color: #3d3d3d;
    border: 1px solid #888;
    border-radius: 3px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item input:focus {
    border-color: #007bff;
}

.new_chat {
    color: #fff;
    background-color: #0069ad;
    border: none;
    cursor: pointer;
    display: flex;
    margin-left: 43px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    transition: transform 0.3s ease-in-out;
}

.new_chat:hover {
    background-color: #005fad;
    
}