/**
 * Shared motion — subtle page and component animations for dashboards.
 */

@keyframes gk-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gk-fade-in-scale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gk-slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .main-content,
    .dashboard-main,
    .admin-main-content,
    .page-content {
        animation: gk-fade-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .card,
    .card-admin,
    .kpi-card,
    .admin-card,
    .hub-card,
    .stat-card,
    .chart-card,
    .panel-card,
    .content-card {
        animation: gk-fade-in-scale 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }

    .main-content > .row > [class*="col-"]:nth-child(1) .card,
    .main-content > .row > [class*="col-"]:nth-child(1) .kpi-card,
    .dashboard-main > .row > [class*="col-"]:nth-child(1) .card-admin {
        animation-delay: 0.04s;
    }

    .main-content > .row > [class*="col-"]:nth-child(2) .card,
    .main-content > .row > [class*="col-"]:nth-child(2) .kpi-card,
    .dashboard-main > .row > [class*="col-"]:nth-child(2) .card-admin {
        animation-delay: 0.08s;
    }

    .main-content > .row > [class*="col-"]:nth-child(3) .card,
    .main-content > .row > [class*="col-"]:nth-child(3) .kpi-card,
    .dashboard-main > .row > [class*="col-"]:nth-child(3) .card-admin {
        animation-delay: 0.12s;
    }

    .main-content > .row > [class*="col-"]:nth-child(4) .card,
    .main-content > .row > [class*="col-"]:nth-child(4) .kpi-card,
    .dashboard-main > .row > [class*="col-"]:nth-child(4) .card-admin {
        animation-delay: 0.16s;
    }

    .card:hover,
    .card-admin:hover,
    .kpi-card:hover,
    .admin-card:hover,
    .hub-card:hover,
    .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

    .nav-dropdown-content,
    .notifications-dropdown-content,
    .profile-dropdown-content {
        animation: gk-slide-down 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
        transform-origin: top right;
    }

    .nav-icon,
    .sidebar-toggle-btn,
    .theme-toggle-btn,
    .notifications-btn,
    .btn,
    .nav-link,
    .dropdown-item {
        transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    }

    .nav-icon:active,
    .notifications-btn:active,
    .btn:active {
        transform: scale(0.96);
    }

    .table tbody tr {
        transition: background-color 0.18s ease;
    }

    .notification-item,
    .notif-row {
        transition: background-color 0.2s ease, transform 0.2s ease;
    }

    .notification-item:hover,
    .notif-row:hover {
        transform: translateX(2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
