* {
  padding: 0;
  margin: 0;
  scroll-behavior: smooth;
  box-sizing: border-box;
  font-family: "Nunito Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
  transition-property: color, background;
  transition-duration: 0.04s;
  /* transition-duration: 5s; */
}
:root {
  --Dark-Mode-Elements: hsl(209, 23%, 22%);
  --Dark-Mode-Background: hsl(207, 26%, 17%);
  --Dark-Mode-Text: hsl(0, 0%, 100%);
  --Light-Mode-Text: hsl(200, 15%, 8%);
  --Light-Mode-Input: hsl(0, 0%, 52%);
  --Light-Mode-Background: hsl(0, 0%, 98%);
  --Light-Mode-Elements: hsl(0, 0%, 100%);
}

body {
  max-width: 1440px;
  margin: 0 auto;
  background-color: var(--Light-Mode-Background);
  color: var(--Light-Mode-Text);
}
body.dark-mode {
  color: var(--Dark-Mode-Text);
  background-color: var(--Dark-Mode-Background);
}
body nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  margin-bottom: 30px;
  background-color: var(--Light-Mode-Elements);
  box-shadow: 0 2px 3px 0 rgba(140, 140, 140, 0.2);
}
body.dark-mode nav {
  background-color: var(--Dark-Mode-Elements);
  box-shadow: 0 0 3px 0 rgba(44, 44, 44, 0.4);
}
nav .dark-mode-btn {
  cursor: pointer;
  padding: 5px;
}
nav .dark-mode-btn i {
  margin-right: 5px;
  font-size: 14px;
}
nav .dark-mode-btn p {
  display: inline-block;
}
.section-1 {
  padding: 0 70px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 15px;
}
.section-1 .search-box {
  width: 300px;
  height: 40px;
  padding: 8px 20px;
  box-shadow: 0 0 3px 0 rgba(140, 140, 140, 0.5);
  background-color: var(--Light-Mode-Elements);
  border-radius: 3px;
}
.section-1 i {
  padding-right: 10px;
  font-size: 14px;
  color: var(--Light-Mode-Input);
}
.section-1 input {
  margin-right: 10px;
  padding-left: 5px;
  height: 100%;
  width: 80%;
  border: none;
  outline: none;
  color: var(--Light-Mode-Input);
  background-color: transparent;
}
.section-1.dark-mode .search-box {
  background-color: var(--Dark-Mode-Elements);
  box-shadow: 0 0 3px 0 rgba(44, 44, 44, 0.4);
}
.section-1.dark-mode i {
  color: var(--Dark-Mode-Text);
}
.section-1.dark-mode input {
  color: var(--Dark-Mode-Text);
}
.section-1.dark-mode input::placeholder {
  color: var(--Dark-Mode-Text);
}
.dropdown {
  box-shadow: 0 0 3px 0 rgba(140, 140, 140, 0.5);
  background-color: var(--Light-Mode-Elements);
  width: 180px;
  height: 35px;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}
.section-1.dark-mode .dropdown {
  background-color: var(--Dark-Mode-Elements);
  box-shadow: 0 0 3px 0 rgba(44, 44, 44, 0.4);
}
.dropdown::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 5px;
  height: 5px;
  border: 2px solid var(--Dark-Mode-Background);
  border-left: none;
  border-top: none;
  transform: rotate(-45deg) translate(0, -50%);
  transition: transform 0.2s;
}
.dropdown.active::before {
  color: red;
  transform: rotate(45deg) translate(-2px, -50%);
}
.section-1.dark-mode .dropdown::before {
  border: 2px solid var(--Light-Mode-Background);
  border-left: none;
  border-top: none;
}
.dropdown li {
  list-style-type: none;
}
.dropdown .dropdown-main-box {
  padding: 0px 10px;
  width: 100%;
  height: 100%;
}

.dropdown-main-box i {
  color: var(--color3);
  line-height: 30px;
}
.dropdown input {
  font-size: 14px;
  font-weight: bold;
  margin-left: 5px;
  border: none;
  outline: none;
  width: 80%;
  display: inline;
  background-color: transparent;
  color: var(--Light-Mode-Text);
  cursor: pointer;
}
.dropdown .options {
  padding: 10px 0;
  height: auto;
  position: absolute;
  top: 45px;
  z-index: 22;
  border-radius: 3px;
  width: 100%;
  background-color: var(--Light-Mode-Elements);
  box-shadow: 0 0 3px rgba(161, 97, 97, 0.3);
  display: none;
}
.section-1.dark-mode .dropdown .options {
  background-color: var(--Dark-Mode-Elements);
}
.options .option {
  padding: 5px 15px;
  color: var(--Light-Mode-Text);
  width: 100%;
  font-size: 14px;
}
.section-1.dark-mode .options .option {
  color: var(--Dark-Mode-Text);
}
.options .option:hover {
  background-color: var(--Light-Mode-Background);
}
.section-1.dark-mode .options .option:hover {
  background-color: var(--Dark-Mode-Background);
}
.dropdown.active .options {
  display: block;
}

