* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --lingrad: linear-gradient(180deg, #b9b9b9, #d3d3d3);
    --light: #fafafa;
    --dark: #232531;
    --mid: #797979;
    --active: #8993BE;
    --response: #1760fd;
}

body {
    width: 100%;
    max-width: 100;
    height: 100dvh;
    background-color: var(--light);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

a {
    transition: .5s;
    text-decoration: none;
}

.btn {
    width: fit-content;
    height: 2rem;
    display: flex;
    text-decoration: none;
    color: #212121;

    align-items: center;
    background-color: lightgreen;
    box-shadow: 0px 0px .25rem #21212180;
    border: none;
    border-radius: 1rem;
    padding: 0 1rem;

    &:hover {
        background-color: #67ad67;
        color: #fafafa;
    }
}

h1 {
    width: 100%;
    font-size: 2rem;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--dark);
    margin: 0.5rem 0;
}

p {
    font-size: 1rem;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

p.lead {
    margin-bottom: .5rem;
    font-size: 1.25rem;
}

ul.lead {
    margin-bottom: .5rem;
    font-size: 1.25rem;

    li {
        list-style-position: inside;
        color: var(--dark);
    }
}

li {
    list-style-position: inside;
}

.conf {
    display: block;
    border: 1px solid gray;
    border-radius: .5rem;
    padding: .5rem 1rem;
    margin-left: 1rem;
    background-color: #fafaec;
}

code {
    font-family: monospace;
    font-size: 1rem;
    line-height: 1rem;
}

.responses {
    color: var(--response);
    font-style: italic;
}

header {
    width: 100%;
    height: 7rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    background-image: var(--lingrad);

    .top-bar {
        width: 100%;
        height: 2rem;
        background-color: var(--dark);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
        flex-wrap: wrap;

        .lead {
            color: var(--light);
            font-size: 1.25rem;
            line-height: 2rem;
            margin: 0;
        }
    }

    nav {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        height: 5rem;
        padding: 0 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;

        h1 {
            width: fit-content;
            margin-bottom: 0;
        }

        #toggleMenu {
            display: none;
        }

        #menu {
            width: fit-content;
            display: flex;
            align-items: center;
            justify-content: end;
            position: relative;

            li {
                width: fit-content;
                display: flex;
                justify-content: center;
                align-items: center;

                a {
                    text-decoration: none;
                    color: var(--dark);
                    font-size: 1.25rem;
                    line-height: 5rem;
                    padding: 0 1rem;
                    width: fit-content;

                    display: block;

                    height: 5rem;
                    border-bottom: 1px solid transparent;

                    &:hover {
                        border-bottom: 1px solid var(--dark);
                        background-color: var(--active);

                    }
                }

                a.active {
                    border-bottom: 1px solid var(--dark);
                    background-color: var(--light);
                }
            }
        }
    }
}


