/* Token Toggle Styles */
.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 50px; /* Fixed height to prevent vertical movement */
}

.balance-item {
    flex: 0 0 auto;
}

.token-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 120px; /* Fixed width to prevent horizontal movement */
    position: relative;
}

.token-toggle-label {
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    text-align: center;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.token-toggle {
    position: relative;
    width: 120px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    overflow: hidden;
}

.token-toggle:hover {
    border-color: #90EE90;
    transform: scale(1.05);
}

.token-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.token-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(1.2);
}

.toggle-slider-token {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    background: linear-gradient(45deg, #90EE90, #7CFC00);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(144, 238, 144, 0.4);
}

.token-toggle.hype .toggle-slider-token {
    transform: translateX(40px);
}

.token-toggle.stablecoin .toggle-slider-token {
    transform: translateX(80px);
}

.token-toggle.win #winIcon {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.token-toggle.win #hypeIcon,
.token-toggle.win #stablecoinIcon {
    opacity: 0.3;
}

.token-toggle.hype #hypeIcon {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.token-toggle.hype #winIcon,
.token-toggle.hype #stablecoinIcon {
    opacity: 0.3;
}

.token-toggle.stablecoin #stablecoinIcon {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.token-toggle.stablecoin #winIcon,
.token-toggle.stablecoin #hypeIcon {
    opacity: 0.3;
}

/* Tooltip for token names */
.token-toggle.win::before {
    content: "WIN Token";
}

.token-toggle.hype::before {
    content: "HYPE Token";
}

.token-toggle.stablecoin::before {
    content: "Stablecoin";
}

.token-toggle::before {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.token-toggle:hover::before {
    opacity: 1;
}

@media (max-width: 768px) {
    .balance-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        flex-wrap: nowrap; /* Prevent wrapping on mobile */
    }
    
    .balance-item {
        flex: 1 1 auto; /* Allow balance to shrink */
        text-align: left;
        min-width: 0; /* Allow text to truncate if needed */
        overflow: hidden;
    }
    
    .token-toggle-container {
        flex-shrink: 0;
        min-width: auto;
    }
    
    .token-toggle {
        width: 140px;
        height: 48px;
        padding: 6px;
    }
    
    .token-icon {
        width: 32px;
        height: 32px;
    }
    
    .token-icon img {
        width: 22px;
        height: 22px;
    }
    
    .toggle-slider-token {
        width: 32px;
        height: 32px;
        top: 6px;
        left: 6px;
    }
    
    .token-toggle.hype .toggle-slider-token {
        transform: translateX(46px);
    }
    
    .token-toggle.stablecoin .toggle-slider-token {
        transform: translateX(92px);
    }
    
    .token-toggle-label {
        font-size: 12px;
        padding: 4px 10px;
        margin-bottom: 8px;
    }
}
