@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400&display=swap');

.dark-theme {
  --background-color: hsl(207, 26%, 17%);
  --header-color: hsl(209, 23%, 22%);
  --text-color: #fff;
}

.light-theme {
  --background-color: hsl(0, 0%, 98%);
  --header-color: hsl(0, 0%, 100%);
  --text-color: hsl(200, 15%, 8%);
}

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

body {
  background-color: var(--background-color);
  font-family: 'Nunito Sans', sans-serif;
}

.container {
  position: relative;
}

.single-country-display {
  position: absolute;
  top: 4rem;
  left: 3rem;
  width: calc(100% - 6rem);
  height: calc(100vh - 4rem);
  z-index: 2;
  display: none;
  background-color: var(--background-color);
}
.single-country-display button {
  padding: .5rem 2rem;
  margin: 1rem 0 2rem;
  box-shadow: 0px 5px 5px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.single-country-display button .fa-solid {
  margin-right: .75rem;
}
.single-country-display > div {
  background-color: var(--background-color);
  width: 100%;
  height: calc(100% - 5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 2rem;
}
.single-country-display article {
  background-color: var(--background-color);
  box-shadow: unset;
}
.single-flag {
  max-width: 46.6875rem;
  width: 100%;
  height: 18rem;box-shadow: 0px 5px 5px 3px rgba(0, 0, 0, 0.1);
}
.single-flag img {
  object-fit: cover;
  height: 100%;
  width: 100%;
  box-shadow: 0px 5px 5px 3px rgba(0, 0, 0, 0.1);
}
.single-country-details .fl-left *+*,
.single-country-details .fl-right *+* {
  margin-top: .6rem;
}
.single-country-details p, .single-country-details h2 {
  margin: unset;
}
.single-country-details p {
  font-size: .8rem;
}
.single-country-details h2 {
  font-size: 1rem;
  font-weight: bold;
  margin-top: 2rem;
}

.fl-left, .fl-right {
  margin-top: 1.4rem;
}
.fl-down p {
  font-size: 1rem;
  font-weight: bold;
  padding-bottom: 1rem;
}
.fl-down {
  padding: unset;
  margin: 1.4rem 0;
}
.fl-down span {
  margin-right: .3rem;
  font-size: .8rem;
  padding: .25rem .4rem;
  border: 1px solid hsl(206, 12%, 78%);
  border-radius: 3px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 3rem;
  font-size: 0.55rem;
  background-color: var(--header-color);
  box-shadow: 0px 10px 15px 3px rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  z-index: 3;
}
header button {
  border: none;
  display: flex;
  font-size: 0.7rem;
  background-color: var(--header-color);
  color: var(--text-color);
  cursor: pointer;
}
.theme-icon{
  margin-right: 0.5rem;
}
header div p {
  margin-left: 0.4rem;
}

form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0rem 3rem;
  margin: 1.7rem 0;
}
input[type='text'] {
  max-width: 18.5rem;
  width: 90%;
  padding: 0.65rem 2rem;
  font-size: 0.7rem;
  border: none;
  border-radius: 5px;
  background-color: var(--header-color);
  box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  background-image: url(../images/search.svg);
  background-size: 0.8rem;
  background-repeat: no-repeat;
  background-position: 0.5rem;
  color: var(--text-color);
}

.custom-select {
  position: relative;
  font-family: Arial;
  width: 8rem;
}
.custom-select select {
  display: none;
}
.select-selected {
  background-color: var(--header-color);
  color: var(--text-color);
  border-radius: 4px;
  box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.select-selected:after {
  position: absolute;
  content: '';
  top: 14px;
  right: 10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-color: var(--text-color) transparent transparent transparent;
}
.select-selected.select-arrow-active:after {
  border-color: transparent transparent var(--text-color) transparent;
  top: 7px;
}
.select-items div,
.select-selected {
  color: var(--text-color);
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem;
  border: 1px solid transparent;
  border-color: transparent transparent rgba(0, 0, 0, 0.1) transparent;
  cursor: pointer;
}
.select-items {
  position: absolute;
  background-color: var(--header-color);
  color: var(--text-color);
  top: 105%;
  left: 0;
  right: 0;
  z-index: 99;
}
.select-hide {
  display: none;
}
.select-items div:hover,
.same-as-selected {
  background-color: rgba(0, 0, 0, 0.1);
}

.countries-display {
  width: calc(100% - 6rem);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.3rem, 1fr));
  gap: 3rem;
}

article {
  background-color: var(--header-color);
  border-radius: 6px;
  color: var(--text-color);
  padding-bottom: 1rem;
  letter-spacing: 0.07rem;
  line-height: 1rem;
  box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
article h2 {
  font-size: 0.85rem;
  margin: 0.8rem;
}
article p {
  font-size: 0.7rem;
  margin: 0.3rem 0.8rem 0.3rem 0.8rem;
  margin-bottom: 0.3rem;
}
article .flag {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  height: 8.2rem;
  margin-bottom: 1.2rem;
}
article .flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 966px) {
  .single-country-display>div {
    gap: 7rem;
  }

  .fl-left {
    float: left;
  }

  .fl-right {
    float: right;
  }

  .fl-down {
    clear: both;
    padding-top: 2rem;
  }

  .fl-down p {
    display: inline;
  }

  .fl-down div {
    display: inline;
  }
}

@media (max-width: 34.6875rem) {
  form {
    flex-direction: column;
    align-items: flex-start;
  }

  input[type='text'] {
    margin-bottom: 1.5rem;
  }
}