/* TODO: Fix animation to close modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
    background-color: #ff00009c;
}

.modal__background {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #0000009c;
    z-index: 1;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

.modal__background--active {
    opacity: 1;
    height: 100vh;
    width: 100%;
}

.modal__main {
    left: 100%;
    height: 100vh;
    width: 100%;
    position: absolute;
    background-color: #f7fbff;
    z-index: 2;
    transition: all 0.5s ease-in-out;
}

.modal__main--active {
    transform: translateX(-100%);
    transition-delay: 0.2s;
}

.modal__closeButton {
    position: absolute;
    transform: none;
    top: 3%;
    left: 4%;
    z-index: 6;
    border-radius: 100%;
    border: none;
    border: 2px solid #d3bf4e;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: none;
    transform: rotate(45deg);
}

.modal__closeButton--active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal__btnImg,
.modal__btnImgArrow {
    position: absolute;
    rotate: -45deg;
    height: 100%;
    width: 100%;
    border-radius: 100%;
}

.modal__btnImg {
    z-index: 7;
    background-color: #f0f0f0;
    transition: all 0.2s ease;
}

.modal__btnImgArrow {
    z-index: 6;
}

.modal__btnImg:hover {
    opacity: 0;
}

/*modal content*/
.modal__content {
    height: 100%;
    width: 100%;
}

.modalCharacter {
    position: relative;
    height: 100%;
    width: 100%;
    color: white;
    overflow: hidden;
}

.modalCharacter__background {
    position: absolute;
    height: 100%;
    width: 100%;
    background-color: #353535;
}

.modalCharacter__backgroundImg {
    z-index: 1;
    height: 100%;
    width: 100%;
    border: 3px solid #d3bf4e;
    border-radius: 70px;
    object-fit: cover;
    object-position: center 0;
    background-color: transparent;
}

.modalCharacter__backgroundImg--nation {
    z-index: 0;
    top: 0;
    left: 0;
}

.modalCharacter__backgroundFilter {
    position: absolute;
    height: 100%;
    width: 100%;
    z-index: 2;
    top: 0;
    left: 0;
    border: 3px solid #d3bf4e;
    border-radius: 70px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
    opacity: 1;
    transition: opacity 0.2s ease;
}
.modalCharacter__backgroundFilter--hidden {
    opacity: 0.25;
}

.modalCharacter__border {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border: 3px solid #d3bf4e;
}

.modalCharacter__borderStar {
    position: absolute;
    height: 20px;
    transform: rotate(45deg);
}
.modalCharacter__borderStar--2 {
    top: 0;
    right: 0;
}
.modalCharacter__borderStar--3 {
    bottom: 0;
    left: 0;
}
.modalCharacter__borderStar--4 {
    bottom: 0;
    right: 0;
}

.modalCharacter__imgContainer {
    position: relative;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    overflow: hidden;
    max-height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.modalCharacter__img {
    position: absolute;
    max-width: 157%;
    height: 90%;
    object-fit: contain;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    filter: drop-shadow(10px 7px 10px black);
}
.modalCharacter__img--hidden {
    display: none;
}

.modalCharacter__icon {
    position: absolute;
    object-fit: contain;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    filter: drop-shadow(10px 7px 10px black);
    width: 50%;
    aspect-ratio: 1/1;
    border-radius: 100%;
    border: 3px dashed #d3bf4e;
    opacity: 1;
    transition: all 0.2s ease;
}
.modalCharacter__icon--hidden {
    display: none;
}

.modalCharacter__selectorImg {
    position: absolute;
    top: 55%;
    right: 8%;
    width: 35px;
    height: 35px;
    z-index: 100;
    border-radius: 100%;
    background-image: url('../img/circleStar.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: white;
    border: 2px solid #d3bf4e;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modalCharacter__selectorImg:active {
    background-color: #d3bf4e;
    background-position: right;
}

.modalCharacter__nameContainer {
    color: #f0f0f0;
    position: absolute;
    top: 50%;
    left: 5%;
    z-index: 4;
    width: 80%;
}

.modalCharacter__name {
    width: max-content;
    max-width: 90%;
    font-size: 1.6rem;
    font-weight: bold;
    text-wrap: balance;
    border-radius: 10px;
    filter: drop-shadow(5px 5px 5px black);
}

.modalCharacter__title {
    filter: drop-shadow(5px 5px 5px black);
}
.modalCharacter__star {
    height: 25px;
    filter: drop-shadow(#d3bf4e 2px 2px 2px);
}

.modalCharacter__descriptionContainer {
    width: 90%;
    max-height: 25%;
    overflow: auto;
    background-color: #7170709d;
    backdrop-filter: blur(1.5px);
    position: absolute;
    top: 67.5%;
    left: 5%;
    z-index: 4;
    border-radius: 10px;
    box-shadow: 5px 5px 5px #4d4b4b9d;
    transition: all 0.3s ease;
}

.modalCharacter__descriptionContainer:hover {
    height: 100%;
}

.modalCharacter__descriptionContainer::after {
    content: 'v';
    position: absolute;
    width: 35px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    transition: all 0.3s ease;
}

.modalCharacter__descriptionContainer:hover::after {
    opacity: 0;
}
.modalCharacter__description {
    padding: 10px;
    max-width: 100%;
    width: max-content;
    font-size: 1rem;
    text-wrap: pretty;
    margin: auto;
    margin-bottom: 1px;
}

.modalCharacter__properties {
    padding: 5px;
    position: relative;
    max-width: 100%;
    width: 100%;
    height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 0.5rem;
    transition: all 0.3s ease;
    line-height: 1.05;
    opacity: 0;
    margin-bottom: 20px;
}

.modalCharacter__descriptionContainer:hover .modalCharacter__properties {
    height: 100%;
    overflow: initial;
    opacity: 1;
}

.modalCharacter__property {
    display: flex;
    text-align: left;
    gap: 5px;
    flex-flow: column nowrap;
    padding: 15px;
    border: 1px solid #d3bf4e;
}

.modalCharacter__propertyTitle {
    justify-self: flex-start;
    text-align: center;
    font-weight: bold;
    color: #d3bf4e;
    border-bottom: 1px solid #d3bf4e;
}

.errorModal {
    position: fixed;
    display: flex;
    top: calc(100% - 65px);
    left: 100%;
    z-index: 102;
    padding: 10px 20px;
    background-color: #e1c970;
    border: 3px solid #f0f0f0;
    gap: 10px;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 5px 5px 5px #4d4b4b9d;
    transform: translate(0, -65px);
    overflow: auto;
    width: max-content;

    transition: transform 0.3s ease-in-out;
}

.errorModal--active {
    transform: translate(calc(-100% - 25px), -65px);
}

.errorModal__message {
    text-align: center;
    height: 100%;
}

.errorModal__closeButton {
    height: 2em;
    aspect-ratio: 1/1;
    border-radius: 100%;
    cursor: pointer;
    border: 0px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}
