@import url("_vars-1c00bfabd95fad1d1f07b3762d25303e.css");

* {
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;

    a {
        color: var(--link-color);
    }

    a:visted {
        color: var(--link-color);
    }
}

nav {
    background-color: var(--nav-background-color);

    display: flex;
    justify-content: space-between;

    svg {
        height: 1em;
    }

    ul {
        list-style-type: none;
        margin: 0;
        padding: 10px 1rem;

        li {
            display: inline;
            margin-right: 10px;
            padding: 10px .5em;

            a {
                text-decoration: none;
            }

            &.active {
                background-color: var(--nav-active-background-color);
            }
        }
    }
}

main {
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px;
}

[id^="character_detail_"] {
    display: flex;
    flex-direction: column;
    gap: 1em;

    .image {
        img {
            max-width: 10em;
            max-height: 10em;
        }
    }

    .name {
        font-size: 2em;
    }

    .actions {
        display: flex;
        gap: 1em;
        justify-content: flex-start;

        svg {
            background-color: var(--button-background-color);
            padding: .5em;
            height: 3em;
            border-radius: 50%;

            &:hover {
                cursor: pointer;
                color: var(--link-hover-color);
            }
        }
    }

}

#characters {
    margin-top: 1em;
    display: flex;
    flex-direction: column;
    gap: 1em;
    container: character / size;

    .character {
        display: grid;
        grid-template-areas:
            "image name sex actions"
            "image archetype race actions"
            "image careers careers actions";
        grid-template-columns: 1fr 1fr 1fr 1fr;


        .image {
            grid-area: image;

            img {
                max-width: 5em;
                max-height: 5em;
            }
        }

        .name {
            grid-area: name;
        }

        .sex {
            grid-area: sex;
        }

        .actions {
            grid-area: actions;
            display: flex;
            justify-content: center;
            gap: 1em;

            svg {
                background-color: var(--button-background-color);
                padding: .5em;
                height: 2em;
                border-radius: 50%;

                &:hover {
                    cursor: pointer;
                    color: var(--link-hover-color);
                }
            }
        }

        .archetype {
            grid-area: archetype;
        }

        .race {
            grid-area: race;
        }

        .careers {
            grid-area: careers;
        }
    }
}

button,
.button {
    background-color: var(--button-background-color);
    color: white;
    padding: .5em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 1em;

    &:hover {
        background-color: var(--button-hover-background-color);
    }
}

.w100 {
    display: block;
    width: 100%;
}

form {
    display: flex;
    flex-direction: column;
    gap: 2em;

    >div {
        display: flex;
        flex-direction: column;
        gap: 1em;

        >div {
            display: flex;
            flex-direction: column;
            gap: .5em;

            label {
                display: block;
                margin-top: 1em;
            }

            label+input,
            label+select {
                margin-top: .5em;
            }

            >input,
            >select:not(.tomselected) {
                padding: .5em;
                width: 100%;
            }
        }
    }
}

[data-bridge-components~="form"] [data-controller~="bridge--form"] [type="submit"] {
    display: none;
}

input {

    &[type="text"],
    &[type="email"],
    &[type="password"],
    &[type="number"] {
        padding: 0.5em;
        width: 100%;
        border-radius: 1em;
    }

    &[type="checkbox"] {
        position: relative;
        left: 30px;
        top: 0px;
        z-index: 0;
        -webkit-appearance: none;

        &+label {
            position: relative;
            display: block;
            cursor: pointer;
            font-family: sans-serif;
            font-size: 24px;
            line-height: 1.3;
            padding-left: 70px;
            position: relative;
            margin-top: -30px;

            &:before {
                width: 60px;
                height: 30px;
                border-radius: 30px;
                border: 2px solid #222222;
                background-color: #333333;
                content: "";
                margin-right: 15px;
                transition: background-color 0.5s linear;
                z-index: 5;
                position: absolute;
                left: 0px;
            }

            &:after {
                width: 30px;
                height: 30px;
                border-radius: 30px;
                background-color: #585858;
                content: "";
                transition: margin 0.1s linear;
                box-shadow: 0px 0px 5px var(--nav-active-background-color);
                position: absolute;
                left: 2px;
                top: 2px;
                z-index: 10;
            }
        }

        &:checked {
            &+label:before {
                background-color: var(--checkbox-active-background-color);
            }

            &+label:after {
                margin: 0 0 0 30px;
            }
        }
    }
}

#messages {
    position: fixed;
    right: 3em;
    top: 2em;
    display: flex;
    gap: 1em;
    flex-direction: column;
    max-height: 90vh;
    flex-wrap: wrap-reverse;
    z-index: 500;

    .flash {
        position: relative;
        padding: 1em;
        max-height: 90vh;
        min-width: 20em;
        overflow-y: auto;
    }

    .flash-success {
        background-color: #dff0d8;
        border-color: #d6e9c6;
        color: #3c763d;
    }

    .flash-error {
        background-color: #f2dede;
        border-color: #ebccd1;
        color: #a94442;
    }

    .flash-warning {
        background-color: #fcf8e3;
        border-color: #faebcc;
        color: #8a6d3b;
    }

    .flash-info {
        background-color: #d9edf7;
        border-color: #bce8f1;
        color: #31708f;
    }
}

@container character (width < 600px) {
    #characters {
        .character {
            grid-template-areas:
                "image name actions"
                "image sex actions"
                "image race actions";
            grid-template-columns: 1fr 1fr 1fr;

            .careers,
            .archetype {
                display: none;
            }
        }
    }
}