/* انیمیشن‌های نرم سراسری — OEID Asset Manager */

html {
    scroll-behavior: smooth;
}

/* ظاهر اولیه نرم */
body {
    -webkit-font-smoothing: antialiased;
}

/* ورود صفحه */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* بدون انیمیشن ورود کل صفحه تا حس رفرش ندهد */
.container,
.card,
.stats {
    animation: none;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* فقط تعویض محتوای لیست کالا نرم باشد */
/* لیست کالا در داشبورد: تعویض خشک و سریع */
#assets-content {
    transition: none;
}
#assets-content.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
#assets-content.is-swapping {
    animation: none;
}
.dashboard-page .card,
.dashboard-page .container,
.dashboard-page .stats {
    animation: none !important;
}

/* دکمه‌ها */
.btn,
button[type="submit"],
.nav-links a,
.cat-tab,
.sub-summary-card,
.chat-row,
.asset-row,
.btn-backup-float {
    transition:
        transform 0.22s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        border-color 0.2s ease,
        opacity 0.2s ease,
        color 0.2s ease !important;
}

.btn:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.btn:active,
button[type="submit"]:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.nav-links a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-links a:active {
    transform: scale(0.97);
}

/* تب‌ها و کارت‌های خلاصه */
.cat-tab:hover,
.sub-summary-card:hover {
    transform: translateY(-3px);
}

.sub-summary-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease, background 0.2s ease !important;
}

/* کارت‌ها */
.card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

/* فرم‌ها */
input,
select,
textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* هشدارها */
.alert {
    animation: fadeInUp 0.35s ease-out both;
}

/* جداول */
table tbody tr {
    transition: background 0.18s ease;
}

/* گروه کالا / زیرگروه */
.group-section,
.group-block {
    animation: fadeIn 0.4s ease-out both;
}

.subgroup-body {
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

/* چت */
.bubble {
    animation: scaleIn 0.25s ease-out both;
}

.chat-row {
    transition: background 0.2s ease, transform 0.2s ease !important;
}

.chat-row:hover {
    transform: translateX(-3px);
}

/* دکمه پشتیبان شناور */
.btn-backup-float {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease !important;
}

.btn-backup-float:hover {
    transform: translateY(-3px) scale(1.03);
}

/* لینک‌های عملیات کوچک */
.btn-sm {
    transition: transform 0.18s ease, opacity 0.18s ease !important;
}

.btn-sm:hover {
    transform: translateY(-1px);
}

/* کاهش حرکت برای کسانی که ترجیح می‌دهند */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* صفحات دیگر: ورود نرم کارت‌ها */
body:not(.dashboard-page) .card {
    animation: fadeInUp 0.4s ease-out both;
}
body:not(.dashboard-page) .container > .card:nth-child(2) { animation-delay: 0.05s; }
body:not(.dashboard-page) .container > .card:nth-child(3) { animation-delay: 0.1s; }
