/* Token Icons Styles */
.token-icons {
    display: flex;
    align-items: center;
    gap: -8px; /* Negative gap to overlap icons slightly */
    margin-right: 12px;
}

.token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: 2px solid #1f2937;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.token-icon:hover {
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 4px 8px rgba(251, 191, 36, 0.4);
}

.token-icon:last-child {
    margin-left: -8px; /* Overlap the second icon */
    z-index: 0;
}

.token-icon:last-child:hover {
    z-index: 2;
}

/* Token icon with image */
.token-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: white; /* Fallback background for transparent images */
}

/* Processed state for token icons */
.token-icon.processed {
    /* Just a marker class, no visual changes */
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error state for token icons */
.token-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.token-icon.error::before {
    content: '!';
    font-size: 16px;
    font-weight: bold;
}

/* Special styling for specific tokens */
.token-icon[data-contract="currency"] {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.token-icon[data-contract="con_xns_token"] {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.token-icon[data-contract="con_poop_coin"] {
    background: linear-gradient(135deg, #a16207, #92400e);
    color: white;
}

.token-icon[data-contract="con_xtfu"] {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}

.token-icon[data-contract="con_xarb"] {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.token-icon[data-contract="con_usdc"] {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .token-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .token-icons {
        gap: -6px;
        margin-right: 10px;
    }
    
    .token-icon:last-child {
        margin-left: -6px;
    }
}

@media (max-width: 480px) {
    .token-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .token-icons {
        gap: -4px;
        margin-right: 8px;
    }
    
    .token-icon:last-child {
        margin-left: -4px;
    }
}

/* Tooltip styles for token icons */
.token-icon[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Animation for successful logo load */
.token-icon.loaded {
    animation: logoLoaded 0.5s ease-out;
}

@keyframes logoLoaded {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}