/* Анимация появления блоков сайдбара */
.sidebar-block-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(.4,0,.2,1), transform 0.6s cubic-bezier(.4,0,.2,1);
}
.sidebar-block-visible {
    opacity: 1;
    transform: none;
}

/* Отключение анимаций при начальной загрузке */
.no-transition {
    transition: none !important;
}

/* Аккордеон: свернутый блок */
/* Свернутый блок и обычный блок теперь с position: relative для позиционирования pin */
.sidebar-section > div.collapsed {
    max-height: 54px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1);
    position: relative;
		border-radius: 6px!important;
		background-color: #ffffff;
}
.sidebar-section > div {
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden; /* Гарантируем, что контент не вылезает при анимации */
}

/* Кнопка закрепления */
.sidebar-pin-btn {
    position: absolute;
    top: 5px;
    right: 2px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #222;
    opacity: 0.55;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.2s, color 0.2s;
}
.sidebar-pin-btn:hover {
    opacity: 1;
    color: #111;
		background: none;
}

/* Визуальный эффект закрепления */

.pinned,
.sidebar-section > div[data-block-id]:first-child,
.sidebar-section > div[data-block-id]:nth-child(2) {
    background: #ffffff;
    border: 1px solid #1976d2;
    /* Важно сохранить max-height в списке переходов */
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), box-shadow 0.3s, background 0.3s, border 0.3s;
    border-radius: 8px;
}

/* Синий цвет для иконки закрепления в закрепленных блоках */
.pinned .sb-pin-icon,
.sidebar-section > div[data-block-id]:first-child .sb-pin-icon,
.sidebar-section > div[data-block-id]:nth-child(2) .sb-pin-icon {
    color: #1976d2 !important;
    opacity: 1 !important;
}
@keyframes pin-pop {
    0% { box-shadow: 0 0 0 0 #1976d2; }
    60% { box-shadow: 0 0 0 6px #1976d2; }
    100% { box-shadow: 0 0 0 2px #1976d2; }
}

/* Визуальный эффект открепления */
.unpinned {
    animation: unpin-shake 0.4s ease-out;
}

@keyframes unpin-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}
