*{
    box-sizing: border-box;
}

body{
    --background-color: white;
    --text-color: black;
    --elements-color: rgb(212 213 217 / 23%);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0%;
    font-family: "Nunito Sans";
    transition: all 0.3s ease-in-out;
}

body.dark {
    --background-color: hsl(207, 26%, 17%);
    --text-color: #ffffffcc;
    --elements-color: hsl(209, 23%, 22%);
    transition: all 0.3s ease-in-out;
}

.title{
    font-weight: 800;
}

.header-container{
    background-color: var(--elements-color);
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
}

.header-container p{
    cursor: pointer;
}
.header-content{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-inline: auto;
    max-width: 1200px;
    padding-inline: 24px;
}

main{
    padding: 24px;
}

.search-filter-container{
    max-width: 1200px;
    margin: 16px auto;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-by-region{
    padding: 10px 10px;
    width: 200px;
    border-radius: 4px;
    border: none;
    outline: none;
    background-color: var(--elements-color);
    color: var(--text-color);
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.3);
}
.search-container{
    max-width: 350px;
    width: 100%;
    padding: 4px 10px;
    background-color: var(--elements-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.3);
}
.search-container input{
    max-width: 100%;
    flex-grow: 1;
    border: none;
    outline: none;
    background-color: var(--elements-color);
    flex-grow: 1;
    padding: 8px 12px;
    font-size: 14px;
}

.search-container input::placeholder{
    color: grey;
}
.search-container i{
    font-size: 16px;
}
.countries-container{
    max-width: 1200px;
    margin-top: 16px;
    margin-inline: auto;
    display: flex;
    justify-content: space-between;
    gap: 50px;
    flex-wrap: wrap;
}

a{
    text-decoration-line: none;
    color: inherit;
}

.country-card{
    display: inline-block;
    width: 250px;
    border-radius: 5px;
    background-color: var(--elements-color);
    box-shadow: 1px 1px 8px 1px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding-bottom: 24px;
    transition: transform 0.3s ease-in-out;
}

.country-card:hover{
    box-shadow: 1px 1px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.03);
    cursor: pointer;
}
.country-card img{
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-text{
    padding-inline: 16px;
}

.card-text p{
    margin-block: 8px;
}
.card-title{
    font-size: 20px;
    margin-block: 14px;
}

/* Country CSS */

.container{
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}

.back-btn{
    margin-block: 20px;
}
.btn{
    border: none;
    padding: 8px 20px;
    font-size: 16px;
    background-color: var(--elements-color);
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.country-container{
    width: 100%;
    margin-block: 30px;
    padding: 16px;
    display: flex;
    align-items: center;
}

.country-details{
    width: 80%;
    padding: 40px;
}

.country-details h1{
    margin-top: 0;
}
.country-flag{
    max-width: 500px;
}

.country-flag img{
    object-fit: cover;
    width: 100%;
}
.content{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.border-container{
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.near-countries{
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 700px){
    .country-container{
        flex-wrap: wrap;
        justify-content: center;
    }

    .country-details{
        width: 100%;
        padding: 10px 10px;
    }

    .search-filter-container{
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

@media (max-width: 950px){
    .country-details{
        padding-right: 0;
    }

    .countries-container{
        justify-content: center;
    }
    .sub-content1{
        margin-right: 10px;
    }
}