main {
    width: 90rem;
    padding: 1rem 0;
    margin: 0 auto;
    min-height: calc(100dvh - 160px);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start !important;
    gap: 1rem;
    position: relative;
    z-index: 0;

    .header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .questions {
        width: calc(50% - 0.5rem);
        border: 1px solid var(--mid);
        padding: 1rem;
        border-radius: 1rem;

        li {
            list-style-position: inside;

            a {
                font-weight: bold;
                color: var(--response);
                text-decoration: dotted;
            }
        }
    }

    .resources {
        width: 100%;
        height: 4.5rem;
        border: 1px solid var(--mid);
        padding: 1.5rem 1rem 1rem 1rem;
        border-radius: 1rem;
        position: relative;
        display: flex;
        gap: 1rem;
        flex-grow: 0;

        label {
            position: absolute;
            top: -1rem;
            left: 2rem;
            background-color: var(--light);
            padding: 0 .5rem;
            font-size: 1.25rem;
            font-weight: 400;
        }
    }

    .menu {
        width: 15rem;
        height: calc(100dvh - 10rem - 2rem);
        overflow: auto;
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 999;

        a {
            width: calc(100% - .25rem);
            height: 2rem;
            display: flex;
            padding: 0 1rem;
            line-height: 2rem;
            align-items: center;
            justify-content: start;
            border-bottom: 1px solid var(--mid);
            color: var(--light);
            background-color: var(--active);

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

            i {
                margin-right: 0.5rem;
            }
        }
    }

    .contents {
        width: calc(100% - 15rem - 1rem);
        height: calc(100dvh - 10rem - 2rem);
        overflow: auto;
        padding: 0 1rem;
        position: relative;
        z-index: 0;


        h1 {
            width: 100%;
            font-weight: 400;
            color: var(--dark);
            margin-bottom: 0.5rem;
        }

        h2 {
            font-weight: 400;
            color: var(--dark);
            margin-bottom: 0.5rem;
        }

        h3 {
            font-weight: 400;
            color: var(--dark);
            margin-bottom: 0.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--dark);
        }

        h4 {
            font-weight: 400;
            color: var(--dark);
            margin: 0.5rem 0;
        }

        a {
            color: var(--response);

            &:hover {
                text-decoration: underline;
            }

            &:visited {
                color: var(--response);
            }
        }

        p,
        ul,
        ol {
            padding-left: 1rem;
            margin-bottom: 0.5rem;

            li {
                list-style-position: inside;
            }
        }

        code {
            font-family: "Reddit Mono", monospace;
            font-weight: bold;
        }

        h1 {
            font-weight: 300;
        }

        h2 {
            font-weight: 300;
            color: #fafafa;
            background-color: var(--active);
            padding: 0.125rem 0.25rem .1255rem .75rem;
            margin: .5rem 0;
            border-radius: 0 2rem 2rem 0;
        }

        h3 {
            padding-left: 1rem;
        }

        h4 {
            padding-left: 1rem;
        }

        .list-links {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;

            a.btn-link {
                width: 15rem;
                height: 3rem;
                display: flex;
                justify-content: center;
                align-items: center;
                border: 1px solid var(--dark);
                border-radius: .5rem;
                color: var(--dark);
                font-size: 1.2rem;

                &:hover {
                    border: 1px solid var(--light);
                    color: var(--light);
                    background-color: var(--dark);
                }
            }
        }

        section {
            width: 100%;
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            padding: 1rem 0;

            p {
                padding: 0;
            }

            ul {
                margin-bottom: 1rem;
            }
        }

        figure {
            padding: 1rem;
            margin-bottom: 1rem;
            border: 1px solid var(--mid);
            border-radius: 1rem;
            display: flex;
            gap: 1rem;
            background-color: #fff;
            position: relative;

            figcaption {
                display: none;
                position: absolute;
                bottom: 1rem;
                left: 1rem;
                padding: 0.5rem 1rem;
                background-color: #000000c0;
                border-radius: .25rem;
                color: #fafafa;
                font-size: .875rem;
                font-style: italic;
                transition: .5s ease;
            }

            img {
                width: 100%;
                display: block;
            }

            &:hover {
                figcaption {
                    display: block;
                    transition: .5s ease;
                }
            }
        }

        .obs {
            margin-top: 2rem;
            width: 100%;
            background-color: lightgoldenrodyellow;
            margin-bottom: 1rem;
            padding: 2.5rem 0rem .5rem 0rem;
            border-radius: .5rem;
            position: relative;

            &::before {
                content: "\f071";
                font: var(--fa-font-solid);
                position: absolute;
                top: 0;
                left: 0;
                padding: .5rem 1rem;
                border-radius: .5rem .5rem 0 0;
                background-color: gold;
                font-weight: bold;
                width: 100%;
                height: 2rem;
                display: flex;
                box-sizing: border-box;
            }

            &::after {
                --text: "Importante!";
                content: var(--text);
                display: flex;
                align-items: center;
                width: fit-content;
                height: 2rem;
                position: absolute;
                top: 0;
                left: 2.5rem;
                color: var(--dark);
                font-weight: bold;
            }
        }

        .tip {
            width: 100%;
            padding: 3rem 1rem 1rem 1rem;
            border-radius: .5rem;
            background-color: lavender;
            position: relative;
            box-shadow: 0px 0px .5rem #00000040;
            margin: 1rem 0;

            p {
                line-height: 1rem;
                margin: 0;
                padding: 0;
            }

            &::before {
                content: "\f0eb";
                font: var(--fa-font-solid);
                width: 100%;
                height: 2rem;
                box-sizing: border-box;
                background-color: darkorchid;
                position: absolute;
                color: var(--light);
                top: 0;
                left: 0;
                border-radius: .5rem .5rem 0 0;
                display: flex;
                align-items: center;
                padding-left: .5rem;
            }

            &::after {
                --text: "Dica";
                content: var(--text);
                display: flex;
                align-items: center;
                width: fit-content;
                height: 2rem;
                position: absolute;
                top: 0;
                left: 2rem;
                color: var(--light);
                font-weight: bold;
            }
        }

        /* Browser */
        /* ====== Browser Window ====== */
        .browser {
            all: revert;
            background-image: url(../assets/browser-bar.svg);
            background-position: top left;
            background-repeat: no-repeat;
            padding: 2.5rem .5rem .5rem .5rem;
            border: 1px solid #48484840;
            border-radius: .5rem;
            display: block;
            background-color: #fff;
            box-shadow: 0px 0px .5rem #00000040;
            margin-bottom: 1rem;
            color: #000;
            font: 1rem serif;
            position: relative;

            p,
            ul,
            ol,
            pre,
            h1,
            h2,
            h3,
            h4,
            h5 {
                margin-block: 1rem;
                width: 100%;
                color: black;
                margin: 0;
                padding: 0;
                background-color: transparent !important;
                display: block;
                border: none;
            }

            dd {
                margin-left: 2rem;
            }

            h1 {
                font-size: 2.4rem;
                line-height: 4.8rem;
                font-weight: bold;
            }

            h2 {
                font-size: 1.75rem;
                line-height: 3.5rem;
                font-weight: bold;
            }

            h3 {
                font-size: 1.5rem;
                line-height: 3rem;
                font-weight: bold;
            }

            h4 {
                font-size: 1.25rem;
                line-height: 2.5rem;
                font-weight: bold;
            }

            h5 {
                font-size: 1rem;
                line-height: 2rem;
                font-weight: bold;
            }

            h6 {
                font-size: .75rem;
                line-height: 1.5rem;
                font-weight: bold;
            }

            p {
                font-size: 1rem;
                line-height: 1.5rem;
            }

            a:link,
            a:visited {
                color: #06c;
                text-decoration: underline;
            }

            code,
            pre,
            kbd,
            samp {
                font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
            }

            pre {
                background: #fff;
                padding: .75rem;
                overflow: auto;
                white-space: pre-wrap;
                overflow-wrap: break-word;
            }

            &::before {
                content: "Exibição no Navegador";
                height: 2rem;
                display: flex;
                justify-content: center;
                align-items: center;
                text-align: center;
                position: absolute;
                top: 0;
                left: 50%;
                translate: -50% 0;
                font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
                font-weight: 500;
                font-size: .875rem;
                color: #606060;
            }
        }
    }
}

