@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

:root {
    --grey-color:#2a2a2b;
    /*--primary-color: #7364fc;*/
    --primary-color: #16192b;
    --card-bg: #e7defa;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", "Verdana", sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.6;
  
    background-image: linear-gradient(to right, #ff714a, #984aff);
}

li {
    list-style-type: none;
}

.main-wrapper {
    min-height: 100vh;
}

.title {
    font-weight: 800;
    
    margin-top: -2rem;
}

.btn {
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    border: none;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.4);
    transition: 0.2s;
    
}
.btn:hover {
    opacity: 80%;
    box-shadow: none;
}

/* search section */
.search-wrapper {
    margin: -6rem 0 4rem 0;
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
}

.main-title {
    font-size: 2rem;
}

.country-search-section {
    display: flex;
    justify-content: center;
    width: 100%;
}

.country-search-input {
    font-family: inherit;
    border-top-left-radius: 2rem;
    border-bottom-left-radius: 2rem;
    width: 50%;
    height: 40px;
    padding: 0.2rem 0.2rem 0.2rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--primary-color);
    border-right: none;
    background: none;
    color: var(--primary-color);
    outline: none;
}
.country-search-input::placeholder {
    color: var(--primary-color);
}

.country-search-btn {
    border-top-right-radius: 2rem;
    border-bottom-right-radius: 2rem;
    width: 40px;
    border: 1px solid var(--primary-color);
    border-left: none;
    color: var(--primary-color);
    background: none;
    box-shadow: none;
}

/* results */
.results-section {
    width: 100%;
    min-height: 50vh;
    margin-bottom: 40px;
    padding: 0 1rem;
} 

.failed-search {
    width: 100%;
    text-align: center;
    margin-bottom: 2rem;
}

.results-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

.country-card {
    margin: auto;
    margin-bottom: 2.1rem;
    padding: 1rem;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.4);
    width: 90%;
    border-radius: 1rem;
    background: var(--card-bg);
    
    margin-top: -2rem;
    
}

.country-card-flag-section {
    position: relative;
}

/* flag */
.country-card img {
    opacity: 0.6;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: calc(100% / 2rem);
    border-radius: 0.5rem;
}

.country-card-name {
    position: absolute;
    background: #fff;
    padding: 0.3rem 0.6rem;
    line-height: 1;
    top: 10px;
    left: 10px;
    border-radius: 1rem;
    font-size: 1.4rem;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.4);
}

.country-card-info {
    width: 100%;
}

.country-card-more-details {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-details-btn {
    width: 200px;
    text-align: center;
    background-color: var(--primary-color);
    border-radius: 1rem;
    padding: 0.5rem;
    color: #fff;
    margin: 0.5rem;
    transition: 0.2s;
}

/* more details */
.md-section {
}
.md-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.6);
    border-radius: 1rem;
    padding: 1rem;
    width: 90%;
    height: 90vh;
    overflow-y: scroll;
    z-index: 10;
}

.md-top-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.md-leave-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    border-radius: 100%;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
}

.md-title {
    font-size: 2rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.md-info-title {
    text-align: center;
    height: 40px;
    margin-top: 1rem;
    margin-bottom: 0.7rem;
    text-decoration: underline;
    font-size: 1.1rem;
}

.md-info-section {
    display: flex;
    flex-direction: column;
}

.md-info i {
    width: 30px;
    height: 10px;
}

.md-country-info,
.md-other-info {
    width: 100%;
    padding: 0 1rem 1rem 1rem;
}

.md-country-info {
    border-left: 1px solid black;
    border-top: 1px solid black;
    border-right: 1px solid black;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.md-other-info {
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    border-left: 1px solid black;
    border-bottom-right-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.md-flag img {
    border-radius: 0.5rem;
    box-shadow: 0px 0px 5px rgba(0,0,0,0.4);
    width: 100%;
}

.md-border-country {
    display: flex;
    justify-content: center;
    flex-direction: column;
    line-height: 1.2;
    margin-left: 2rem;
}

.md-border-country img {
    margin-right: 0.5rem;
    width: 25px;
    height: 15px;
}

/* media queries */ 
@media screen and (min-width: 768px) {
    .results-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .country-card-name {
        font-size: 1rem;
        width: 80%;
    }
    .md-info-section {
        flex-direction: row;
    }
    .md-country-info,
    .md-other-info {
        width: 50%;
    }
    .md-country-info {
        border: none;
        border-left: 1px solid black;
        border-top: 1px solid black;
        border-bottom: 1px solid black;
        border-radius: 0;
        border-top-left-radius: 0.5rem;
        border-bottom-left-radius: 0.5rem;
    }
    .md-other-info {
        border: none;
        border-right: 1px solid black;
        border-top: 1px solid black;
        border-bottom: 1px solid black;
        border-radius: 0;
        border-top-right-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }
}

/* turn 2 column grid into 3 column grid*/
@media screen and (min-width: 992px) {
    .results-list {
        grid-template-columns: repeat(3, 1fr);
    }
    .country-card-name {
        font-size: 1rem;
        width: 80%;
    }
}




/* ///////// */
html {
  font-size: 1rem;
}

.navbar-wrapper {
  width: 15%;
  height: 30vh;
  /* background: #eccc68; */
  display: flex;/* 
  justify-content: center;
  align-items: center; */
  justify-content: left;
  align-items: center;
  margin-left: 100px;
  
  /* border: 2px solid black; */
}

.navbar {
  width: 20rem;
  height: 20rem;
  /* background-color: #fd7272; */
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transform: scale(0) rotate(-180deg);
  transition: transfrom 0.5s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0) 0.23;  
  
}

.change .navbar {
  transform: scale(1) rotate(0);
  transition: all 1s;
}

.navbar-link {
  position: absolute;
}

.change .navbar i {
  font-size: 2.5rem;
  color: #53b457;
  transition: color 0.3s;
  font-size: 100%;
}

.navbar-link:hover i {
  color: #222;
}

.navbar-link:nth-child(1) {
  top: 5rem;
}

.navbar-link:nth-child(2) {
  top: 7rem;
  right: 2rem;
}


.navbar-link:nth-child(3) {
  bottom: 8rem;
  right: 2rem;
}


.navbar-link:nth-child(4) {
  bottom: 5rem;
}


.navbar-link:nth-child(5) {
  bottom: 6rem;
  left: 2rem;
}


.navbar-link:nth-child(6) {
  top: 7rem;
  left: 2rem;
}

.navbar-btn {
  position: absolute;
  width: 3rem;
  height: 3rem;
  background: #4a69bd;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); 
  margin-left: 70px; 
}

.navbar-btn i {
  font-size: 2rem;
  color: #53b457;
  transition: transform 0.5s;
}

.change .navbar-btn i {
  transform: rotate(45deg);
}

/* ///////// */



