@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    background: rgba(26, 166, 185, 0.45);
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: rgb(255, 255, 255);
}

::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.835);
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(1, 252, 244);
}

.mainContainer {
    width: 30rem;
    height: 40rem;
    padding: 1rem;
    overflow: hidden;
    position: relative;
    border-radius: 1.9rem;
    background: rgb(26, 174, 185);
}

.mainContainer .title {
    color: #ffffff;
    font-size: 1.6rem;
    margin-top: 0.5rem;
    text-align: center;
}

.fromCurrencyInput {
    display: flex;
    margin-top: 1rem;
    padding-top: 0.2rem;
    border-radius: 0.5rem;
    padding-bottom: 0.2rem;
    border: 2px dashed #ffffffc4;
    justify-content: space-between;
}

.fromCurrencyInput input {
    border: 0;
    width: 9.5rem;
    font-size: 1rem;
    color: #ffffff;
    text-align: right;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    background: transparent;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

.fromCurrencyInput input:focus {
    border: 0;
    outline: none;
}

.fromCurrencyInput input::placeholder {
    color: #ffffff;
    font-size: 1rem;
}

#flag {
    display: flex;
    height: 2.5rem;
    cursor: pointer;
    color: #ffffff;
    margin-left: 0.4rem;
    align-items: center;
    border-radius: 0.5rem;
    max-width: fit-content;
    justify-content: center;
    transition: background 0.2s ease-in-out;
}

#flag:hover {
    background: #ffffff29;
}

#flag img {
    height: 1.8rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

#flag p {
    margin-right: 0.5rem;
}

.countriesModal {
    top: 0;
    left: 0;
    opacity: 0;
    width: 100vw;
    display: flex;
    height: 100vh;
    position: fixed;
    align-items: center;
    pointer-events: none;
    justify-content: center;
    backdrop-filter: blur(2px);
    transition: opacity .1s ease;
    background-color: #ffffff47;
}

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

.modalBox {
    margin: 2rem;
    width: 35rem;
    height: 25rem;
    padding: 2rem;
    border-radius: 2.5rem;
    background: #ffffff;
    transform: translateY(-1.5rem);
    transition: transform .38s ease-in-out;
}

.countriesModal.active .modalBox {
    transform: translateY(0rem);
}

.searchBox {
    border: 0;
    width: 95%;
    display: flex;
    height: 2.5rem;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    border-radius: 2rem;
    align-items: center;
    justify-content: space-between;
    background: rgb(26, 185, 182);
}

.searchBox input {
    border: 0;
    width: 90%;
    height: 100%;
    font-size: 1rem;
    padding-left: 1rem;
    background: rgb(26, 185, 182);
}

.searchBox input:focus {
    border: 0;
    outline: none;
}

.searchBox input::placeholder {
    color: rgb(253, 253, 253);
}

.searchBox i {
    font-size: 1.1rem;
    color: rgb(253, 253, 253);
    margin-right: 0.8rem;
}

.countriesBox {
    width: 100%;
    height: 17rem;
    display: grid;
    margin-top: 2rem;
    overflow-y: scroll;
    place-items: center;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.countriesBox .countryTag {
    display: flex;
    margin: 0.5rem;
    display: flex;
    height: 2.8rem;
    padding: 0 1rem;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    width: fit-content;
    border-radius: 5rem;
    align-items: center;
    color: rgb(26, 185, 182)rgb(26, 185, 182);
    justify-content: space-between;
    transition: all 0.1s ease-in-out;
    border: 2px solid rgb(26, 185, 182);
}

.countriesBox .countryTag:hover,
.countriesBox .countryTag.selected {
    background: rgb(26, 185, 182);
    border: 2px solid rgb(197, 254, 255);
}

.countriesBox .countryTag.selected {
    outline-offset: 2px;
    outline: 2px solid rgb(26, 185, 182);
}

.countriesBox .countryTag img {
    height: 1.8rem;
    margin-right: 0.5rem;
}

.notFound {
    width: 100%;
    height: 100%;
    display: none;
    margin-top: 2rem;
    text-align: center;
}

.notFound i {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    color: rgb(185 26 88 / 70%);
}

.notFound h2 {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    color: rgb(185 26 88);
}

.notFound p {
    font-size: 0.9rem;
}

.convertedCurrencyBox .notFound i {
    font-size: 4rem;
}

.convertedCurrencyBox .notFound h2 {
    font-size: 1.9rem;
    color: rgb(185 26 88);
}

.convertedCurrencyBox .notFound p {
    font-size: 0.8rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.closeModal {
    border: 0;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    position: fixed;
    color: #ffffff;
    font-size: 1.2rem;
    border-radius: .5rem;
    background: rgb(26, 185, 182);
}

.convertedCurrencyBox {
    left: 0;
    top: 10rem;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    position: absolute;
    background: #ffffff;
    border-top-left-radius: 1.5rem;
    transition: top .3s ease-in-out;
    border-top-right-radius: 1.5rem;
}

.convertedCurrencyBox.active {
    top: 0;
}

.convertedCurrencyBox>span {
    width: 4rem;
    cursor: grab;
    height: .4rem;
    display: block;
    margin-left: auto;
    margin-top: 0.8rem;
    margin-right: auto;
    border-radius: .5rem;
    background: #00000038;
}

.convertedListTag {
    margin-top: .5rem;
}

.convertedTag {
    display: flex;
    cursor: pointer;
    padding-top: .5rem;
    position: relative;
    align-items: center;
    padding-right: 1rem;
    padding-bottom: .8rem;
    justify-content: space-between;
    border-bottom: 1px solid #0000001f;
}

.convertedTag:first-child {
    margin-top: 1rem;
}

.convertedTag:last-child {
    margin-bottom: 10rem;
}

.convertedCurrencyBox.active .convertedTag:last-child {
    margin-bottom: 0rem;
}

.convertedTag #flag {
    cursor: auto;
    margin-left: 1rem;
}

.convertedTag #flag img {
    height: 2rem;
}

.convertedTag .convertedAmount {
    font-weight: 500;
    font-size: 1.5rem;
}

.convertedTag #flag p {
    color: #000;
    margin-left: .2rem;
}

.convertedTag .conversionData {
    bottom: 0;
    right: 1rem;
    font-size: .7rem;
    position: absolute;
}

.loadingScreen {
    width: 100%;
    height: 11rem;
    display: none;
    margin-top: 1rem;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.loadingScreen i {
    font-size: 3rem;
    margin-bottom: .5rem;
}

#loading {
    top: 0;
    left: 0;
    z-index: 2;
    width: 100vw;
    display: flex;
    height: 100vh;
    position: fixed;
    align-items: center;
    justify-content: center;
    background: rgb(151, 253, 255);
}

@media (max-width:550px){
    .mainContainer{
        width: 18rem;
        height: 30rem;
    }
    .modalBox {
        margin: 1rem;
        width: 18rem;
        height: 30rem;
    }
    .countriesBox {
        width: 100%;
        height: 20rem;
        display: flex !important;
        flex-direction: column;
        margin-top: 2rem;
        overflow-y: scroll;
        place-items: center;
    }
}