.w25 {
    width: 25%;
}

.w50 {
    width: 50%;
}

.w75 {
    width: 75%;
}

.w100 {
    width: 100%;
}

abbr {
    font-weight: bold;
    color: darkblue;
    text-decoration: none;
}

footer {
    width: 100%;
    height: 3rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark);

    p {
        color: var(--light);
        line-height: 3rem;
    }
}

.hidden {
    display: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 4rem;
    height: 2rem;
    z-index: 1;
    border-radius: 1.5rem;

    &::before {
        content: "Mostrar Respostas";
        width: 8.75rem;
        height: 2rem;
        display: flex;
        align-items: center;
        position: absolute;
        left: -140px;
        text-align: right;
    }
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ececec;
    border-radius: 1rem;
    transition: 0.5s;
    -webkit-transition: 0.5s;
    box-shadow: 0px 0px .25rem #21212180;
}

.slider::before {
    content: "";
    position: absolute;
    height: 1.5rem;
    width: 1.5rem;
    left: .25rem;
    top: .25rem;
    background-color: #797979;
    border-radius: 50%;
    transition: .5s;
}

input:checked+.slider {
    background-position: top;
    background-color: lightgreen;
}

input:focus+.slider {
    box-shadow: 0px 0px .25rem lightgreen;
}

input:checked+.slider::before {
    transform: translateX(2rem);
    transition: .5s;
}

.buttons {
    width: 25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: end
}

