/* Core Animations - Consolidated from multiple CSS files
 * This file eliminates duplication across dashboard.css, notifications.css,
 * pwa-install.css, and other CSS files.
 */

/* ========== NOTIFICATION ANIMATIONS ========== */

/* Slide in from top (centered) - Used for notifications */
@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Slide out to top (centered) - Used for notifications */
@keyframes slideOutUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* ========== SLIDE ANIMATIONS ========== */

/* Slide in from right - Used for table rows and elements */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide in from right (alternative) - Used for job updates */
@keyframes slideInRightAlt {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide out to left - Used for table removals */
@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* ========== FADE ANIMATIONS ========== */

/* Fade out with slide - Used for table row removals */
@keyframes fadeOutSlide {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Fade out with scale - Used for modal dialogs */
@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Fade in with scale - Used for modal dialogs */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fade in with slide up - Used for performance optimizations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== PULSE ANIMATIONS ========== */

/* Success pulse - Used for successful updates */
@keyframes pulseSuccess {
    0% {
        background-color: rgba(25, 135, 84, 0.1);
    }
    50% {
        background-color: rgba(25, 135, 84, 0.3);
    }
    100% {
        background-color: rgba(25, 135, 84, 0.1);
    }
}

/* Update pulse - Used for general updates */
@keyframes pulseUpdate {
    0% {
        background-color: rgba(13, 202, 240, 0.1);
    }
    50% {
        background-color: rgba(13, 202, 240, 0.3);
    }
    100% {
        background-color: rgba(13, 202, 240, 0.1);
    }
}

/* Button pulse - Used for PWA install button and call-to-action buttons */
@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.5), 0 0 0 4px rgba(13, 110, 253, 0.1);
    }
    100% {
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    }
}

/* ========== VARIATIONS FOR DIFFERENT CONTEXTS ========== */

/* Mobile variation - centered without horizontal transform */
@media (max-width: 768px) {
    @keyframes slideInDownMobile {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideOutUpMobile {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
}

/* PWA variation - smaller offset for install prompts */
@keyframes slideInDownPWA {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== ACCESSIBILITY ========== */

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}