@keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

:root {
    --reactist-modal-overlay-fill: rgba(0, 0, 0, 0.5);
    --reactist-modal-padding-top: 13vh;
}

.overlay {
    isolation: isolate;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    background-color: var(--reactist-modal-overlay-fill);
    animation: fadein 0.2s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition: background-color 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--reactist-stacking-order-modal);
}

.overlay > [data-focus-lock-disabled] {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: var(--reactist-spacing-xxlarge);
}

.overlay.fitContent > [data-focus-lock-disabled] {
    padding-top: var(--reactist-modal-padding-top);
}
.overlay.fitContent > [data-focus-lock-disabled] .container {
    max-height: calc(100vh - 2 * var(--reactist-modal-padding-top));
}

.container {
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.16);
    transition: width 0.2s ease-in-out, box-shadow 0.5s;
    max-width: 100%;
}

/* responsive styles */

.full .container {
    width: 100%;
}
.large .container {
    width: 768px;
}
.medium .container {
    width: 580px;
}
.small .container {
    width: 480px;
}
.xsmall .container {
    width: 448px;
}

@media (min-width: 992px) {
    .xlarge .container {
        width: 960px;
    }
}

@media (min-width: 1200px) {
    .xlarge .container {
        width: 1060px;
    }
}

@media (max-width: 1000px) {
    .xlarge .container {
        width: 768px;
    }
}

@media (max-width: 580px) {
    .overlay:not(.xsmall):not(.small) .container {
        width: 100% !important;
        max-height: none;
    }
    .overlay.expand:not(.xsmall):not(.small) > [data-focus-lock-disabled] {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }
    .overlay.expand:not(.xsmall):not(.small) .container {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}

@media (max-width: 400px) {
    .container {
        width: 100% !important;
        max-height: none;
    }
    .overlay.expand > [data-focus-lock-disabled] {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }
    .overlay.expand .container {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}

/* header */

.buttonContainer {
    display: flex;
    align-items: center;
    height: 32px;
}

.headerContent {
    /* This ensures that the min-height is always applied to the header content, */
    /* regardless of the modal having a button or not. */
    min-height: 32px; /* must be the same as the .buttonContainer height above */
}
