/* Enhanced Intear DEX Aggregator Styles - Updated for Official API Integration */

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1A1A1A 0%, #2A2A2A 50%, #24272A 100%);
    overflow-x: hidden;
}

/* Smooth animations for all elements */
* {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2A2A2A;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
}

/* Gradient text effects */
.gradient-text {
    background: linear-gradient(135deg, #4F46E5, #7C3AED, #06B6D4);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced button effects */
button {
    position: relative;
    overflow: hidden;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

button:hover:before {
    left: 100%;
}

/* Glow effects for cards */
.card-glow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06),
                0 0 0 1px rgba(79, 70, 229, 0.1);
}

.card-glow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05),
                0 0 0 1px rgba(79, 70, 229, 0.2),
                0 0 20px rgba(79, 70, 229, 0.1);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #2A2A2A 25%, #3A3A3A 50%, #2A2A2A 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Pulse animations */
.pulse-glow {
    animation: pulse-color 2s ease-in-out infinite;
}

@keyframes pulse-color {
    0%, 100% {
        box-shadow: 0 0 5px rgba(79, 70, 229, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.6);
    }
}

/* Enhanced input focus effects */
input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3),
                0 0 20px rgba(79, 70, 229, 0.1);
    border-color: #4F46E5;
}

/* Token list animations */
.token-item {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.token-item:hover {
    transform: translateX(4px);
    background-color: rgba(79, 70, 229, 0.1);
}

/* Swap animation */
@keyframes swap-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.swap-button:active {
    animation: swap-rotate 0.6s ease-in-out;
}

/* Status indicators */
.status-online {
    position: relative;
}

.status-online::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Modal animations */
.modal-backdrop {
    backdrop-filter: blur(8px);
    animation: backdrop-fade 0.3s ease-out;
}

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

.modal-content {
    animation: modal-slide 0.3s ease-out;
}

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

/* Progress bars */
.progress-bar {
    background: linear-gradient(90deg, #4F46E5, #7C3AED, #06B6D4);
    background-size: 200% 100%;
    animation: progress-flow 2s linear infinite;
}

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

/* Transaction status animations */
.tx-success {
    animation: success-flash 0.5s ease-out;
}

@keyframes success-flash {
    0% { 
        background-color: transparent; 
        transform: scale(1);
    }
    50% { 
        background-color: rgba(16, 185, 129, 0.2); 
        transform: scale(1.02);
    }
    100% { 
        background-color: transparent; 
        transform: scale(1);
    }
}

/* Mobile responsive enhancements */
@media (max-width: 768px) {
    .mobile-scroll {
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-tap {
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.3);
    }
    
    /* Better mobile spacing */
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improved mobile input sizing */
    input[type="number"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark theme enhancements */
.dark-card {
    background: linear-gradient(135deg, #2A2A2A 0%, #1F2937 100%);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.dark-input {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
    border: 1px solid rgba(75, 85, 99, 0.4);
}

.dark-input:focus {
    border-color: #4F46E5;
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
}

/* Typography enhancements */
.font-display {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.font-mono-enhanced {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
    font-variant-numeric: tabular-nums;
}

/* Icon animations */
.icon-bounce {
    animation: gentle-bounce 2s ease-in-out infinite;
}

@keyframes gentle-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

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

.screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-acceleration {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Enhanced error states */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

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

/* Loading spinner improvements */
.spinner-glow {
    animation: spinner-pulse 2s ease-in-out infinite;
}

@keyframes spinner-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.8);
    }
}

/* Token logo fallback styling */
.token-logo-fallback {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Improved hover states for better UX */
button:not(:disabled):hover {
    transform: translateY(-1px);
}

button:not(:disabled):active {
    transform: translateY(0);
}

/* Better focus indicators for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
button,
input,
.token-item,
.card-glow {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced visual hierarchy */
h1, h2, h3 {
    text-rendering: optimizeLegibility;
}

/* Better spacing for dense layouts */
.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Improved contrast for better readability */
.text-gray-400 {
    color: #9CA3AF;
}

.text-gray-500 {
    color: #6B7280;
}

/* Enhanced table styling for transaction history */
.transaction-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 640px) {
    .transaction-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

/* Better visual feedback for successful operations */
.success-border {
    border-color: #10B981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Enhanced loading states for better perceived performance */
.loading-shimmer {
    background: linear-gradient(90deg, #2A2A2A 25%, #3A3A3A 50%, #2A2A2A 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Improved visual feedback for user actions */
.action-feedback {
    position: relative;
    overflow: hidden;
}

.action-feedback::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.3s, height 0.3s;
}

.action-feedback:active::after {
    width: 200px;
    height: 200px;
}