:root {
    --Blue: hsl(209, 23%, 22%);
    --Dark-Blue: hsl(207, 26%, 17%);
    --Very-Dark-Blue: hsl(200, 15%, 8%);
    --Dark-Gray: hsl(0, 0%, 52%);
    --Very-Light-Gray: hsl(0, 0%, 98%);
    --White: hsl(0, 0%, 100%);
    --shadow-1: rgba(0, 0, 0, 0.3);
    --shadow-2: rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Nunito Sans", Arial, Helvetica, sans-serif;
}

a {
    text-decoration: none;
    font-weight: 500;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* Color modes */
.light-mode {
    background-color: var(--Very-Light-Gray);
    color: var(--Very-Dark-Blue);
}

.light-mode header,
.light-mode button,
.light-mode .cards,
.light-mode #region ul,
.light-mode #region p,
.light-mode #search-filter input[type="search"],
.light-mode a {
    background-color: var(--White);
    color: var(--Very-Dark-Blue);
}

.dark-mode {
    background-color: var(--Dark-Blue);
    color: var(--white); 
}

.dark-mode header,
.dark-mode button,
.dark-mode .cards,
.dark-mode #region ul,
.dark-mode #region p,
.dark-mode #search-filter input[type="search"],
.dark-mode #search-filter input[type="search"]::placeholder,
.dark-mode a {
    color: var(--White);
    background-color: var(--Blue);
}

.dark-mode .search-div i {
    color: var(--White);
}

/* header section */
header {
    box-shadow: 0 0 5px var(--shadow-2);
    margin-bottom: 2.5rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
}

.header h1 {
    font-size: 1.7rem;
}

.header button {
    font-size: 1.1rem;
    border: none;
    display: flex;
    align-items: center;
}

.header button i {
    margin-right: 0.5rem;
}


/* search and filter section */
#search-filter {
    margin-bottom: 2.8rem;
}

#search-filter form {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.search-div {
    position: relative;
}

.search-div i {
    position: absolute;
    left: 22px;
    top: 16px;
    font-size: 1rem;
}

#search-filter input[type="search"] {
    width: 430px;
    height: 50px;
    padding: 0.8rem 1rem 0.8rem 3.5rem;
    border: none;
    border-radius: 3px;
    box-shadow: 0 0 2px var(--shadow-1);
    font-size: 1.1rem;
    outline: none;
}

#region p {
    width: 230px;
    padding: 0.9rem 1.5rem;
    height: 50px;
    border-radius: 5px;
    box-shadow: 0 0 2px var(--shadow-1);
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#region ul {
    margin-top: 0.5rem;
    width: 230px;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 0 2px var(--shadow-1);
    font-size: 1.1rem;
    position: absolute;
    z-index: 2;
}

#region li {
    list-style: none; 
    padding: 0.3rem 0;
    font-size: 1.3rem;
}

.hidden {
    display: none;
}


/* countries section */
#countries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 3rem;
    justify-content: space-between;
}

.cards {
    border-radius: 5px;
    box-shadow: 0 0 3px var(--shadow-2);
}

.cards img {
    width: 100%;
    height: 170px;
}

.card-details {
    padding: 1.4rem 1.3rem;
}

.cards h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.cards p {
    margin-bottom: 0.8rem;
}

.prop-name {
    font-weight: 600;
    opacity: 0.9;
}


/* responsiveness - medium screens */
@media(max-width: 720px) {
    #search-filter form {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
    }

    #search-filter input[type="search"] {
        width: 100%;
        margin-bottom: 2rem;
    }
}

/* responsiveness - smaller screens */
@media(max-width: 500px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 1rem;
    }

    .header {
        padding: 1.5rem;
    }

    header {
        margin-bottom: 1.8rem;
    }

    .header h1 {
        font-size: 1.2rem;
        font-weight: 500;
    }
}