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

body {
  width: 100%;
  height: 100vh;
  background-color: #2c3333;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  overflow-x: hidden;
}

.nav-bar {
  width: 100vw;
  height: 15vh;
  background-color: rgb(255, 90, 90);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}

.nav-bar .search-countries {
  padding: 1rem;
  width: 50vw;
  color: #121212;
  font-size: 1.2rem;
  border: none;
  outline: none;
  border-radius: 0.5rem;
  transition: 100ms ease-in-out;
  cursor: text;
}

.nav-bar .search-countries:focus {
  outline: 3px solid #1f87ff;
}

.countries-container {
  width: inherit;
  height: inherit;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  padding: 20px;
}

.countries-container .flags {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 150ms ease-in-out;
  border-radius: 0.5rem;
}

.countries-container .flags-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  border: 2px solid #000;
  width: 250px;
  height: 150px;
  border-radius: 0.5rem;
}

.countries-container .country-name {
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 2rem;
  position: absolute;
  top: 0%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 150ms ease-in-out;
  opacity: 0;
}

.countries-container .flags-container:hover .country-name {
  opacity: 1;
  background-color: rgba(49, 49, 49, 0.6);
}

.countries-container .flags-container.hide {
  display: none;
}

@media (max-width: 768px) {
  .countries-container {
    grid-template-columns: 1fr;
    width: 95vw;
    margin-top: 20px;
  }
  .countries-container .flags-container {
    width: 90vw;
  }

  .nav-bar .search-countries {
    font-size: 1rem;
    width: 80vw;
  }
}
