:root {
  --dark-blue-dark-mode-elements: hsl(209, 23%, 22%);
  --very-dark-blue-dark-mode-background: hsl(207, 26%, 17%);
  --very-dark-blue-light-mode-text: hsl(200, 15%, 8%);
  --dark-gray-light-mode-input: hsl(0, 0%, 52%);
  --very-light-gray-light-mode-background: hsl(0, 0%, 98%);
  --white-dark-mode-text-light-mode-elements: hsl(0, 0%, 100%);
  --containers-padding: 0 0.8rem;
}

.is-light-mode {
  --bg-color: var(--very-light-gray-light-mode-background);
  --bg-header: var(--white-dark-mode-text-light-mode-elements);
  --font-color: black;
}

.is-dark-mode {
  --bg-color: var(--very-dark-blue-dark-mode-background);
  --bg-header: var(--dark-blue-dark-mode-elements);
  --font-color: var(--white-dark-mode-text-light-mode-elements);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 300ms ease-in-out;
}

body {
  font-family: "Nunito Sans", sans-serif;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-color);
  color: var(--font-color);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid gray;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

header {
  height: 60px;
  background-color: var(--bg-header);
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.2);
}

.header-container {
  padding: var(--containers-padding);
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

h1 {
  font-size: 1.25rem;
}

.container-dark {
  display: flex;
}

.image-dark {
  height: 16px;
  color: var(--font-color);
}

.button-dark {
  background-color: var(--bg-header);
  color: var(--font-color);
  border: none;
  font-size: 0.75rem;
  margin-left: 5px;
}

.content-container {
  padding: var(--containers-padding);
  max-width: 1140px;
  margin: 0 auto;
}

.actions-container {
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
}

.search-container {
  background-color: var(--bg-header);
  align-items: center;
  height: 50px;
  display: flex;
  width: 100%;
  position: relative;
}

.image-search {
  height: 15px;
  z-index: 1;
  margin-left: 10px;
  color: var(--font-color);
}

.search {
  background-color: var(--bg-header);
  border: none;
  height: 50px;
  width: 100%;
  font-size: 0.75rem;
  padding-left: 35px;
  position: absolute;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
}

.select-regions {
  background-color: var(--bg-header);
  border: none;
  height: 50px;
  width: 50%;
  font-size: 0.75rem;
  color: var(--font-color);
  margin-top: 40px;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  padding: 0 0.5rem;
}

.countries-list {
  display: flex;
  flex-wrap: wrap;
  padding-top: 2rem;
  width: 100%;
  justify-content: center;
  gap: 30px;
}

.countries-list > a {
  text-decoration: none;
  color: var(--font-color);
  width: 90%;
}

.countries-list > a:visited {
  color: var(--font-color);
}

.card-country {
  width: 100%;
  height: 100%;
  background-color: var(--bg-header);
  border-radius: 5px;
  box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.1);
}

.flag-image {
  width: 100%;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.text-countries {
  padding: 10px;
}

.description-countries {
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.description-countries > span {
  font-size: 0.75rem;
}

.description-countries > span > span {
  font-weight: bold;
}

/* country detail page */

.container-detail-light {
  padding-top: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.container-flag {
  width: 100%;
}

.container-flag > img {
  width: 100%;
}

.container-button-back {
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.2);
  height: 35px;
  width: 120px;
  background-color: var(--bg-header);
  border-radius: 5px;
  margin-bottom: 40px;
}

.image-arrow {
  height: 15px;
  color: var(--font-color);
}

.button-back {
  background-color: var(--bg-header);
  color: var(--font-color);
  border: none;
  font-size: 0.75rem;
  margin-left: 5px;
  text-decoration: none;
}

.country-all-detail-container {
  width: 100%;
}

.country-all-detail-container > h2 {
  margin-top: 40px;
}

.country-details-container {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  margin-top: 10px;
  justify-content: space-between;
}

.country-details-container > div:last-child {
  margin-top: 20px;
}

.country-details-container p {
  margin-bottom: 5px;
  font-size: 0.75rem;
}

.country-details-container p > span:first-child {
  font-weight: bold;
}

.borders-container {
  display: flex;
  flex-direction: column;
  margin-top: 30px;
}

.borders-label {
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.border-list {
  display: flex;
  gap: 6px;
  /* padding: 0 6px; */
  flex-wrap: wrap;
}

.borders {
  font-size: 0.75rem;
  height: 20px;
  box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.2);
  text-align: center;
  text-decoration: none;
  color: var(--font-color);
  padding: 2px 6px 0 6px;
}

/* las media query sirven para validar las caracteristicas
del dispositivo en que se esta ejecutando la aplicacion y basados
en esas caracteristicas aplicar estilos especificos */

/*pantallas de tables y mas grandes */
@media screen and (min-width: 768px) {
  .countries-list {
    justify-content: space-between;
  }

  .countries-list > a {
    max-width: 180px;
    height: 260px;
  }

  .flag-image {
    max-height: 118px;
  }

  .container-detail-light {
    flex-direction: row;
  }

  .container-flag {
    width: calc(45% - 30px);
    height: 70px;
  }

  .container-flag > img {
    width: 90%;
  }

  .country-all-detail-container {
    width: calc(55% - 30px);
    padding: 0 30px 0 30px;
  }

  .country-all-detail-container > h2 {
    margin-top: 80px;
  }

  .country-details-container {
    flex-direction: row;
  }

  .country-details-container > div {
    width: 40%;
  }

  .country-details-container > div:last-child {
    margin-top: 0;
  }

  .borders-container {
    align-items: center;
  }

  .borders-container {
    flex-direction: row;
  }

  .borders-label {
    margin-bottom: 0px;
  }

  .border-list {
    padding: 0 6px;
  }
}

@media screen and (min-width: 992px) {
  .header-container {
    max-width: 1140px;
    margin: 0 auto;
  }
  .actions-container {
    flex-direction: row;
    justify-content: space-between;
  }

  .search-container {
    width: 40%;
  }

  .select-regions {
    margin-top: 0;
    width: 20%;
  }
}
