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

body {
  width: 100%;
  height: 100%;
  font-size: 62.5%;
  font-family: 'Nunito Sans', sans-serif;
}

body {
  color: hsl(200, 15%, 8%);
}

body.dark {
  color: hsl(0, 0%, 100%);
  background-color: hsl(207, 26%, 17%);
}
body.no-scroll {
  overflow: hidden;
}

body::-webkit-scrollbar {
  width: 0%;
}
h1 {
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -1px;
}
.header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.4rem;
  box-shadow: 0px 2px 8px 4px #76767664;
  background-color: hsl(0, 0%, 100%);
  z-index: 100;
  position: sticky;
  height: 6rem;
  top: 0;
  left: 0;
  transition: all 0.2s ease-in;
}

.header.dark {
  background-color: hsl(209, 23%, 22%);
  color: hsl(0, 0%, 100%);
  box-shadow: 0px 0.5px 8px 1px hsla(208, 23%, 22%, 0.783);
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 1.2rem;
  cursor: pointer;
}
.icon.hidden {
  display: none;
}

.theme-style {
  font-weight: 600;
}

.search--section {
  max-width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

.search--bar {
  position: relative;
  box-shadow: 0px 1px 8px 2px #99999964;
  width: 30%;
  height: 3.2rem;
  border-radius: 8px;
}
.search--bar.dark {
  box-shadow: 0px 0.5px 8px 1px hsla(208, 23%, 22%, 0.783);
}

.search--icon {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #666;
}
.search--bar > input {
  border-radius: 8px;
  font-size: 1.2rem;
  padding: 8px;
  padding-left: 2.4rem;
  border: none;
  width: 100%;
  height: 100%;
  outline: none;
  color: hsl(0, 0%, 52%);
  transition: all 0.2s ease-in;
}

input.dark {
  background-color: hsl(209, 23%, 22%);
  color: hsl(0, 0%, 100%);
}
.main--section {
  background-color: hsl(0, 0%, 98%);
  padding-top: 4.2rem;
  transition: all 0.2s ease-in;
}
input.dark:focus {
  background-color: hsl(209, 23%, 22%);
}

.main--section.dark {
  background-color: hsl(207, 26%, 17%);
}

.countries--container {
  max-width: 90%;
  margin: 0 auto;
  padding-block: 2.4rem;
  padding-top: 3.2rem;
  display: flex;
  /* column-gap: 4rem; */
  row-gap: 2.4rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

#region {
  border: none;
  background-color: white;
  font-size: 1.2rem;
  padding: 8px 12px;
  outline: none;
  box-shadow: 0px 1px 8px 2px #99999964;
  border-radius: 5px;
  /* width: 30%; */
  height: 3.2rem;
  transition: all 0.2s ease-in;
}
#region.dark {
  background-color: hsl(209, 23%, 22%);
  color: hsl(0, 0%, 100%);
  box-shadow: 0px 0.5px 8px 1px hsla(208, 23%, 22%, 0.783);
}

.country--leaf {
  width: 18rem;
  height: 24rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  background-color: hsl(0, 0%, 100%);
  box-shadow: 0px 1px 8px 2px #99999964;
  font-size: 1rem;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease-in;
}
.country--leaf.dark {
  background-color: hsl(209, 23%, 22%) !important;
  color: hsl(0, 0%, 100%);
  box-shadow: 0px 0.5px 8px 1px hsla(208, 23%, 22%, 0.783);
}

.country--leaf > img {
  width: 100%;
  height: 55%;
  box-shadow: 0px 0.5px 8px 1px #99999964;
}

.country--leaf--details {
  padding-inline: 1.4rem;
  margin-bottom: 1.4rem;
}

.country--leaf--details-name {
  font-size: 1.6rem;
  font-weight: 700;
}

/*error display*/

.error--display-overlay {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fee2e2;
  color: #ef4444;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 8px 16px;
  font-weight: 500;
  transition: all 2s ease-in;
  z-index: 200;
}

.error--display-overlay.hidden {
  opacity: 0;
  transform: translate(-50%, 2rem);
}

/*country-detail-onclick*/
/**************************/
.overlay--country--details--click {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* display: flex;
  justify-content: center;
  align-items: center; */
  background-color: #fff;
  /* margin-top: 3.2rem; */
  transition: all 0.4s ease-in;
}

.overlay--country--details--click.hidden {
  transform: scale(0);
}

.overlay--country--details--click.dark {
  background-color: hsl(207, 26%, 17%) !important;
  color: hsl(0, 0%, 100%) !important;
}
.arrow-back {
  position: fixed;
  top: 20%;
  left: 5%;
  box-shadow: 0px 0.5px 8px 1px #99999964;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease-in;
}
.arrow-back.dark {
  background-color: hsl(209, 23%, 22%);
  color: hsl(0, 0%, 100%);
  box-shadow: 0px 0.5px 8px 1px hsla(208, 23%, 22%, 0.783);
}

.arrow-back.hidden {
  display: none;
}

.section--country--details {
  width: 88%;
  margin: 0 auto;
  margin-top: 16rem;
  display: grid;
  grid-template-columns: 40fr 60fr;
  /* align-items: center; */
  column-gap: 6.4rem;
  height: 100%;
}

.country-flag {
  width: 100%;
}
.country--details--info {
  margin-top: 1.2rem;
}

.country--detail--name {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 1.2rem;
}

.country--detail--general-box {
  display: grid;
  width: 100%;
  grid-template-columns: 50fr 50fr;
  margin-bottom: 3.2rem;
  row-gap: 0.6rem;
  font-size: 0.9rem;
}

.country--details--border {
  display: flex;
  width: 100%;
  gap: 1.2rem;
  font-size: 1rem;
  align-items: center;
  /* justify-content: center; */
  /* flex-wrap: wrap; */
}

.border-country-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 70%;
}

.border--country--individual {
  box-shadow: 0px 0.5px 8px 1px hsla(208, 23%, 22%, 0.783);
  padding: 6px 24px;
  font-size: 12px;
  cursor: pointer;
  /* margin-left: auto; */
}

/*back to top*/
.back-to-top {
  position: fixed;
  bottom: 0.8rem;
  right: 1.4rem;
  /* border: 1px solid black; */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.7rem;
  border-radius: 50%;
  font-size: 1.2rem;
  background-color: hsl(207, 26%, 17%);
  cursor: pointer;
}

.back-to-top.dark {
  background-color: hsl(0, 0%, 98%);
}
.back-to-top > i {
  color: #f7f7f7;
}

.back-to-top > i.dark {
  color: hsl(207, 26%, 17%);
}
