/* KPI Dashboard — Animations: Keyframes, Hover Effects, Stagger Delays, Wow Factors */

================================================================*/

/* Entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.2);
    }

    50% {
        box-shadow: 0 0 16px 4px rgba(20, 184, 166, 0.15);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard sections stagger in */
.dashboard-section {
    animation: fadeInUp 0.5s ease both;
}

.dashboard-section:nth-child(1) {
    animation-delay: 0.05s;
}

.dashboard-section:nth-child(2) {
    animation-delay: 0.1s;
}

.dashboard-section:nth-child(3) {
    animation-delay: 0.15s;
}

.dashboard-section:nth-child(4) {
    animation-delay: 0.2s;
}

.dashboard-section:nth-child(5) {
    animation-delay: 0.25s;
}

.dashboard-section:nth-child(6) {
    animation-delay: 0.3s;
}

.dashboard-section:nth-child(7) {
    animation-delay: 0.35s;
}

.dashboard-section:nth-child(8) {
    animation-delay: 0.4s;
}

/* KPI & metric cards â€” hover lift + glow */
.kpi-card,
.metric-card,
.node-card,
.chart-card,
.table-card {
    animation: fadeInScale 0.4s ease both;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
}

.kpi-card:hover,
.metric-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(20, 184, 166, 0.12),
        0 0 0 1px rgba(20, 184, 166, 0.15);
}

.node-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(20, 184, 166, 0.15),
        0 0 0 1px rgba(20, 184, 166, 0.2);
}

/* Stagger KPI cards in overview grid */
.kpi-grid .kpi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.kpi-grid .kpi-card:nth-child(2) {
    animation-delay: 0.15s;
}

.kpi-grid .kpi-card:nth-child(3) {
    animation-delay: 0.2s;
}

.kpi-grid .kpi-card:nth-child(4) {
    animation-delay: 0.25s;
}

.kpi-grid .kpi-card:nth-child(5) {
    animation-delay: 0.3s;
}

.kpi-grid .kpi-card:nth-child(6) {
    animation-delay: 0.35s;
}

/* Metric value shimmer on hover */
.kpi-card:hover .kpi-value,
.metric-card:hover .metric-value {
    background: linear-gradient(90deg, var(--text) 0%, var(--teal) 50%, var(--text) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
}

/* Status badges pulse */
.section-badge {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Buttons & interactive elements */
.btn-table-export {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-table-export:hover {
    transform: translateY(-2px) scale(1.05);
}

.chip,
.date-chip {
    transition: all 0.2s ease;
}

.chip:hover,
.date-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

/* Nav items slide highlight */
.nav-item {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover {
    transform: translateX(4px);
}

.nav-item.active {
    transform: translateX(2px);
}

/* Table rows interactive */
.data-table tbody tr {
    transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
    border-left: 3px solid transparent;
}

.data-table tbody tr:hover {
    background: rgba(20, 184, 166, 0.04);
    border-left-color: var(--teal);
}

/* Action cards lift */
.action-card {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 0 20px rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.2);
}

/* Smooth chart card reveal */
.chart-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(20, 184, 166, 0.15);
    box-shadow: 0 4px 24px rgba(20, 184, 166, 0.06), 0 8px 40px rgba(0, 0, 0, 0.15);
}

/* Cortex node cards glow border on hover */
.bandit-card:hover {
    border-color: var(--amber);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.wizard-card:hover {
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.15);
}

.pilot-card:hover {
    border-color: var(--blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.pulse-card:hover {
    border-color: var(--teal);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.15);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}


/* ================================================================
   WOW FACTOR: SIDEBAR SLIDING INDICATOR
   ================================================================ */
.sidebar-nav {
    position: relative;
}

.nav-indicator {
    position: absolute;
    left: 4px;
    width: 3px;
    height: 44px;
    background: linear-gradient(180deg, var(--teal), rgba(20, 184, 166, 0.3));
    border-radius: 3px;
    transition: top 0.35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 12px rgba(20, 184, 166, 0.4);
    pointer-events: none;
}

/* ================================================================
   WOW FACTOR: BELL NOTIFICATION SHAKE
   ================================================================ */
.btn-notification:hover svg {
    animation: bellShake 0.6s ease;
}

@keyframes bellShake {
    0% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(12deg);
    }

    30% {
        transform: rotate(-10deg);
    }

    45% {
        transform: rotate(8deg);
    }

    60% {
        transform: rotate(-6deg);
    }

    75% {
        transform: rotate(3deg);
    }

    100% {
        transform: rotate(0);
    }
}

/* ================================================================
   WOW FACTOR: PROGRESS RING GLOW
   ================================================================ */
.ring-fill {
    filter: drop-shadow(0 0 6px currentColor);
}

.ring-container {
    animation: ringBreath 4s ease-in-out infinite;
}

@keyframes ringBreath {

    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(20, 184, 166, 0.15));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(20, 184, 166, 0.3));
    }
}

/* ================================================================
   WOW FACTOR: STAGGERED CARD CASCADE
   ================================================================ */
.kpi-card,
.pulse-stat-card,
.action-card,
.scraper-card,
.node-card {
    opacity: 0;
    animation: cardCascade 0.6s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes cardCascade {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kpi-grid>*:nth-child(1),
.pulse-stats-row>*:nth-child(1),
.actions-grid>*:nth-child(1),
.scraper-grid>*:nth-child(1),
.nodes-grid>*:nth-child(1) {
    animation-delay: 0.08s;
}

.kpi-grid>*:nth-child(2),
.pulse-stats-row>*:nth-child(2),
.actions-grid>*:nth-child(2),
.scraper-grid>*:nth-child(2),
.nodes-grid>*:nth-child(2) {
    animation-delay: 0.14s;
}

.kpi-grid>*:nth-child(3),
.pulse-stats-row>*:nth-child(3),
.actions-grid>*:nth-child(3),
.scraper-grid>*:nth-child(3),
.nodes-grid>*:nth-child(3) {
    animation-delay: 0.2s;
}

.kpi-grid>*:nth-child(4),
.pulse-stats-row>*:nth-child(4),
.actions-grid>*:nth-child(4),
.scraper-grid>*:nth-child(4) {
    animation-delay: 0.26s;
}

.kpi-grid>*:nth-child(5),
.pulse-stats-row>*:nth-child(5) {
    animation-delay: 0.32s;
}

.feed-action-item.feed-positive {
    border-left-color: rgba(0, 255, 204, 0.5);
}

.feed-action-item.feed-alert {
    border-left-color: rgba(255, 77, 77, 0.5);
}

.feed-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.feed-content {
    flex: 1;
}

.feed-title {
    font-size: 13px;
    font-weight: 600;
    color: #E2E8F0;
    line-height: 1.3;
    margin-bottom: 3px;
}

.feed-meta {
    font-size: 13px;
    color: #5A6478;
}