/* Basic Reset */
*,
*::after,
*::before{
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

html{
  /* 1 rem = 10px */
  font-size: 62.5%;
  font-family: sans-serif;
  text-align: center;
}

body{
  box-sizing: border-box;
  background-color: #ededed;
  height: 100vh;
  background: rgb(198, 198, 198);
}
 
img{
  /* responsive images inside div's */
  max-width: 100%; 
}

/* End of Reset */


/* LOADER */
.overlay {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  background: #222;
}

.overlay__inner {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  position: absolute;
}

.overlay__content {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.spinner {
  width: 75px;
  height: 75px;
  display: inline-block;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.05);
  border-top-color: #fff;
  animation: spin 1s infinite linear;
  border-radius: 100%;
  border-style: solid;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
#loading{
  visibility: hidden;
}

#loading.display{
  visibility: visible;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to{
    transform: rotate(360deg);
  }
}

/* END OF LOADER */

.container{
  max-width: 1200px;
  width: 80%;
  margin: 0 auto;
  position: relative;
}

.main{
  padding: 15rem 0;
  background-image: 
    linear-gradient(to bottom, rgba(126, 126, 126, 0.52), rgba(20, 20, 20, 0.73)),
    url("./img/globe-2.jpg");
  background-size: cover;
  background-blend-mode: multiply;
  color: white;
}

.header__title{
  text-transform: uppercase;
  font-size: 4rem;
  letter-spacing: 5px;
 
}

.header__total{
  font-size: 2rem;
}

.header__results{
  font-size: 1.5rem;
}
.header__title,
.header__total,
.header__results,
.main__buttons{
  margin-bottom: 1rem;
}

.main__button{
  cursor: pointer;
  border: none;
  padding: 10px 20px;
  border-radius: 3px;
  background-color: #9c41f2;
  color: aliceblue;
  font-family: inherit;
}

.selected,
.main__button:hover{
  background-color: #6621a7;
}

#search-input{
  font-family: inherit;
  font-size: 1.5rem;
  margin: 0 auto;
  padding: 1rem 2rem;
  border: none;
  width: 80%;
  transition: all .3s;

}

#search-input::placeholder{
  text-align: center;
}

#search-input:focus{
  outline: none;
  width: 35%;
}

#search-input__button{
  border: none;
  background: none;
}

.results{
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 3rem;
  justify-content: center;
}


.country{
  border-radius: 10px;
  border: 1px solid whitesmoke;
  display: grid;
  place-items: center;
  padding: 1rem;
  background-color: #1a1933;
  color: white;
  font-size: 1.4rem;

}


.country__flag img{
  background-size: cover;
}


.hidden{
  visibility: hidden;
}
.country__box{
  display: flex;
  flex-direction: column;
  height: 100%;
  align-content: space-between;
  justify-content: space-between;
}

.country__link{
  text-decoration: none;
  color: inherit;
  display: contents;
}

.modal{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 100;
  border: 1px solid black;
  border-radius: 5px;
  padding: 2rem;
  background-color: white;
  width: 60rem;
  max-width: 80%;
  transition: .2ms ease-in-out;
}

.modal.active{
  transform: translate(-50%, -50%) scale(1);

}

.modal-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid black;
  margin-bottom: 2rem;
}

.modal-header .close-button{
  background: none;
  border: none;
  outline: none;
  font-size: 3rem;
  cursor: pointer;
}
.modal-content{
  display: block;
}
.modal-content__flag{
  margin-bottom: 2rem;
}
.modal-content__info{
  font-size: 1.6rem;
}

.modal-content__info > p{
  margin-bottom: 2rem;
  text-align: left;
}
.modal-body{
  padding: 2rem 0;
}

#overlay {
  opacity: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0,0,0,0.75);
  z-index: 50;
  pointer-events: none;
  transition: .2ms ease-in-out;
}

#overlay.active{
  pointer-events: all;
  opacity: 1;
}

@media screen and (min-width: 1200px) {
  .country{
    width: 14rem;
    height: 14rem;
  }

  .modal-content__flag{
    width: 20rem;
  }

  .modal-content{
    display: flex;
    gap: 2rem;
  }

  
  #search-input{
    width: 40%;
  }
}