My question involves search and seizure law in the State of: Illinois
Story:
This morning as I left my home for school I got pulled over by a detective and sergeant who were parked outside my house waiting for me. As soon as they approached my car they asked me for identification. Then they informed me that they have a search and seizure warrant to swab my mouth to obtain my DNA for an investigation they are doing. I told them I would like to speak to an attorney before I submit to any DNA tests. From there, the detective said for us to go to the local police station and we will talk more there.
After arriving at the local police station they put me in an interrogation room. They told me that I need to give them my DNA or else I will be held in contempt. I once again refused to give up my DNA until I had spoken with an attorney. They told me that they are not required to get me an attorney for this particular case. I did not believe them so I still refused to give them my DNA until I spoke with an attorney. They then put me in handcuffs, took me to their cars, and drove me to their county court house, which was 2 counties away.
Once at their courthouse, they put me in an interrogation room and told me once again that I need to give them my DNA and that they will get it regardless of my decision, so I might as well give it to them right now. If I choose not to, then I will have to wait in the room for 5 hours to go to bond court and see a judge, who will order me to comply or authorize them to hold me down and pry open my mouth anfd forcefully obtain the DNA. I still did not believe them, so I refused again and told them that I would like to speak to an attorney immediately. Their only response was that I am not gonna get a lawyer right now, but that I may get one AFTER giving them my DNA.
After about 4 hours of sitting in the room, they put me in cuffs and took me to bond court where I finally saw a judge. The judge asked me if I understand what is being asked of me. I replied that I did. Then I told the judge that I am not refusing to comply, I just believe it is reasonable to ask to see an attorney before giving up my DNA to the police. The judge said I can see an attorney after giving up my DNA, but not right now. He then gave me the option to either comply, or he will authorize the police to use "any and all means necessary" to obtain the DNA from me. So I decided to comply. I gave them my DNA and they released me.
End of Story
I don't understand how this could be legal to do. I did not do anything wrong. The detectives did not read me my rights, tell me where they are taking me, or give me any type of information about what is going on. They did not allow me to tell anyone where I was going and did not give me a phone to use until AFTER the bond hearing (6 hours after getting pulled over). I felt like I was being kidnapped at one point. I lost an entire day of school on top of this and now I am behind and my grades will suffer.
Is there anything I can do to fight back? Did the police or judge violate any of my rights? I thought America was free from this bullshit. What should I do? I am now worried to leave my house in fear of them doing this to me again. I did not argue, fight, or resists. I was polite and just asked repeatedly to speak to a lawyer.