.modal {
    position: fixed;
    inset: 0;
    background-color: #21212180;
    display: none;
    /* escondido por padrão */
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.modal .card {
    width: 30rem;
    max-width: 90vw;
    height: auto;
    background-color: var(--light);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.modal .header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal .header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.modal .close {
    width: 2rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: var(--dark);
    color: var(--light);
    font-size: 1.5rem;
    line-height: 2rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal .close:hover {
    background-color: #555;
}

.modal .content {
    width: 100%;
    height: 100%;
}

/* Syntax Highlight */
.html,
.css,
.js,
.php {
    font-family: "Reddit Mono";
    width: 100%;
    position: relative;
    padding-top: 2px;
    margin: 16px 0;
    border-radius: 8px;
    background-color: #2f2f2f;
    flex-basis: auto;

    pre {
        font-optical-sizing: auto;
        font-style: normal;
        font-weight: 400;
        font-size: 1.125rem;
        line-height: 1.25rem;
        height: calc(100% - 24px);
        border-radius: 0 0 8px 8px;
        position: relative;
        padding: .5rem 1rem;
        border-top: 1px solid #fafafa;
        white-space: pre-wrap;
    }

    code {
        font-optical-sizing: auto;
        font-style: normal;
        color: #fafafa;
        border-radius: 4px;
    }
}

.html::before,
.css::before,
.js::before,
.php::before {
    content: "CODE";
    width: 100%;
    position: relative;
    height: 24px;
    padding: 4px 12px;
    line-height: 24px;
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    color: azure;
}

.html::after {
    content: "HTML";
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    color: azure;
    height: 24px;
    padding: 2px 12px;
    font-size: 14px;
    top: 0;
    right: 0;
}

.css::after {
    content: 'CSS';
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    color: azure;
    height: 24px;
    padding: 2px 12px;
    font-size: 14px;
    top: 0;
    right: 0;
}

.js::after {
    content: 'JS';
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    color: azure;
    height: 24px;
    padding: 2px 12px;
    font-size: 14px;
    top: 0;
    right: 0;

}

.php::after {
    content: 'PHP';
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    color: azure;
    height: 24px;
    padding: 2px 12px;
    font-size: 14px;
    top: 0;
    right: 0;
}

.note {
    width: fit-content;
    padding: 1rem;
    border: 1px solid #464646;
    border-radius: .5rem;
    background-color: lightyellow;
    margin-left: 1rem;
    margin-bottom: 1rem;

    code {
        color: black;
        line-height: 1.25rem;
    }
}

@media(min-width: 1921px) {
    html {
        font-size: 20px
    }

    .buttons {
        width: 30rem;
    }
}

@media(max-width: 1440px) {
    main {
        width: 80rem;
    }
}

@media(max-width: 1024px) {
    main {
        width: 60rem;
    }
}

@media(max-width: 768px) {
    main {
        width: 40rem;
    }
}

@media(max-width: 425px) {
    header {
        height: 8rem;
        position: relative;
        z-index: 100;

        .top-bar {
            width: 100%;
            height: 3rem;
            align-items: center;
            justify-content: center;
            gap: 0;
            flex-wrap: nowrap;
            flex-direction: column;

            .lead {
                font-size: .875rem;
                line-height: 1.25rem;
                text-align: center;
                margin: 0;
            }
        }

        nav {
            flex-direction: row-reverse;
            align-items: center;
            position: relative;
            padding: 0 1rem;
            z-index: 100;

            #toggleMenu {
                width: 3rem;
                height: 3rem;
                display: flex;
                justify-content: center;
                align-items: center;
                margin-right: 1rem;
            }

            h1 {
                margin-left: 1rem;
                font-size: 1.5rem;
            }

            #menu {
                width: fit-content;
                display: flex;
                flex-direction: column;
                background-image: var(--lingrad);
                position: absolute;
                top: 5rem;
                left: 0;
                transition: .5s;
                z-index: 1;
                transform: translateX(-101%);
                will-change: transform;
                border: 1px solid var(--mid);

                li {
                    width: 100%;

                    a {
                        width: 100%;
                        height: 3rem;
                        line-height: 3rem;
                    }
                }
            }

            .showMenu {
                transform: translateX(0%) !important;
            }
        }
    }

    main {
        width: 100%;
        padding: 1rem;

        .menu {
            width: 15rem;
            display: flex;
            position: absolute;
            overflow: visible;
            top: 0;
            left: 0rem;
            transform: translateX(-15rem);
            transition: .5s;

            &::after {
                content: "\f054";
                font: var(--fa-font-solid);
                width: 2rem;
                height: 2rem;
                box-sizing: border-box;
                position: absolute;
                top: 0;
                left: 14.75rem;
                background-color: var(--active);
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 1.5rem;
                border-radius: 0 1rem 1rem 0;
                color: var(--light);
            }
        }

        .showSubMenu {
            transform: translateX(0rem);
        }

        .contents {
            width: 100%;
        }
    }
}