/* ============================================
   MINTLY ANIMATIONS
   Smooth, polished animations for web-to-app feel
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Fade In Animations */
@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 fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shimmer/Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Shake Animation (for errors) */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Progress Bar Animation */
@keyframes progressSlide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */

/* Animate content wrapper on page load */
.content-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

/* Stagger animation for cards */
.uk-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.uk-card:nth-child(1) { animation-delay: 0.1s; }
.uk-card:nth-child(2) { animation-delay: 0.2s; }
.uk-card:nth-child(3) { animation-delay: 0.3s; }
.uk-card:nth-child(4) { animation-delay: 0.4s; }
.uk-card:nth-child(5) { animation-delay: 0.5s; }
.uk-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

/* Navbar slide in */
.uk-navbar-container {
    animation: slideInDown 0.4s ease-out;
}

/* Navbar items fade in */
.uk-navbar-nav > li {
    animation: fadeIn 0.5s ease-out backwards;
}

.uk-navbar-nav > li:nth-child(1) { animation-delay: 0.1s; }
.uk-navbar-nav > li:nth-child(2) { animation-delay: 0.15s; }
.uk-navbar-nav > li:nth-child(3) { animation-delay: 0.2s; }
.uk-navbar-nav > li:nth-child(4) { animation-delay: 0.25s; }
.uk-navbar-nav > li:nth-child(5) { animation-delay: 0.3s; }
.uk-navbar-nav > li:nth-child(6) { animation-delay: 0.35s; }
.uk-navbar-nav > li:nth-child(7) { animation-delay: 0.4s; }
.uk-navbar-nav > li:nth-child(8) { animation-delay: 0.45s; }
.uk-navbar-nav > li:nth-child(9) { animation-delay: 0.5s; }
.uk-navbar-nav > li:nth-child(10) { animation-delay: 0.55s; }

/* Mobile menu items */
.uk-offcanvas-bar .uk-nav > li {
    animation: fadeInLeft 0.4s ease-out backwards;
}

.uk-offcanvas-bar .uk-nav > li:nth-child(1) { animation-delay: 0.1s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(2) { animation-delay: 0.15s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(3) { animation-delay: 0.2s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(4) { animation-delay: 0.25s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(5) { animation-delay: 0.3s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(6) { animation-delay: 0.35s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(7) { animation-delay: 0.4s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(8) { animation-delay: 0.45s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(9) { animation-delay: 0.5s; }
.uk-offcanvas-bar .uk-nav > li:nth-child(10) { animation-delay: 0.55s; }

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.uk-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple effect on click */
.uk-button::before {
    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;
}

.uk-button:active::before {
    width: 300px;
    height: 300px;
}

/* Hover lift effect */
.uk-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.uk-button:active {
    transform: translateY(0);
}

/* Loading state */
.uk-button.loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.uk-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.6s linear infinite;
}

/* ============================================
   FORM ANIMATIONS
   ============================================ */

.uk-input,
.uk-select,
.uk-textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus animation */
.uk-input:focus,
.uk-select:focus,
.uk-textarea:focus {
    transform: translateY(-1px);
}

/* Label float animation */
.uk-form-label {
    transition: all 0.3s ease;
}

/* Error shake */
.uk-form-danger,
.uk-input.uk-form-danger {
    animation: shake 0.5s;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

/* Card hover effect */
.uk-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.uk-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Card content fade in */
.uk-card-body > * {
    animation: fadeIn 0.5s ease-out backwards;
}

.uk-card-body > *:nth-child(1) { animation-delay: 0.1s; }
.uk-card-body > *:nth-child(2) { animation-delay: 0.2s; }
.uk-card-body > *:nth-child(3) { animation-delay: 0.3s; }
.uk-card-body > *:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   LIST/TABLE ANIMATIONS
   ============================================ */

/* Transaction items */
.transaction-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInLeft 0.4s ease-out backwards;
}

.transaction-item:nth-child(1) { animation-delay: 0.05s; }
.transaction-item:nth-child(2) { animation-delay: 0.1s; }
.transaction-item:nth-child(3) { animation-delay: 0.15s; }
.transaction-item:nth-child(4) { animation-delay: 0.2s; }
.transaction-item:nth-child(5) { animation-delay: 0.25s; }
.transaction-item:nth-child(6) { animation-delay: 0.3s; }
.transaction-item:nth-child(7) { animation-delay: 0.35s; }
.transaction-item:nth-child(8) { animation-delay: 0.4s; }
.transaction-item:nth-child(9) { animation-delay: 0.45s; }
.transaction-item:nth-child(10) { animation-delay: 0.5s; }

.transaction-item:hover {
    transform: translateX(4px);
}

/* Table rows */
.uk-table tbody tr {
    transition: all 0.2s ease;
    animation: fadeIn 0.4s ease-out backwards;
}

.uk-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.uk-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.uk-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.uk-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.uk-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.uk-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.uk-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.uk-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.uk-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.uk-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

.uk-table tbody tr:hover {
    transform: scale(1.01);
}

/* ============================================
   ALERT/NOTIFICATION ANIMATIONS
   ============================================ */

.uk-alert {
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Flash messages */
.flash-container .uk-alert {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   MODAL/DROPDOWN ANIMATIONS
   ============================================ */

.uk-dropdown {
    animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   PROGRESS/LOADING ANIMATIONS
   ============================================ */

/* Budget progress bars */
.budget-progress-bar {
    animation: progressSlide 1.5s ease-in-out;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        #353b48 0%,
        #2d3436 50%,
        #353b48 100%
    );
    background-size: 200% 100%;
}

/* ============================================
   ICON ANIMATIONS
   ============================================ */

/* Icon hover effects */
[uk-icon]:hover,
.uk-icon:hover {
    animation: pulse 0.5s ease-in-out;
}

/* Account icons */
.account-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-icon:hover {
    transform: rotate(5deg) scale(1.1);
}

/* ============================================
   BADGE/TAG ANIMATIONS
   ============================================ */

.uk-badge,
.subscription-badge {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.uk-badge:hover,
.subscription-badge:hover {
    transform: scale(1.05);
}

/* ============================================
   PROFILE PHOTO ANIMATIONS
   ============================================ */

.profile-photo-nav,
.profile-photo-nav-placeholder {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-photo-nav:hover,
.profile-photo-nav-placeholder:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4);
}

/* ============================================
   THEME TOGGLE ANIMATIONS
   ============================================ */

.theme-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

.theme-toggle:active {
    transform: rotate(180deg) scale(0.95);
}

/* ============================================
   CHART ANIMATIONS
   ============================================ */

canvas {
    animation: fadeIn 0.8s ease-out;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Fade in on scroll (requires JS) */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   PRICING CARD ANIMATIONS
   ============================================ */

.pricing-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: scaleIn 0.5s ease-out backwards;
}

.pricing-card:nth-child(1) { animation-delay: 0.1s; }
.pricing-card:nth-child(2) { animation-delay: 0.2s; }
.pricing-card:nth-child(3) { animation-delay: 0.3s; }

.pricing-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* ============================================
   MOBILE SPECIFIC ANIMATIONS
   ============================================ */

@media (max-width: 959px) {
    /* Reduce motion on mobile for performance */
    .uk-card:hover {
        transform: translateY(-2px);
    }
    
    /* Faster animations on mobile */
    .uk-button:hover {
        transform: translateY(-1px);
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-pulse {
    animation: pulse 1s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
