@import url("themes.css");

#modal {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,var(--modal-opacity));
    overflow: auto;

    /* Flexbox centers the .modal-content vertically and horizontally */
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Animate when opening */
    transition: opacity var(--modal-duration) ease;
}

@starting-style {
    #modal {
        opacity: 0;
    }
}

#modal > .modal-underlay {
    /* underlay takes up the entire viewport. This is only
    required if you want to click to dismiss the popup */
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0;
}

#modal > .modal-content {
    width: 90%;
    margin-top: 10vh;
    padding: 1vh;
    transition: transform var(--modal-duration) ease;
}

#modal.closing.htmx-swapping {
    opacity: 0;
    transition: opacity var(--modal-duration) ease-out;
}

#modal.closing.htmx-swapping > .modal-content {
    transform: scale(0.9);
    transition: transform var(--modal-duration) ease-out;
}