/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.slide-in-left {
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.slide-out-left {
    animation: slideOutLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.slide-out-right {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

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

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

/* ============================================
   ELEMENT ENTRANCE ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-down {
    animation: fadeInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   STAGGER ANIMATIONS (for lists)
   ============================================ */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ============================================
   HOVER ANIMATIONS
   ============================================ */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--accent-primary);
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

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

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }
}

/* ============================================
   PROGRESS ANIMATIONS
   ============================================ */
.progress-fill {
    animation: progressFill 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes progressFill {
    from {
        width: 0;
    }
}

/* ============================================
   CHART ANIMATIONS
   ============================================ */
.chart-appear {
    animation: chartAppear 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes chartAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */
.bounce {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce-subtle {
    animation: bounceSubtle 3s ease-in-out infinite;
}

@keyframes bounceSubtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ============================================
   ROTATION ANIMATIONS
   ============================================ */
.rotate-slow {
    animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   SHAKE ANIMATIONS
   ============================================ */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ============================================
   GLOW ANIMATIONS
   ============================================ */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px var(--accent-primary));
    }
    50% {
        filter: drop-shadow(0 0 20px var(--accent-primary));
    }
}

/* ============================================
   BUTTON INTERACTIONS
   ============================================ */
button:active:not(:disabled) {
    transform: scale(0.95);
}

.button-press {
    transition: transform 0.1s ease;
}

.button-press:active {
    transform: scale(0.95);
}

/* ============================================
   TOAST/NOTIFICATION ANIMATIONS
   ============================================ */
.toast-enter {
    animation: toastEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-exit {
    animation: toastExit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

/* ============================================
   ATTENTION SEEKERS
   ============================================ */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.05);
    }
}

.wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */
.toggle-switch {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-switch.active {
    transform: translateX(20px);
}

.checkbox-check {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-check.checked {
    stroke-dashoffset: 0;
}

/* ============================================
   BACKGROUND ANIMATIONS
   ============================================ */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.delay-100 { animation-delay: 0.1s !important; }
.delay-200 { animation-delay: 0.2s !important; }
.delay-300 { animation-delay: 0.3s !important; }
.delay-400 { animation-delay: 0.4s !important; }
.delay-500 { animation-delay: 0.5s !important; }

.duration-fast { animation-duration: 0.15s !important; }
.duration-base { animation-duration: 0.3s !important; }
.duration-slow { animation-duration: 0.5s !important; }
.duration-slower { animation-duration: 1s !important; }

.ease-in { animation-timing-function: ease-in !important; }
.ease-out { animation-timing-function: ease-out !important; }
.ease-in-out { animation-timing-function: ease-in-out !important; }
.ease-bounce { animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1) !important; }

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