/* === ANIMATIONS === */
@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes ping {
    0% { transform: scale(0.1); opacity: 0.8; }
    80% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1.2); opacity: 0; }
}
@keyframes emergency-pulse {
    0% { border-color: var(--red); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { border-color: var(--red); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { border-color: var(--red); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 5px var(--amber-glow); }
    50% { box-shadow: 0 0 20px var(--amber-glow-strong); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animate cards on load */
.card, .kpi-card {
    animation: slideInUp 0.4s ease backwards;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-circle { border-radius: 50%; }

/* Emergency pulse */
.emergency-pulse {
    animation: breathe 2s ease-in-out infinite;
}

/* Page transitions */
.page-view {
    display: none;
    animation: fadeIn 0.3s ease;
}
.page-view.active {
    display: block;
}

/* Smooth number transitions */
.animate-number {
    animation: countUp 0.5s ease backwards;
}

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Ripple effect on buttons */
.btn { position: relative; overflow: hidden; }
.btn::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.15), transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.btn:active::after { opacity: 1; }
