#mainModal {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: auto;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 0;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;

    width: 90%;
    max-width: 700px;
    height: fit-content;
    max-height: 80vh;

    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
    transition: opacity 0.25s ease;

    display: none;
}

.dialog-container::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0.1;
    transition: opacity 0.25s ease;
}

.dialog-container[open] {
    opacity: 1;
    scale: 1;
    display: flex;
    flex-direction: column;
}

.dialog-container[open]::backdrop {
    opacity: 1;
}

.dialog__content {
    position: relative;
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.btnCloseModal {
    position: absolute;
    right: 15px;
    top: 15px;

    background-attachment: #007bff;
    color: black;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}

.btnCloseModal:hover {
    background-attachment: #0056b3;
}

.body-no-scroll {
    overflow: hidden;
    padding-right: var(--scrollbar-width);
}

@media (min-width: 451px) {
    .dialog-container[open] {
        animation: flyIn .3s ease forwards;
    }

    .dialog-container.closing {
        animation: flyOut .25s ease forwards;
    }
}

@media (max-width: 450px) {
    #mainModal {
        width: 100%;
        top: auto !important;
        border-radius: 20px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        overflow: visible;
        -webkit-tap-highlight-color: transparent;
        touch-action: none;
    }

    .dialog-container::after {
        content: "";
        position: absolute;

        top: -16px;
        left: 50%;
        z-index: 1;
        transform: translateX(-50%);

        width: 48px;
        height: 5px;

        background: #fff;
        border-radius: 999px;

        transition: 
            background .2s ease,
            width .2s ease,
            transform .2s ease;
    }

    .dialog-container:active::after {
        background: #c8c8ca;
        width: 56px;
        transform: translateX(-50%) scale(1.05);
    }

    .dialog-container[open] {
        animation: slideInFromBottom .3s ease forwards;
    }

    .dialog-container.closing {
        animation: slideOutFromBottom .3s ease forwards;
    }
}

@keyframes flyIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.1);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes flyOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.1);
    }
}

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translate(-50%, 100%);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0%);
    }
}

@keyframes slideOutFromBottom {
    0% {
        opacity: 1;
        transform: translate(-50%, 0%);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, 100%);
    }
}