/* Анимация появления блоков сайдбара */
.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;
}

/* Аккордеон: свернутый блок */
/* Свернутый блок и обычный блок теперь с 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;
}
.sidebar-section > div {
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1);
    position: relative;
}

/* Кнопка закрепления */
.sidebar-pin-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    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) {
    box-shadow: 0 0 0 1px #1976d2, 0 2px 8px rgba(25, 118, 210, 0.08);
    background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%);
    border: 1px solid #1976d2;
    transition: box-shadow 0.3s, background 0.3s, border 0.3s;
    border-radius: 6px;
}
@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); }
}