.section-2 {
  padding: 0 50px;
  margin: 40px 0;
  min-height: 45vh;
}
.preloader {
  /* background-color: red; */
  height: 40px;
  width: 40px;
  margin: auto;
  margin-top: 15vh;
  color: var(--Dark-Mode-Background);
  animation: spin 2.5s linear infinite;
}
body.dark-mode .preloader {
  color: var(--Light-Mode-Elements);
}
@keyframes spin {
  0% {
    transform: rotate(360deg);
  }
}

.section-2 a {
  text-decoration: none;
}
.section-2 .countries {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}
.section-2 .country {
  flex-basis: 20%;
  min-width: 200px;
  background-color: var(--Light-Mode-Elements);
  border-radius: 5px;
  margin-right: 40px;
  margin-bottom: 40px;
  height: auto;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 3px 0 rgba(140, 140, 140, 0.5);
}
.section-2.dark-mode .country {
  background-color: var(--Dark-Mode-Elements);
}
.section-2 .country img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(232, 232, 232, 0.5);
}
.section-2 .country .country-details {
  padding: 20px 10px 45px 25px;
}

.section-2 .country .country-details h3 {
  text-transform: capitalize;
  margin-bottom: 18px;
  color: var(--Light-Mode-Text);
}
.section-2.dark-mode .country .country-details h3 {
  color: var(--Dark-Mode-Text);
}
.section-2 .country .country-details p {
  color: var(--Dark-Mode-Elements);
  font-size: 14px;
  margin-bottom: 5px;
  text-transform: capitalize;
}
.section-2.dark-mode .country .country-details p {
  color: var(--Dark-Mode-Text);
}
#top {
  width: 40px;
  height: 40px;
  background-color: var(--Light-Mode-Elements);
  position: fixed;
  bottom: 30px;
  right: 20px;
  color: var(--Light-Mode-Text);
  box-shadow: 0 0 8px rgba(140, 140, 140, 0.5);
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  animation: bounce 1s ease-in infinite;
  display: none;
  z-index: 99999;
}
#top.active {
  display: flex;
}
body.dark-mode #top {
  background-color: var(--Dark-Mode-Elements);
  color: var(--Dark-Mode-Text);
}

@keyframes bounce {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-3px);
  }

  100% {
    transform: translateY(0px);
  }
}
#top i {
  font-size: 16px;
}
#see-more {
  text-align: center;
  transform: translateY(15px);
  cursor: pointer;
  color: rgb(98, 98, 98);
  text-transform: none;
  /* text-decoration: underline; */
}
#see-more:hover {
  color: rgb(0, 0, 0);
}
.section-2.dark-mode #see-more {
  color: rgb(196, 196, 196);
}
.section-2.dark-mode #see-more:hover {
  color: rgb(228, 228, 228);
}

/* styles for detailed page */

