@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;600;800&display=swap');

/*Generic CSS*/

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

}

:root {
    --color-dark-blue: hsl(209, 23%, 22%);
    --color-very-dark-blue: hsl(207, 26%, 17%);
    --color-very-dark-blue-plus: hsl(200, 15%, 8%);
    --color-dark-gray: hsl(0, 0%, 52%);
    --color-very-light-gray: hsl(0, 0%, 98%);
    --color-white: hsl(0, 0%, 100%);
    --color-box-shadow: rgb(0, 0, 0, .1);

    --font-main: 'Nunito Sans', sans-serif;

    --fs-xl: 2em;
    --fs-600: 1.8em;
    --fs-500: 1.4em;
    --fs-400: 1em;
}

html,
body {
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

body,
input,
textarea,
button {
    color: var(--font-color);
    font-family: var(--font-main);
}

body {
    position: relative;
    background-color: var(--secondary-color);
    line-height: 1.3;
    width: 200vw;
}

button,
a,
input {
    appearance: none;
    border: none;
    background: none;
    text-decoration: none;
}

header {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 50px;
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px var(--color-box-shadow);
    width: 100vw;
    z-index: 1;
}

header h1 {
    font-size: var(--fs-xl);
}

main {
    margin-top: 80px;
    width: 200vw;
}

section {
    width: 100vw;
    display: inline-block;
    transition: transform .2s ease-out;
}

section.active {
    transform: translateX(-100%);
}

/*First section*/

.highlight{
    background-color: var(--font-color);
    color: var(--secondary-color);
    opacity: .5;
}

.all-cards {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 50px;
}

.input-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.selects{
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.select-wrapper {
    position: relative;
}

.select-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;

    width: 25px;
    height: 25px;
}

select {
    position: relative;
    appearance: none;
    background-color: transparent;
    border: none;
    outline: none;

    border-radius: 5px;
    padding: 15px 40px 15px 15px;
    cursor: pointer;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--color-box-shadow);
    color: var(--font-color);
}

select:focus-visible {
    outline: -webkit-focus-ring-color auto 1px;
}

button {
    display: flex;
    justify-items: center;
    align-items: center;
    gap: 10px;
    appearance: none;
    background: none;
    border: none;
    cursor: pointer;
}

ion-icon {
    flex-shrink: 0;
    width: 1.8em;
    height: 1.8em;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px var(--color-box-shadow);
    background-color: var(--primary-color);
    flex-shrink: 1;
}

.search-wrapper input[type="search"] {
    position: relative;
    appearance: none;
    outline: none;
    background: none;
    border: none;
    width: 100%;
}

.cards-table {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 50px;
}

.card {
    display: flex;
    flex-direction: column;
    background-color: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--color-box-shadow);
    transition: transform .2s ease-out;
}

.card:hover {
    transform: translateY(-10px)
}

.card .flag {
    border-radius: 10px 10px 0 0;
    width: 100%;
    object-fit: cover;
}

.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 30px 20px 40px;
}

.bolder {
    font-weight: bold;
}

/*Second Section*/

.country-card {
    float: right;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    padding: 50px;

    display: none;
}

.country-wrapper {
    display: flex;
    flex-direction: row;
    gap: 50px;
    width: 100%;
}

.country-flag {
    height: 100%;
    flex: 1;
    border-radius: 5px;
}

.country-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 20px;
}

.country-stats-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 50px;
}

.country-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.country-borders {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bttn-back-section,
.country-border {
    background-color: var(--primary-color);
    padding: 8px 25px;
    border-radius: 5px;
    box-shadow: 0 0 10px var(--color-box-shadow);
}

/*Media Queries*/

@media all and (max-width: 1280px) {
    .cards-table {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media all and (max-width: 900px) {
    .cards-table {
        grid-template-columns: repeat(2, 1fr);
    }

    .country-wrapper {
        flex-direction: column;
    }

    .country-content {
        gap: 40px;
    }
}

@media all and (max-width: 720px) {
    :root {
        --fs-xl: 1.5rem;
        --fs-600: 2rem;
        --fs-500: 1.5rem;
        --fs-400: 1rem;
    }

    .cards-table {
        grid-template-columns: repeat(1, 1fr);
        width: 90%;
        align-self: center;
    }

    .input-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .search-wrapper {
        width: 100%;
    }
}