css(`
    forum- {
        font-family: 'Bona';
    }

    forum- input::placeholder {
        font-family: 'Bona Nova';
        font-size: 0.9em;
        color: var(--accent);
    }

    input[type="checkbox"] {
        appearance: none;        /* remove default style */
        -webkit-appearance: none;
        width: 1em;
        height: 1em;
        border: 1px solid var(--accent);
    }

    input[type="checkbox"]:checked {
        background-color: var(--red);
    }
`)

class Forum extends Shadow {
    friends = []
    conversations = []

    render() {
        ZStack(() => {
            HStack(() => {
                VStack(() => {
                    p("Hyperia")
                        .background("var(--darkbrown)")
                        .textAlign("center")
                        .paddingVertical(0.5, em)
                        .width(20, vh)
                        .marginTop(0)
                        .marginBottom(1, em)
                        .marginLeft(0.4, em)
                })
                .height(100, vh)
                .paddingLeft(2, em)
                .paddingRight(2, em)
                .paddingTop(2, em)
                .gap(0, em)

                VStack(() => {
                    input("Message Hyperia", "80%")
                        .paddingVertical(1, em)
                        .color("var(--accent)")
                        .background("var(--darkbrown)")
                        .marginBottom(6, em)
                        .border("none")
                })
                .width(100, pct)
                .alignHorizontal("center")
                .alignVertical("end")
            })
            .width(100, "%")
            .height(87, vh)
            .x(0).y(13, vh)

            HStack(() => {
                input("Search...", "45vw")
                    .attr({
                        "type": "text"
                    })
                    .fontSize(1.1, em)
                    .paddingLeft(1.3, em)
                    .background("transparent")
                    .border("0.5px solid #bb7c36")
                    .outline("none")
                    .color("var(--accent)")
                    .borderRadius(10, px)

                button("Search")
                    .marginLeft(2, em)
                    .borderRadius(10, px)
                    .background("transparent")
                    .border("0.5px solid #bb7c36")
                    .color("var(--accent)")
                    .fontFamily("Bona Nova")
                    .onHover(function (hovering) {
                        if(hovering) {
                            this.style.background = "var(--green)"

                        } else {
                            this.style.background = "transparent"

                        }
                    })

                button("+ New Message")
                    .width(13, em)
                    .marginLeft(1, em)
                    .borderRadius(10, px)
                    .background("transparent")
                    .border("0.5px solid #bb7c36")
                    .color("var(--accent)")
                    .fontFamily("Bona Nova")
                    .onHover(function (hovering) {
                        if(hovering) {
                            this.style.background = "var(--green)"

                        } else {
                            this.style.background = "transparent"

                        }
                    })
                    .onClick((clicking) => {
                        console.log(this, "clicked")
                    })

            })
            .x(55, vw).y(4, vh)
            .position("absolute")
            .transform("translateX(-50%)")
        })
        .width(100, pct)
        .height(100, pct)
    }
}

register(Forum)