.back-home {
  color: var(--Light-Mode-Text);
  display: inline-block;
  font-size: 14px;
  text-decoration: none;
  margin-left: 60px;
  margin-top: 20px;
  padding: 7px 20px;
  border-radius: 2px;
  background-color: var(--Light-Mode-Elements);
  box-shadow: 0 0 3px 0 rgba(140, 140, 140, 0.7);
}
body.dark-mode .back-home {
  color: var(--Dark-Mode-Text);
  background-color: var(--Dark-Mode-Elements);
  box-shadow: 0 0 4px 0 rgba(31, 31, 31, 0.7);
}
.back-home i {
  margin-right: 5px;
  font-size: 12px;
}
.detail-section {
  padding: 0 50px;
  margin: 50px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--Light-Mode-Text);
  min-height: 45vh;
}
.detail-section.dark-mode {
  color: var(--Dark-Mode-Text);
}
.detail-section img,
.detail-section .details {
  min-width: 350px;
  margin-bottom: 40px;
}
.detail-section img {
  margin-right: 10px;
  flex-basis: 40%;
  height: 200px;
  object-fit: cover;
}
.detail-section .details {
  flex-basis: 45%;
}
.detail-section .details {
  padding: 30px 0;
}
.detail-section .details .country-name {
  margin-bottom: 20px;
}
.detail-section .details .detail-row {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.detail-section .details .detail-row .col-2 {
  max-width: auto;
}
.detail-section .details .detail-row .col-2 p {
  margin: 10px 0;
}
.detail-section .border-countries {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.detail-section.dark-mode .border-countries {
  color: var(--Dark-Mode-Text);
}
.detail-section .border-countries p {
  width: auto;
  margin-bottom: 20px;
}
.detail-section .border-countries .border {
  display: inline-block;
  padding: 5px 10px;
  border: none;
  background-color: var(--Light-Mode-Background);
  box-shadow: 0 0 3px rgba(28, 28, 28, 0.3);
  margin-right: 10px;
  margin-bottom: 20px;
}
.detail-section.dark-mode .border-countries .border {
  background-color: var(--Dark-Mode-Elements);
}
.footer {
  width: 100%;
  text-align: center;
  background-color: var(--Light-Mode-Elements);
  /* box-shadow: 0 -2px 5px rgba(179, 179, 179, 0.2); */
  height: 35vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
}
.footer.dark-mode {
  background-color: var(--Dark-Mode-Elements);
}
.footer p {
  color: var(--Light-Mode-Text);
}
.footer.dark-mode p {
  color: var(--Dark-Mode-Text);
}
.footer-social {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.footer-links {
  text-decoration: none;
  display: inline-block;
  color: var(--Light-Mode-Input);
  border: 1px solid var(--Light-Mode-Input);
  text-align: center;
  line-height: 35px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
}
.footer.dark-mode .footer-links {
  color: var(--Dark-Mode-Text);
  border: 1px solid var(--Dark-Mode-Text);
}
.footer-links:hover {
  background-color: var(--Light-Mode-Background);
  box-shadow: 0 0 4px var(--Light-Mode-Background);
}
.footer.dark-mode .footer-links:hover {
  background-color: var(--Dark-Mode-Background);
  box-shadow: 0 0 4px var(--Dark-Mode-Background);
}
.footer a {
  color: var(--Light-Mode-Input);
  text-decoration: none;
}
.footer.dark-mode a {
  color: var(--Dark-Mode-Text);
}

/* stylings for mobile view */
@media only screen and (max-width: 375px) {
  body nav {
    padding: 20px 15px;
    margin-bottom: 30px;
  }
  nav h3 {
    font-size: 16px;
  }
  nav .dark-mode-btn {
    font-size: 14px;
  }
  nav .dark-mode-btn i {
    margin-right: 2px;
    font-size: 12px;
  }
  .section-1 {
    padding: 0 15px;
  }
  .section-1 .search-box {
    width: 100%;
    /* margin-bottom: 30px; */
  }
  .section-1 i {
    padding-right: 10px;
    font-size: 14px;
  }
  .section-2 {
    padding: 0 50px;
    width: 100%;
  }
  .section-2 .countries {
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  .section-2 .country {
    min-width: 100%;
    margin: 0;
    margin-bottom: 40px;
  }
  .section-2 .country img {
    height: 150px;
  }
  .section-2 .country .country-details {
    padding: 20px 5px 40px 20px;
  }

  /* stylings for detail-page */

  .back-home {
    display: inline-block;
    margin-left: 25px;
    margin-top: 10px;
    padding: 5px 25px;
  }
  .detail-section {
    margin: 50px 0;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* flex-wrap: nowrap; */
    width: 100vw;
    padding: 0 25px;
  }
  .detail-section img,
  .detail-section .details {
    min-width: 100%;
  }
  .detail-section img {
    min-width: 180px;
    margin-right: 0px;
    width: 100%;
    height: 150px;
    object-fit: cover;
  }
  .detail-section .details {
    width: 100%;
  }
  .detail-section .details .detail-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    max-width: 100vw;
  }
  .detail-section .details .detail-row .col-2 {
    max-width: auto;
    margin-bottom: 40px;
  }
  .detail-section .border-countries {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    /* flex-wrap: wrap; */
    width: 200px;
  }
  .detail-section .border-countries p {
    width: auto;
    margin-bottom: 30px;
  }
  .detail-section .border-countries .border {
    font-size: 14px;
    padding: 8px 15px;
    margin-right: 5px;
    /* margin-bottom: 100px; */
  }
}
