/* ============================================================================
   ADVANCED WALLET ANIMATIONS AND STYLES
   Created: 2025-10-05
   Purpose: CSS for advanced MetaMask features
   ============================================================================ */

/* Balance Change Animations */
.balance-increase {
    animation: balance-pulse-green 0.6s ease-out;
}

.balance-decrease {
    animation: balance-pulse-red 0.6s ease-out;
}

@keyframes balance-pulse-green {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(34, 197, 94, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

@keyframes balance-pulse-red {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Notification Animations */
@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

.animate-slide-down {
    animation: slide-down 0.3s ease-out;
}

/* Gas Option Hover Effects */
.gas-option {
    transition: all 0.2s ease;
}

.gas-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
}

/* Transaction Queue Styles */
.pending-txs {
    backdrop-filter: blur(10px);
}

.tx-item {
    transition: all 0.2s ease;
}

.tx-item:hover {
    background-color: rgba(51, 65, 85, 0.6);
}

/* Modal Animations */
.modal-overlay {
    backdrop-filter: blur(8px);
    animation: fade-in 0.2s ease-out;
}

.modal-content {
    animation: scale-in 0.2s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Spinner for Pending Transactions */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Portfolio Card Styles */
.portfolio-card {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.4);
}

/* Price Alert Badge */
.price-alert-badge {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Approval Manager Styles */
.approval-card {
    transition: all 0.2s ease;
    border-left-width: 4px;
}

.approval-card:hover {
    border-left-color: #a855f7;
    background-color: rgba(51, 65, 85, 0.7);
}

/* Transaction Preview Highlight */
.preview-highlight {
    position: relative;
    overflow: hidden;
}

.preview-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Activity Feed Filters */
.filter-dropdown {
    transition: all 0.2s ease;
}

.filter-dropdown:focus {
    ring: 2px;
    ring-color: #a855f7;
}

/* Wallet Switcher Animation */
.wallet-item {
    transition: all 0.2s ease;
}

.wallet-item:hover {
    background-color: rgba(100, 116, 139, 0.3);
    transform: translateX(4px);
}

/* Success/Error States */
.tx-success {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.1);
}

.tx-error {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.tx-pending {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

/* Loading States */
.skeleton-loader {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* Tooltip Styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .gas-option {
        padding: 12px;
    }

    .notification-item {
        margin: 0 8px;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .approval-card {
        border-color: #334155;
    }

    .portfolio-card {
        background-color: rgba(15, 23, 42, 0.8);
    }
}

/* Accessibility */
.focus-visible:focus {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .notification-item,
    .modal-overlay,
    .tooltip::after {
        display: none !important;
    }
}
