/* ===========================
   Animations & Transitions
   =========================== */

/* Page Transitions */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.page.active {
    animation: pageEnter 0.3s ease-out;
}

/* Card Animations */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: cardSlideIn 0.3s ease-out;
}

/* Button Animations */
@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

.btn:active {
    animation: buttonPress 0.2s ease-out;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--accent-light-gray) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Fade Out Animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Slide Left Animation */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-left {
    animation: slideLeft 0.3s ease-out;
}

/* Slide Right Animation */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-right {
    animation: slideRight 0.3s ease-out;
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Scale Out Animation */
@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.scale-out {
    animation: scaleOut 0.3s ease-out;
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 1s linear infinite;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Heart Beat Animation */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 0.6s ease-in-out;
}

/* Jiggle Animation */
@keyframes jiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-2deg);
    }
    75% {
        transform: rotate(2deg);
    }
}

.jiggle {
    animation: jiggle 0.3s ease-in-out;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 87, 87, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 87, 87, 0.8);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Modal Animations */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.active {
    animation: modalSlideUp 0.3s ease-out;
}

/* Notification Animations */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.active {
    animation: notificationSlideIn 0.3s ease-out;
}

/* Loading Bar Animation */
@keyframes loadingBar {
    0% {
        width: 0%;
    }
    50% {
        width: 80%;
    }
    100% {
        width: 100%;
    }
}

.loading-bar {
    animation: loadingBar 2s ease-in-out;
}

/* Skeleton Loading Animation */
@keyframes skeletonLoading {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loading {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--accent-light-gray) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 1000px 100%;
    animation: skeletonLoading 2s infinite;
}

/* Transition Classes */
.transition-all {
    transition: all 0.3s ease-in-out;
}

.transition-fast {
    transition: all 0.15s ease-in-out;
}

.transition-slow {
    transition: all 0.5s ease-in-out;
}

.transition-colors {
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.transition-transform {
    transition: transform 0.3s ease-in-out;
}

.transition-opacity {
    transition: opacity 0.3s ease-in-out;
}

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 87, 87, 0.4);
}

.hover-brighten:hover {
    filter: brightness(1.1);
}

.hover-darken:hover {
    filter: brightness(0.9);
}

/* Focus Effects */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 87, 87, 0.1);
}

/* Active Effects */
.active-press:active {
    transform: scale(0.98);
}

/* Disabled Effects */
.disabled-opacity:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Animation Adjustments */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
