
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
}

body {
  max-width: 100vw;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgb(252, 252, 252);
  font-family: "Nunito Sans", serif;;
}

a {
  color: rgb(17, 21, 23)
}

.dark-mode {
  background: #202c37;
  color: #ffffff;
}

/* ----------------------------------------GENERAL DARK MODE------------------------------------------------- */

body.dark-mode {
  background-color: #202c37;
  color: #ffffff;
}

/* Navbar */
body.dark-mode .navBar {
  background-color: #2b3743;
  color: white;
}

body.dark-mode .navBar a {
  color: white;
}

/* Botón */
body.dark-mode .mode {
  background: transparent;
  color: white;
}

/* Filtro */
body.dark-mode .filter,
body.dark-mode .filter-search,
body.dark-mode .filter-search input,
body.dark-mode .filter-search input::placeholder,
body.dark-mode .filter-region,
body.dark-mode .filter-region-toggle,
body.dark-mode .region,
body.dark-mode .region-option {
  background-color: #202c37;
  color: white;
}

/* Tarjetas */
body.dark-mode .card-country,
body.dark-mode .card-country .country-stats p span {
  background-color: #2b3743;
  color: white;
  box-shadow: none;
}

/* Footer */
body.dark-mode footer {
  color: white;
}

.navBar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 5vw;
  background: rgb(255, 255, 255);
  box-shadow: 0 0 5px 1px rgba(0, 0, 0, .2);
}

.navBar h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

@keyframes zoomInOut {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}


.country-game {
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0 1rem;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4rem;
  background: linear-gradient(to bottom left, #3b3b3b, #acacac, #eaeaea);
  animation: zoomInOut .5s ease infinite;
  /* transition: all .3s ease; */
}

.country-game:hover {
  transform: scale(1.1);
}

.navBar .mode {
  display: flex;
  padding: 0 1rem;
  gap: .5rem;
  align-items: center ;
  justify-content: space-around;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: rgb(128, 128, 128);
  transition: all .3s ease;
  border-radius: 50rem;
}

.navBar .mode:hover {
  background: rgb(235, 235, 235);
  color: rgb(88, 88, 88);
}

.mode i {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}



/*--------------------------------------------FILter-------------------------------------------------*/

/* Filtro contenedor */
.filter {
  width: 100%;
  display: flex;
  flex-direction: column; /* mobile */
  align-items: center;
  gap: 2rem;
  padding: 2rem 5vw;
}

/* Campo de búsqueda */
.filter .filter-search {
  width: 100%;
  max-width: 30rem;
  height: 3.5rem;
  background: #fff;
  border-radius: .4rem;
  box-shadow: 0 0 10px .1px rgba(0, 0, 0, .1);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
}

.filter .filter-search i {
  font-size: 1.2rem;
  color: rgba(88, 88, 88, .8);
}

.filter .filter-search input {
  flex: 1;
  height: 100%;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.8);
  border: none;
  outline: none;
}

input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

/* Selector de región */
.filter-region {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 20rem;
}

.filter-region-toggle {
  padding: 1.2rem 1.5rem;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: .3rem;
  box-shadow: 0 0 10px .1px rgba(0, 0, 0, .1);
  width: 100%;
}

.region {
  min-width: 100%;
  position: absolute;
  top: 100%;
  left: 0;
  border: none;
  display: none; /* mostrar con JS */
  z-index: 100;
  padding: 1rem 1.5rem;
  background: #fff;
  box-shadow: 0 0 10px .1px rgba(0, 0, 0, .1);
  border-radius: .3rem;
}

.region-option {
  padding: 0.5rem 0;
  cursor: pointer;
}

.region-option:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.2rem;
}

.clicked {
  display: block;
}

.region-option {
  padding: .2rem .5rem;
  cursor: pointer;
  border-radius: 1rem;
  width: 100%
}

.region-option:hover {
  background-color: #f3f3f3;
}

/* 🖥️ Estilos para pantallas grandes */
@media (min-width: 768px) {
  .filter {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5vw;
  }
}

/*--------------------------------------------MAIN CONTENT-------------------------------------------------*/

.main-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2rem 5vw;
}

/* 3 columnas en pantallas grandes tipo laptop */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2 columnas en tablets */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 columna en móviles */
@media (max-width: 600px) {
  .main-content {
    grid-template-columns: 1fr;
    /* width: 100%;
    justify-content: center; */
  }
}


.card-country {
  background-color: rgb(185, 185, 185);
  border-radius: 0.625rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1);
  padding: 1.5rem;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card-country:hover {
  transform: translateY(-0.3125rem);
}

.card-country img {
  width: 100%;
  height: 9.375rem; /* 150px */
  object-fit: cover;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.card-country .country-name {
  margin: 1rem 0;
  font-size: 1.2rem;
}

.country-stats {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.card-country p {
  font-weight: bold;
  display: inline;
}

.card-country span {
  display: inline;
  margin-left: 0.25rem;
  color: #555;
}


footer {
  color: rgba(0, 0, 0, .3);
  padding: 0 4.8rem;  
}

footer span {
  color: rgba(0, 0, 0, 1);
}