@import url("https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Figtree:ital,wght@0,300..900;1,300..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Outfit:wght@100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Rubik:ital,wght@0,300..900;1,300..900&family=Young+Serif&display=swap");

:root {
    --darkModeElements: hsl(209, 23%, 22%);
    --DarkModeBg: hsl(207, 26%, 17%);
    --LightModeText: hsl(200, 15%, 8%);
    --LightModeInput: hsl(0, 0%, 52%);
    --LightModeBg: hsl(0, 0%, 98%);
    --white: hsl(0, 0%, 100%);
}

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: "Nunito Sans", serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings:
        "wdth" 100,
        "YTLC" 500;
}

body {
    background-color: var(--LightModeBg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    color: var(--LightModeText);
}

header {
    display: flex;
    justify-content: space-between;
    padding-inline: 2rem;
    background-color: var(--white);
    box-shadow: 0px 0px 5px var(--LightModeInput);

    button {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        background-color: transparent;
        border: none;
        color: var(--LightModeText);
        transition: all 0.1s ease-in;

        &:hover {
            cursor: pointer;
            scale: 1.2;
        }
    }

    padding: 1rem;
    padding-inline: 4rem;
}

main {
    flex-grow: 1;
    height: 100vh;
}

.border {
    display: flex;
    gap: 8px;
    align-items: center;

    div {
        display: flex;
        gap: 1rem;

        button {
            outline: none;
            border: none;
            padding-inline: 2rem;
            border-radius: 4px;
            padding-block: 0.5rem;
            color: var(LightModeText);
            background-color: white;

            &:hover {
                cursor: pointer;
                scale: 1.1;
            }
        }
    }
}

.botonvolver {
    padding-inline: 2rem;
    padding-block: 1rem;
    outline: none;
    border: none;
    color: var(LightModeText);
    background-color: white;
    border-radius: 8px;
    margin-block: 3rem;
    max-width: 150px;

    &:hover {
        scale: 1.1;
        cursor: pointer;
    }
}

.main {
    display: flex;
    justify-content: center;
}

.sectionPais {
    display: flex;
    gap: 10rem;
    align-items: center;

    img {
        width: 560px;
        height: 400px;
    }

    .infoResume {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        justify-items: center;

        h1 {
            font-size: 32px;
        }

        p {
            margin-bottom: 8px;
        }
    }

    section {
        display: flex;
        gap: 10rem;
    }
}

footer {
    text-align: center;

    a {
        text-decoration: none;

        &:any-link {
            color: #09f;
            text-decoration: none;
        }
    }
}

.container-banderas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-height: 100vh;
    overflow: auto;
    gap: 5rem;
    padding-inline: 5rem;
    padding-block: 2rem;
}

.card {
    background-color: var(--white);
    width: 90%;
    border-radius: 8px;
    box-shadow: 0px 0px 1px var(--LightModeInput);

    &:hover {
        cursor: pointer;
    }

    img {
        border-top-right-radius: 8px;
        border-top-left-radius: 8px;
        width: 100%;
        height: 50%;
        object-fit: cover;
    }

    p,
    h1 {
        padding-inline: 1rem;
    }
}

.title {
    font-weight: bold;
    font-size: 20px;
    padding-block: 1rem;
}

.filters {
    display: flex;
    justify-content: space-between;
    padding-inline: 5rem;
    padding-top: 2rem;
}

.search {
    border-radius: 8px;
    background-color: white;
    padding: 1rem;
    display: flex;
    gap: 8px;
    box-shadow: 0px 0px 1px var(--LightModeInput);

    svg {
        stroke: var(--LightModeText);
    }

    input {
        outline: none;
        border: none;
        background-color: white;

        color: inherit;
    }
}

#filter {
    border: none;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0px 0px 1px var(--LightModeInput);

    &:hover {
        cursor: pointer;
    }

    svg {
        stroke: var(--LightModeInput);
    }
}

.modal {
    position: absolute;
    background-color: white;
    top: -1;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    border: none;
    margin-top: 4px;
    border-radius: 8px;
    padding: 10px;
    gap: 4px;
    box-shadow: 0px 0px 1px var(--LightModeInput);

    button {
        outline: none;
        border: none;
        color: var(--LightModeText);
        background-color: white;

        &:hover {
            cursor: pointer;
            scale: 1.1;
        }
    }
}

.filter-modal {
    position: relative;
}

.botonvolver {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 16px;

    svg {
        stroke: black;
    }
}

/*Modo Oscuro*/
.darkMode {
    background-color: var(--DarkModeBg);
    color: var(--white);

    .botonvolver {
        svg {
            stroke: white;
        }
    }

    .search {
        background-color: var(--darkModeElements);
        box-shadow: 0px 0px 1px var(--darkModeElements);

        input {
            background-color: var(--darkModeElements);
        }

        svg {
            stroke: white;
        }
    }

    .botonvolver {
        color: white;
        background-color: var(--darkModeElements);
    }

    #filter {
        background-color: var(--darkModeElements);
        color: white;
        box-shadow: 0px 0px 1px var(--darkModeElements);

        svg {
            stroke: white;
        }
    }

    header {
        background-color: var(--darkModeElements);
        box-shadow: none;
        border-radius: 8px;

        button {
            color: var(--white);
        }
    }

    .card {
        background-color: var(--darkModeElements);
        box-shadow: 0px 0px 1px var(--darkModeElements);
    }

    .modal {
        background-color: var(--darkModeElements);
        box-shadow: 0px 0px 1px var(--darkModeElements);

        button {
            color: white;
            background-color: var(--darkModeElements);
        }
    }

    .border {
        div {
            button {
                color: white;
                background-color: var(--darkModeElements);
            }
        }
    }
}

@media (width <=400px) {
    p {
        font-size: 14px;
    }

    .filters {
        display: block;
        padding-inline: 2rem;

        .search {
            margin-bottom: 1rem;
        }

        .modal {
            width: 49%;
        }
    }

    .container-banderas {
        grid-template-columns: 1fr;
        padding-inline: 2rem;

        .card {
            width: 100%;
        }
    }

    .main {
        display: block;

        img {
            width: auto;
            height: auto;
        }
    }

    .botonvolver {
        margin-block: 1rem;
        padding-block: 0.5rem;
    }

    .sectionPage {
        padding-inline: 2rem;

        .sectionPais {
            display: block;

            .infoResume {
                gap: 1rem;
            }

            .informacion {
                display: block;

                div {
                    margin-bottom: 1rem;
                }
            }

            .border {
                display: block;

                button {
                    margin-top: 1rem;

                    padding-inline: 4px;
                }
            }
        }
    }

    header {
        padding-inline: 1rem;

        h1 {
            font-size: 20px;
        }
    }
}
