/* ── Общие анимации BIPfR ──────────────────────────────────
   Лёгкие, ненавязчивые движения: появление страницы, карточек,
   выпадающих меню и отклик на нажатия. Уважает prefers-reduced-motion. */

:root {
    --bipfr-ease-out: cubic-bezier(.22, 1, .36, 1);
    --bipfr-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes bipfr-page-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bipfr-pop-in {
    from { opacity: 0; transform: translateY(-6px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bipfr-reveal-in {
    from { opacity: 0; translate: 0 18px; }
    to   { opacity: 1; translate: 0 0; }
}

@keyframes bipfr-soft-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 194, 255, 0); }
    50%      { box-shadow: 0 0 0 4px rgba(76, 194, 255, .08); }
}

/* Появление страницы */
.main-content {
    animation: bipfr-page-in .38s var(--bipfr-ease-out) both;
}

/* Плавные переходы для интерактивных элементов */
button,
.btn,
.btn-sm,
.text-btn,
input,
textarea,
select,
summary,
.menu-item,
.notif-item,
.chat-item {
    transition:
        color .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        opacity .18s ease,
        transform .18s var(--bipfr-ease-out);
}

/* Отклик на нажатие */
button:not(:disabled):active,
.btn:not(.disabled):active,
.btn-sm:not(.disabled):active {
    transform: scale(.97);
}

/* Мягкое свечение основных кнопок */
.btn-primary:hover,
.btn.btn-primary:hover,
.btn-sm.btn-primary:hover {
    box-shadow: 0 0 0 1px rgba(76, 194, 255, .22), 0 8px 24px rgba(76, 194, 255, .16);
}

/* Меню, уведомления, поиск, громкость, панели */
.user-menu-container.open .dropdown-menu,
.user-menu-container:hover .dropdown-menu,
.notif-wrap.open .notif-dropdown,
.global-volume-popover.open,
.search-results-container.has-content,
.assistant-panel.open,
.assistant-modal.open .assistant-modal-card {
    animation: bipfr-pop-in .18s var(--bipfr-ease-out) both;
}

/* Карточки без собственного hover-эффекта — лёгкая подсветка */
.stat-card,
.ws-card,
.settings-section,
.topic-card,
.post-card,
.sidebar-card,
.cat-side-card,
.balance-card {
    transition:
        border-color .22s ease,
        box-shadow .22s ease,
        background-color .22s ease;
}

.stat-card:hover,
.ws-card:hover,
.settings-section:hover,
.topic-card:hover,
.post-card:hover,
.sidebar-card:hover,
.cat-side-card:hover,
.balance-card:hover {
    border-color: rgba(76, 194, 255, .2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}

/* Аккуратный фокус для клавиатуры */
:where(a, button, input, textarea, select, summary):focus-visible {
    outline: 2px solid rgba(76, 194, 255, .65);
    outline-offset: 2px;
}

/* Плавное появление блоков при прокрутке (класс добавляет animations.js) */
.bipfr-reveal {
    opacity: 0;
}

.bipfr-reveal.is-visible {
    animation: bipfr-reveal-in .55s var(--bipfr-ease-out) both;
    animation-delay: var(--reveal-delay, 0ms);
}

/* Мягкая пульсация бейджа уведомлений */
.notif-badge.show {
    animation: bipfr-soft-pulse 2.4s ease-in-out infinite;
}

/* Уважаем настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .bipfr-reveal {
        opacity: 1;
    }
}
