/* ============================================
   FINTECH-GRADE ANIMATIONS
   Premium Banking Platform Animations
   ============================================ */

/* === Dashboard Load Animations === */
.dashboard-card,
.banking-card,
.feature-card,
.service-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

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

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

/* === Floating Card Hover Micro-Interactions === */
.card-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);
}

.card-hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(10, 26, 47, 0.2),
                0 4px 16px rgba(201, 163, 69, 0.15);
}

.banking-card:hover,
.feature-card:hover,
.service-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(10, 26, 47, 0.2),
                0 4px 16px rgba(201, 163, 69, 0.15);
}

/* === Money Count-Up Animation === */
.count-up {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.count-up.animating {
    animation: pulse 0.3s ease-out;
}

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

/* === Transaction Row Animations === */
.transaction-row {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInRight 0.4s ease-out forwards;
}

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

.transaction-row:hover {
    background: rgba(201, 163, 69, 0.08);
    transform: translateX(4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid var(--gold-highlight);
}

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

/* === Animated Progress Bars === */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-highlight), var(--emerald-green));
    border-radius: 4px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress-circle {
    fill: none;
    stroke: var(--gold-highlight);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: white;
}

/* === Modal Opening Animation === */
.modal {
    animation: modalBackdropFade 0.3s ease-out;
}

.modal.active .modal-content {
    animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

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

/* === Button Ripple & Press Feedback === */
.btn-ripple,
.btn {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(0);
    animation: rippleAnimation 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnimation {
    to {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

.btn-ripple:active,
.btn:active {
    transform: scale(0.97);
    transition: transform 0.1s ease-out;
}

/* === Animated Transfer Flow === */
.transfer-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    position: relative;
}

.transfer-flow-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--gold-highlight) 0%, 
        transparent 50%, 
        var(--gold-highlight) 100%
    );
    position: relative;
    overflow: hidden;
}

.transfer-flow-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold-highlight);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    animation: flowDot 2s infinite;
    box-shadow: 0 0 12px rgba(201, 163, 69, 0.8);
}

@keyframes flowDot {
    0% {
        left: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.transfer-flow-account {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 163, 69, 0.3);
}

/* === Animated Checkmarks === */
.checkmark-container {
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.checkmark-circle {
    stroke-dasharray: 201;
    stroke-dashoffset: 201;
    animation: drawCircle 0.6s ease-out forwards;
}

.checkmark-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s ease-out 0.6s forwards;
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* === Shimmer Effects for Loading States === */
.shimmer-skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: shimmerSweep 1.5s infinite;
    border-radius: var(--radius-md);
}

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

.skeleton-balance {
    height: 2.5rem;
    width: 60%;
    margin-bottom: var(--spacing-sm);
}

.skeleton-text {
    height: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 70%;
}

.skeleton-card {
    height: 200px;
    width: 100%;
    border-radius: var(--radius-lg);
}

/* === Animated Floating Quick Action Buttons === */
.quick-action-btn {
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gold-gradient);
    color: var(--black-primary);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(201, 163, 69, 0.3);
}

.quick-action-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(201, 163, 69, 0.5);
}

.quick-action-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        transparent 100%
    );
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-action-btn:hover::before {
    opacity: 1;
}

/* === Glassmorphism Cards === */
.glass-card-enhanced {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card-enhanced:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(201, 163, 69, 0.3);
}

/* === Smooth Page Transitions === */
.page-transition-enter {
    animation: pageFadeIn 0.3s ease-out forwards;
}

.page-transition-exit {
    animation: pageFadeOut 0.3s ease-out forwards;
}

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

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

/* === Category Icons & Colors === */
.transaction-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.category-food {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.category-travel {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.category-bills {
    background: rgba(156, 39, 176, 0.2);
    color: #9C27B0;
}

.category-withdrawal {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.category-savings {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.category-transfer {
    background: rgba(201, 163, 69, 0.2);
    color: var(--gold-highlight);
}

/* === Chart Container Animations === */
.chart-container {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

.chart-bar {
    opacity: 0;
    transform: scaleY(0);
    transform-origin: bottom;
    animation: barGrow 0.8s ease-out forwards;
}

.chart-bar:nth-child(1) { animation-delay: 0.1s; }
.chart-bar:nth-child(2) { animation-delay: 0.2s; }
.chart-bar:nth-child(3) { animation-delay: 0.3s; }
.chart-bar:nth-child(4) { animation-delay: 0.4s; }
.chart-bar:nth-child(5) { animation-delay: 0.5s; }

@keyframes barGrow {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* === Notification Badge Pulse === */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: currentColor;
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* === Loading Spinner (Premium) === */
.premium-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 163, 69, 0.2);
    border-top-color: var(--gold-highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    .dashboard-card,
    .banking-card,
    .feature-card {
        animation-delay: 0s !important;
    }
    
    .transaction-row {
        animation-delay: 0s !important;
    }
}
