import webbrowser
import tkinter as tk

def search():
    command = entry.get().strip()
    
    if command:
        webbrowser.open(f"https://www.youtube.com/search?q={command}")

    entry.delete(0, tk.END)

window = tk.Tk()
window.geometry("300x200")
window.resizable(False, False)
window.title("~Youtube search~")
window.config(bg="#0F172A")

entry = tk.Entry(window)
entry.pack()

output = tk.Label(
    window,
    font=("Consolas", 11, "bold"),
    bg="#0F172A",
    fg="#38BDF8"
    )

button = tk.Button(
    window,
    text="Send",
    command=search,
    bg="#0F172A",
    fg="#38BDF8",
    activebackground="#0F172A",
    activeforeground="#38BDF8"
)
window.bind("<Return>", lambda event: button.invoke())
button.pack(pady=10)
result = tk.Label(window, text="Pick a YouTube search...")
result.pack()

window.mainloop()
