/* Page Load Animations */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Main content wrapper animation */
.page-transition {
    animation: fadeIn 0.4s ease-out;
}

/* Stagger animations for child elements */
.stagger-animation > * {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.35s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.45s; }

/* Card animations */
.card-animation {
    opacity: 0;
    animation: scaleIn 0.4s ease-out forwards;
}

.card-animation:nth-child(1) { animation-delay: 0.1s; }
.card-animation:nth-child(2) { animation-delay: 0.15s; }
.card-animation:nth-child(3) { animation-delay: 0.2s; }
.card-animation:nth-child(4) { animation-delay: 0.25s; }

/* Chart container animations */
.chart-animation {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

/* Table animation */
.table-animation {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 0.4s;
}

/* Header animation */
.header-animation {
    opacity: 0;
    animation: slideInLeft 0.5s ease-out forwards;
}

/* Button animations */
.button-animation {
    opacity: 0;
    animation: slideInRight 0.5s ease-out forwards;
    animation-delay: 0.2s;
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Smooth transitions for interactive elements */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Focus animations */
input:focus,
select:focus,
textarea:focus {
    transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Page navigation transition */
.page-enter {
    opacity: 0;
    transform: translateX(10px);
}

.page-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease-out;
}

.page-exit {
    opacity: 1;
    transform: translateX(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease-out;
}

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